#!/usr/bin/make -f # -*- makefile -*- # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow BUILDARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH) FAILED_TESTS := test_infernal \ test_mothur \ test_parsinsert \ test_raxml_v730 \ test_rtax \ test_clustalw \ test_mafft \ test_unifrac \ test_seqsim.test_analysis \ test_seqsim.test_usage ONLYAMD64_TESTS := test_bwa # There are tests failing on certain architectures # We need to decide between not shipping cogent there or hiding # our eyes from these failures. See README.source for further # explanation. FAIL_ON_ARMEL_TESTS := test_core.test_profile FAIL_ON_PPC64_MIPS64EL := test_core.test_tree FAIL_ON_I386_TESTS := test_maths.test_stats.test_test \ test_seqsim.test_sequence_generators FAIL_ON_PPC64_TESTS := test_app.test_util FAIL_ON_S390X_TESTS := test_maths.test_optimisers \ test_format.test_pdb_color.PdbColorTests FAIL_ON_MIPS_TESTS := test_seqsim.test_sequence_generators export PYBUILD_NAME=cogent include /usr/share/dpkg/default.mk %: dh $@ --with python2 --buildsystem=pybuild override_dh_clean: #These files are rebuilt on-the-fly for f in `find -name '*.c'` ; do \ head -n 1 "$$f" | grep -q '^/\* Generated by Cython' && rm "$$f" ; \ done rm -rf build build-stamp rm -rf doc/_build dh_clean override_dh_auto_build: dh_auto_build cd doc; $(MAKE) html # remove superfluous files and dirs find doc/_build -name "*.doctree*" -delete rm -f doc/_build/html/_sources/COGENT_LICENSE.txt rm -f doc/_build/html/_static/jquery.js rm -f doc/_build/html/_static/underscore.js rm -rf doc/_build/html/_images/math/ override_dh_shlibdeps: dh_shlibdeps dh_numpy override_dh_compress: dh_compress --exclude=.js --exclude=.fasta --exclude=.txt --exclude=.pdb override_dh_installdocs: dh_installdocs rm -rf debian/$(DEB_SOURCE)/usr/share/doc/$(DEB_SOURCE)/html/_sources find debian -name doctrees -type d | xargs rm -rf override_dh_auto_test: ifeq (,$(filter nocheck, $(DEB_BUILD_OPTIONS))) cp -a tests/alltests.py tests/alltests.py~ # exclude tests known to fail for tst in $(FAILED_TESTS) ; do sed -i "/$${tst}/d" tests/alltests.py ; done # avoid amd64 only tools on other architectures ifeq ($(BUILDARCH),amd64) echo "bwa can be tested on amd64 arch" else for tst in $(ONLYAMD64_TESTS) ; do sed -i "/$${tst}/d" tests/alltests.py ; done ifeq ($(BUILDARCH),$(filter $(BUILDARCH), mips64el ppc64el ppc64)) for tst in $(FAIL_ON_PPC64_MIPS64EL) ; do sed -i "/$${tst}/d" tests/alltests.py ; done endif ifeq ($(BUILDARCH),armel) for tst in $(FAIL_ON_ARMEL_TESTS) ; do sed -i "/$${tst}/d" tests/alltests.py ; done endif ifeq ($(BUILDARCH),ppc64) for tst in $(FAIL_ON_PPC64_TESTS) ; do sed -i "/$${tst}/d" tests/alltests.py ; done endif ifeq ($(BUILDARCH),s390x) for tst in $(FAIL_ON_S390X_TESTS) ; do sed -i "/$${tst}/d" tests/alltests.py ; done endif ifeq ($(BUILDARCH),mips) for tst in $(FAIL_ON_MIPS_TESTS) ; do sed -i "/$${tst}/d" tests/alltests.py ; done endif ifeq ($(BUILDARCH),$(filter $(BUILDARCH), i386 kfreebsd-i386)) for tst in $(FAIL_ON_I386_TESTS) ; do sed -i "/$${tst}/d" tests/alltests.py ; done endif endif BLASTMAT=/usr/share/ncbi/data/ RDP_JAR_PATH=/usr/share/java/rdp_classifier.jar $(CURDIR)/run_tests -v # --debug # restore original tests file mv tests/alltests.py~ tests/alltests.py find tests -name "*.pyc" -delete endif