#!/usr/bin/make -f # Uncomment this to turn on verbose mode. export DH_VERBOSE=1 export LC_ALL=C.UTF-8 export PYBUILD_NAME=biom-format export PYBUILD_DESTDIR_python2=debian/python-$(PYBUILD_NAME) export PYBUILD_DESTDIR_python3=debian/python3-$(PYBUILD_NAME) export examplepkg=python-$(PYBUILD_NAME)-examples export PYBUILD_AFTER_INSTALL_python2=dh_numpy export PYBUILD_AFTER_INSTALL_python3=dh_numpy3 ## When trying better hardening the build fails # export DEB_BUILD_MAINT_OPTIONS = hardening=+all export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow %: dh $@ --with python2,python3,bash-completion,sphinxdoc --buildsystem=pybuild override_dh_auto_build: # arch USE_CYTHON=true dh_auto_build # indep: PYTHONPATH=. http_proxy='127.0.0.1:9' sphinx-build -N -b html doc build/html PYTHONPATH=. http_proxy='127.0.0.1:9' sphinx-build -N -b man doc build/man override_dh_auto_install: dh_auto_install # Install command-line scripts in separate tools package. dh_install --sourcedir=$(PYBUILD_DESTDIR_python3) \ --package=$(PYBUILD_NAME)-tools usr/bin rm -rf $(PYBUILD_DESTDIR_python2)/usr/bin rm -rf $(PYBUILD_DESTDIR_python3)/usr/bin override_dh_installdocs-indep: dh_installdocs --indep dh_sphinxdoc --indep override_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) # replace cp by ln to close bug #919586 cp -a examples $(shell pybuild --print build_dir --interpreter python) cp -a examples $(shell pybuild --print build_dir --interpreter python3) # ln -s $(CURDIR)/examples $(shell pybuild --print build_dir --interpreter python) # ln -s $(CURDIR)/examples $(shell pybuild --print build_dir --interpreter python3) dh_auto_test endif override_dh_fixperms: dh_fixperms find debian -name exercise_cli.sh -exec chmod +x \{\} \; override_dh_installexamples: dh_installexamples find debian -name "*.c" -delete find debian -name "*.pyx" -delete # remove tests from Python2 package, move tests from Python3 package to examples package if [ ! -d biom/tests ] ; then \ mv `find debian/python*$(PYBUILD_NAME) -name tests -type d` biom ; \ else \ find debian/python*$(PYBUILD_NAME) -name tests -type d | xargs rm -rf ; \ fi