-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
57 lines (47 loc) · 2.25 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
.PHONY: all build install clean commit-release release deb repo
PACKAGE=fritzbox-internet-ticket
SHELL=bash
VERSION := $(shell git rev-list HEAD --count --no-merges)
GIT_STATUS := $(shell git status --porcelain)
all: build
build: clean
python3 -m venv --clear build/venv
source build/venv/bin/activate ; pip install -r requirements.txt ; \
pyinstaller -F --distpath out --clean --additional-hooks-dir pyinstaller-hooks --hidden-import google.cloud.pubsub fritzbox-internet-ticket-printing-service.py
commit-release:
ifneq ($(GIT_STATUS),)
$(error Please commit all changes before releasing. $(shell git status 1>&2))
endif
gbp dch --full --release --new-version=$(VERSION) --distribution stable --auto --git-author --commit
git push
release: commit-release deb
@latest_tag=$$(git describe --tags `git rev-list --tags --max-count=1 2>/dev/null` 2>/dev/null); \
comparison="$$latest_tag..HEAD"; \
if [ -z "$$latest_tag" ]; then comparison=""; fi; \
changelog=$$(git log $$comparison --oneline --no-merges --reverse); \
github-release schlomo/$(PACKAGE) v$(VERSION) "$$(git rev-parse --abbrev-ref HEAD)" "**Changelog**<br/>$$changelog" 'out/*.deb'; \
git pull
dput ppa:sschapiro/ubuntu/ppa/bionic out/$(PACKAGE)_*_source.changes
install: build
install -m 0755 -D -t $(DESTDIR)/usr/bin fritzbox-internet-ticket
install -m 0755 -D -t $(DESTDIR)/usr/bin fritzbox-get-internet-tickets.py
install -m 0644 -D -t $(DESTDIR)/usr/share/applications fritzbox-internet-ticket*.desktop
install -m 0644 -D -t $(DESTDIR)/usr/share/icons/hicolor/scalable/apps fritzbox-internet-ticket*.svg
install -m 0755 -D -t $(DESTDIR)/usr/bin out/fritzbox-internet-ticket-printing-service
install -m 0644 -D -t $(DESTDIR)/lib/systemd/system fritzbox-internet-ticket-printing.service
clean:
rm -Rf debian/$(PACKAGE)* debian/files out/* build/* dist/*
deb: clean
ifneq ($(MAKECMDGOALS), release)
$(eval DEBUILD_ARGS := -us -uc)
endif
debuild $(DEBUILD_ARGS) -i -I -Ivenv -I__pycache__ -b --lintian-opts --profile debian
debuild $(DEBUILD_ARGS) -i -I -Ivenv -I__pycache__ -S --lintian-opts --profile debian
mkdir -p out
mv ../$(PACKAGE)*.{xz,dsc,deb,build,changes,buildinfo} out/
rm debian/files
dpkg -I out/*.deb
dpkg -c out/*.deb
repo:
../putinrepo.sh out/*.deb
# vim: set ts=4 sw=4 tw=0 noet :