| 1 |
#!/usr/bin/make -f |
| 2 |
#export DH_VERBOSE = 1 |
| 3 |
|
| 4 |
|
| 5 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 6 |
|
| 7 |
export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic |
| 8 |
export DEB_LDFLAGS_MAINT_APPEND = |
| 9 |
|
| 10 |
export PYBUILD_SYSTEM=distutils |
| 11 |
|
| 12 |
|
| 13 |
%: |
| 14 |
dh $@ --with python3 --buildsystem=makefile |
| 15 |
|
| 16 |
execute_after_dh_auto_configure: |
| 17 |
make updateversion |
| 18 |
|
| 19 |
execute_after_dh_auto_clean: |
| 20 |
rm -rf .pybuild *.egg-info miniupnpc.pc |
| 21 |
|
| 22 |
execute_after_dh_auto_build: |
| 23 |
dh_auto_build --buildsystem=pybuild |
| 24 |
|
| 25 |
override_dh_auto_install: |
| 26 |
dh_auto_install -- LIBDIR=lib/$(DEB_HOST_MULTIARCH) |
| 27 |
dh_auto_install --buildsystem=pybuild |
| 28 |
|
| 29 |
|
| 30 |
############################################ |
| 31 |
### Below is to manage upstream Git repo ### |
| 32 |
### and is not used during package build ### |
| 33 |
############################################ |
| 34 |
DEBVERS ?= $(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p') |
| 35 |
VERSION ?= $(shell echo '$(DEBVERS)' | sed -e 's/^[[:digit:]]*://' -e 's/[-].*//') |
| 36 |
DEBFLAVOR ?= $(shell dpkg-parsechangelog | grep -E ^Distribution: | cut -d" " -f2) |
| 37 |
DEBPKGNAME ?= $(shell dpkg-parsechangelog | grep -E ^Source: | cut -d" " -f2) |
| 38 |
GIT_TAG ?= $(shell echo '$(VERSION)' | sed -e 's/~/_/') |
| 39 |
DEBIAN_BRANCH ?= $(shell cat debian/gbp.conf | grep debian-branch | cut -d'=' -f2 | awk '{print $1}') |
| 40 |
|
| 41 |
gen-orig-xz: |
| 42 |
git tag -v $(GIT_TAG) || true |
| 43 |
if [ ! -f ../$(DEBPKGNAME)_$(VERSION).orig.tar.xz ] ; then \ |
| 44 |
git archive --prefix=$(DEBPKGNAME)-$(VERSION)/ $(GIT_TAG) | xz >../$(DEBPKGNAME)_$(VERSION).orig.tar.xz ; \ |
| 45 |
fi |
| 46 |
[ ! -e ../build-area ] && mkdir ../build-area || true |
| 47 |
[ ! -e ../build-area/$(DEBPKGNAME)_$(VERSION).orig.tar.xz ] && cp ../$(DEBPKGNAME)_$(VERSION).orig.tar.xz ../build-area |
| 48 |
|
| 49 |
update-man: |
| 50 |
help2man -o debian/man/upnpc-new.1 --include=debian/upnpc.h2m --version-string=2.0 --no-info --name "miniupnpc library test client." -s 1 -S miniupnpc --no-discard-stderr './upnpc-static' |
| 51 |
sed -i 's|protocol is UDP or TCP||; s|Options:|\.SH OPTIONS|; s|\.PP||; s|\.IP|\.BR|g; s|\.HP|\n\.TP|g; s|Usage : |\.SH SYNOPSIS\n\\\&|g; s|\\\&\./upnpc\\-static \[options\]|\\fBupnpc\\fR \[\\fIoptions\\fR\]|g; s|-STATIC||Ig; s|\.SH|\n\n\.SH|g' debian/man/upnpc-new.1 |
| 52 |
sed -ri 's|\\fB\\-([^\\]+)\\fR ([^ ]+) : |\.BI -\1 " \2"\n|g; s|\\fB\\-([^\\]+)\\fR : |\.B -\1\n|g' debian/man/upnpc-new.1 |
| 53 |
sed -zi 's|\n\n\n\n|\n\n\n|g; s|\n\n\n\n|\n\n\n|g; s|\n\.BR\n\\fBupnpc|:\n\n\\fBupnpc|g' debian/man/upnpc-new.1 |
| 54 |
sed -rzi 's|\n([^\n]+)\n\.BR\n([^\n]+)|\n\2\n\.br\n\1|g' debian/man/upnpc-new.1 |
| 55 |
# Remember to check against the old man. Don't copy-paste. |