-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
87 lines (68 loc) · 2.39 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
.PHONY: build build-and-upload build-PPA build-python-dists build-docs clean-build \
clean test-all upload-twine upload-PPA upload-AUR
build: build-python-dists build-PPA build-arch-package build-windows-installer build-docs
build-and-upload: build upload-twine upload-AUR upload-PPA
VERSION = $(shell grep -Po "(?<=^__version__ = \").*(?=\")" polibeepsync/__init__.py)
# Building
#
build-PPA:
$(info Building PPA)
mkdir -p packaging/ubuntu/deb
python3 setup.py --command-packages=stdeb.command sdist_dsc \
--with-python3=true \
--with-python2=false \
-x packaging/ubuntu/stdeb.cfg \
-d packaging/ubuntu/deb
rsync -r packaging/ubuntu/polibeepsync-template/* packaging/ubuntu/deb/polibeepsync-$(VERSION)
cd packaging/ubuntu/deb/polibeepsync-$(VERSION) && \
dpkg-source --commit . add_desktop_file_and_icon && \
debuild -S -k205ABB76D38C4928714ACD3CDAE2A4AB08E9C765
rm -rf dist poliBeePsync-$(VERSION).tar.gz
build-arch-package:
$(info Building arch package)
mkdir -p packaging/arch/build
sed -i "s/pkgver=.*/pkgver=$(VERSION)/" packaging/arch/PKGBUILD
cd distro_packaging/arch; \
makepkg --printsrcinfo > .SRCINFO; \
build-windows-installer:
$(info Building windows installer)
mkdir -p packaging/windows
@pyinstaller polibeepsync.spec --distpath packaging/windows
build-python-dists:
$(info Building python dists)
mkdir -p packaging/pypi
python3 setup.py sdist -d packaging/pypi bdist_wheel -d packaging/pypi
# Mac OS App
build-app:
$(info Building Mac OS App)
@mkdir -p packaging/mac_os
@pyinstaller polibeepsync.spec --distpath packaging/mac_os
$(info Signing app with self signed certificate)
@codesign -s 'jacotsu.github.com' --force packaging/mac_os/PoliBeePsync.app
build-docs:
make html -C docs
# Testing
test-all:
$(info Testing poliBeePSync:$(VERSION))
./scripts/sanity_check.sh
# Uploading
upload-twine: build-python-dists
$(info Uploading to pypi)
twine upload -r pypi packaging/pypi/poliBeePsync-$(VERSION)*
upload-AUR: build-arch-package
$(info Uploading to AUR)
cd distro_packaging/arch; \
git add PKGBUILD .SRCINFO; \
git commit -m 'Version bump'\
git push
upload-PPA: build-PPA
$(info Uploading to Launchpad)
dput ppa:jacotsu/polibeepsync packaging/ubuntu/deb/polibeepsync_$(VERSION)-1_source.changes
# Cleaning
clean-build: clean build
clean:
$(info Cleaning builds)
rm -rf docs/build
rm -rf packaging/ubuntu
rm -rf packaging/pypi
rm -rf packaging/windows/build