Skip to content

Commit

Permalink
packaging and building
Browse files Browse the repository at this point in the history
  • Loading branch information
schlomo committed Oct 7, 2018
1 parent f8cf04d commit 7d6088a
Show file tree
Hide file tree
Showing 10 changed files with 758 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/fritzbox-print-internet-ticket.py
/fritzbox-print-internet-ticket.py
/out
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

52 changes: 52 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
.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:
@echo No build required

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`); \
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/xenial out/$(PACKAGE)_*_source.changes

install:
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

clean:
rm -Rf debian/$(PACKAGE)* debian/files out/*

deb: clean
ifneq ($(MAKECMDGOALS), release)
$(eval DEBUILD_ARGS := -us -uc)
endif
debuild $(DEBUILD_ARGS) -i -b --lintian-opts --profile debian
debuild $(DEBUILD_ARGS) -i -S --lintian-opts --profile debian
mkdir -p out
mv ../$(PACKAGE)*.{xz,dsc,deb,build,changes} out/
dpkg -I out/*.deb
dpkg -c out/*.deb

repo:
../putinrepo.sh out/*.deb

# vim: set ts=4 sw=4 tw=0 noet :
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
fritzbox-internet-ticket (1) stable; urgency=medium

* Initial Release

-- Schlomo Schapiro <[email protected]> Sun, 07 Oct 2018 18:18:18 +0200
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
16 changes: 16 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Source: fritzbox-internet-ticket
Maintainer: Schlomo Schapiro <[email protected]>
Section: misc
Priority: optional
Standards-Version: 3.9.7
Homepage: https://github.com/schlomo/fritzbox-internet-ticket
Build-Depends: debhelper (>= 9), git-buildpackage

Package: fritzbox-internet-ticket
Architecture: all
Depends: ${misc:Depends}, python3, curl
Description: Retrieve internet tickets from Fritzbox and print on a Zebra printer
What it does:
* Retrieve 10 internet tickets from a Fritzbox
* Print the first ticket
* Upload the remaining 9 tickets to a Google Drive Form
3 changes: 3 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Files: *
Copyright: 2018 Schlomo Schapiro
License: GPL-3, see /usr/share/common-licenses/GPL-3
3 changes: 3 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/make -f
%:
dh $@
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (native)
2 changes: 1 addition & 1 deletion fritzbox-internet-ticket
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fi
if test "$FRITZBOX_GOOGLE_FORM_ID" -a "$FRITZBOX_GOOGLE_FORM_ENTRY_ID" ; then
tickets_urlencoded+="${tickets[1]}%0A${tickets[2]}%0A${tickets[3]}%0A${tickets[4]}%0A${tickets[5]}%0A${tickets[6]}%0A${tickets[7]}%0A${tickets[8]}%0A${tickets[9]}"

form='https://docs.google.com/forms/d/e/$FRITZBOX_GOOGLE_FORM_ID/formResponse?pli=1'
form="https://docs.google.com/forms/d/e/$FRITZBOX_GOOGLE_FORM_ID/formResponse?pli=1"
curl -d entry.$FRITZBOX_GOOGLE_FORM_ENTRY_ID=$tickets_urlencoded \
-s -o /dev/null "$form"
fi

0 comments on commit 7d6088a

Please sign in to comment.