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
|
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
export DH_VERBOSE = 1
export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
include /usr/share/dpkg/pkg-info.mk
PYTHON3_VERSIONS = $(shell py3versions -r)
py3sdo = set -e; $(foreach py, $(PYTHON3_VERSIONS), $(py) $(1);)
%:
dh $@ --with python3,sphinxdoc --buildsystem=pybuild
override_dh_auto_test:
PYTHONPATH=. pytest-3 test/
override_dh_auto_clean:
$(call py3sdo, setup.py clean)
override_dh_auto_build:
$(call py3sdo, setup.py build)
# Build the documentation with Sphinx for Python 3 and access to a
# binary extension module built under build/lib.*.
PYTHONPATH="$$(find build -name 'lib.*')" http_proxy='127.0.0.1:9' \
/usr/share/sphinx/scripts/python3/sphinx-build \
doc/source build/html
override_dh_auto_install:
$(call py3sdo, setup.py install --root=$(CURDIR)/debian/$(DEB_SOURCE) --install-layout=deb)
# Remove unwanted files
# Directory /usr/share/poezio only contains:
# * a license file (redundant with debian/copyright);
# * a changelog (already installed in /usr/share/doc/poezio);
# * a README file (already installed in /usr/share/doc/poezio).
rm -rf debian/poezio/usr/share/poezio
# We are building and installing the HTML documentation, which
# already includes the source RST documentation
rm -rf debian/poezio/usr/share/doc/poezio/source
# We do not need gnupg.py, which is provided in package python3-gnupg
rm -f debian/poezio/usr/lib/python3/dist-packages/poezio_plugins/gpg/gnupg.py
# Move binary libraries to the binary package
for library in debian/poezio/usr/lib/python*/dist-packages/poezio/*.so ; \
do \
short_path="$${library#debian/poezio/}" ; \
short_dir="$${short_path%/*}" ; \
if [ ! -e "debian/python3-poezio-poopt/$$short_dir" ] ; \
then \
mkdir -p "debian/python3-poezio-poopt/$$short_dir" ; \
fi ; \
mv "$$library" "debian/python3-poezio-poopt/$$short_dir" ; \
done
override_dh_python3:
dh_python3 --shebang=/usr/bin/python3
|