#!/usr/bin/make -f export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk include /usr/share/dpkg/pkg-info.mk # Get the default Python version PYVERSION = $(shell pyversions -d -v) PY3VERSION = $(shell py3versions -d -v) export PYBUILD_NAME=breezy %: dh $* --with python2,python3,sphinxdoc,bash_completion --buildsystem=pybuild ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) CONCURRENCY = BRZ_CONCURRENCY=$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) endif override_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) [ -d debian/brzhome ] || mkdir debian/brzhome $(CONCURRENCY) \ BRZ_HOME=debian/brzhome \ BRZ_PLUGIN_PATH=-site:-user \ LC_ALL=C.UTF-8 \ PYTHONPATH=$(CURDIR)/.pybuild/cpython2_$(PYVERSION)_breezy/build \ $(shell pyversions -d) ./brz -Derror selftest -v --parallel=fork \ -Oselftest.timeout=6000 $(CONCURRENCY) \ BRZ_HOME=debian/brzhome \ BRZ_PLUGIN_PATH=-site:-user \ LC_ALL=C.UTF-8 \ PYTHONPATH=$(CURDIR)/.pybuild/cpython3_$(PY3VERSION)_breezy/build \ $(shell py3versions -d) ./brz -Derror selftest -v --parallel=fork \ -Oselftest.timeout=6000 endif override_dh_auto_clean: dh_auto_clean rm -rf debian/brzhome rm -f brzlib/*_pyx.c # It also doesn't really clean every thing... ls doc/en/user-reference/*txt | grep -v readme.txt | xargs rm -rf rm -rf doc/developers/make.bat \ doc/developers/Makefile \ doc/*/_build/ \ doc/en/release-notes/index.txt override_dh_install: dh_install find debian/ mkdir -p debian/python-breezy.tests/usr/lib for py in $(shell pyversions -r); do \ mkdir -p debian/python-breezy.tests/usr/lib/$$py/dist-packages/breezy; \ mv debian/python-breezy/usr/lib/$$py/dist-packages/breezy/tests \ debian/python-breezy.tests/usr/lib/$$py/dist-packages/breezy/tests; \ done for py in $(shell py3versions -r); do \ mkdir -p debian/python3-breezy.tests/usr/lib/$$py/dist-packages/breezy; \ mv debian/python3-breezy/usr/lib/$$py/dist-packages/breezy/tests \ debian/python3-breezy.tests/usr/lib/$$py/dist-packages/breezy/tests; \ done # Install the documentation; since html and txt and intermixed # under doc/, this is handier than trying to do it from brz-doc.install. ( cd doc && find -name "*.txt" -not -wholename "*/_build/*" -print0 ) | \ xargs -r0 -i'{}' -n1 install -D -m 644 'doc/{}' \ "debian/brz-doc/usr/share/doc/brz/txt/{}" rm debian/python-breezy-dbg/usr/man/man1/brz.1 \ debian/python-breezy-dbg/usr/man/man1/git-remote-bzr.1 \ debian/python-breezy-dbg/usr/bin/bzr-receive-pack \ debian/python-breezy-dbg/usr/bin/brz \ debian/python-breezy-dbg/usr/bin/bzr-upload-pack \ debian/python-breezy-dbg/usr/bin/git-remote-bzr rmdir debian/python-breezy-dbg/usr/man/man1 \ debian/python-breezy-dbg/usr/man rm debian/python-breezy/usr/man/man1/brz.1 \ debian/python-breezy/usr/man/man1/git-remote-bzr.1 \ debian/python-breezy/usr/bin/bzr-receive-pack \ debian/python-breezy/usr/bin/brz \ debian/python-breezy/usr/bin/bzr-upload-pack \ debian/python-breezy/usr/bin/git-remote-bzr rmdir debian/python-breezy/usr/man/man1 \ debian/python-breezy/usr/man rm debian/python3-breezy/usr/man/man1/brz.1 \ debian/python3-breezy/usr/man/man1/git-remote-bzr.1 \ debian/python3-breezy/usr/bin/bzr-receive-pack \ debian/python3-breezy/usr/bin/brz \ debian/python3-breezy/usr/bin/bzr-upload-pack \ debian/python3-breezy/usr/bin/git-remote-bzr rmdir debian/python3-breezy/usr/man/man1 \ debian/python3-breezy/usr/man rm debian/python3-breezy-dbg/usr/man/man1/brz.1 \ debian/python3-breezy-dbg/usr/man/man1/git-remote-bzr.1 \ debian/python3-breezy-dbg/usr/bin/bzr-receive-pack \ debian/python3-breezy-dbg/usr/bin/brz \ debian/python3-breezy-dbg/usr/bin/bzr-upload-pack \ debian/python3-breezy-dbg/usr/bin/git-remote-bzr rmdir debian/python3-breezy-dbg/usr/man/man1 \ debian/python3-breezy-dbg/usr/man override_dh_auto_missing: dh_missing --fail-missing override_dh_auto_build: dh_auto_build PYTHONHASHSEED=0 $(MAKE) docs-sphinx override_dh_compress: dh_compress -X.xvg -X.pdf override_dh_strip: ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS))) dh_strip -ppython-breezy --dbgsym-migration='python-breezy-dbg (<< 3.0.0~bzr7141-2)' dh_strip -ppython3-breezy --dbgsym-migration='python3-breezy-dbg (<< 3.0.0~bzr7141-2)' endif override_dh_link: # symlink identical resources. ( cd debian/brz-doc/usr/share/doc && fdupes -o name -r1q . | while read s; do \ set -- $$(echo $$s | tr ' ' '\n' | sort); \ f=$$1; shift; \ for d; do \ ln -sf /usr/share/doc/"$$d" "$$f"; \ done; \ done ) dh_link override_dh_sphinxdoc: ifneq "$(shell dh_listpackages | grep -- -doc)" "" dh_sphinxdoc -X searchtools.js endif # dh_sphinxdoc chokes if we delete the extra licence files before it runs. find debian/brz-doc/usr/share/doc/brz -name "licence.txt" -print | xargs rm -f