#!/usr/bin/make -f # -*- makefile -*- PY3 = $(shell py3versions -vd) PY3VERS = $(shell py3versions -vr) LAST_CHANGE = $(shell dpkg-parsechangelog -S Date) BUILD_DATE = $(shell LC_ALL=C date -u "+%B %d, %Y" -d "$(LAST_CHANGE)") # Specify a specific version of MPI to use in the build, otherwise # just use the default. # MPI=.openmpi export http_proxy=http://127.0.0.1:9/ export https_proxy=http://127.0.0.1:9/ # disable build tests for these arches: # x32 consistently times out on tests ARCH_NO_TEST_LIST = x32 empty := space := $(empty)$(empty) # run tests, or not RUNTEST=yes ifneq (,$(findstring $(space)$(DEB_HOST_ARCH)$(space), $(space)$(ARCH_NO_TEST_LIST)$(space))) RUNTEST=no endif ifneq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) RUNTEST=no endif # hurd fails a couple of tests # but hell, hurd needs all the help it can get, so let it pass ARCH_IGNORE_FAILED_TESTS = hurd-i386 # normally, do not ignore test failures IGNORE_FAILED_TESTS=/bin/false ifneq (,$(findstring $(space)$(DEB_HOST_ARCH)$(space), $(space)$(ARCH_IGNORE_FAILED_TESTS)$(space))) IGNORE_FAILED_TESTS=/bin/true endif %: dh $@ --with python3,sphinxdoc --buildsystem pybuild cythonize: @echo "D: removing previously generated by Cython sources" find -iname *.c | xargs grep -l 'Generated by Cython' | xargs -r rm python3 setup.py build_src override_dh_autoreconf: dh_autoreconf debian/rules -- cythonize override_dh_auto_build-arch: dh_auto_build $@ -- \ --build-args "--mpicc=/usr/bin/mpicc$(MPI) --mpicxx=/usr/bin/mpicxx$(MPI)" override_dh_auto_build-indep: override_dh_auto_build-arch PYTHONPATH=`/bin/ls -d $(CURDIR)/.pybuild/cpython3_$(PY3)/build` \ make -C docs/source/usrman/ html man SPHINXOPTS="-D today=\"$(BUILD_DATE)\"" override_dh_auto_install: dh_auto_install : # Remove python-mpi binaries find $(CURDIR)/debian/tmp -name python-mpi -delete find $(CURDIR)/debian/tmp -type d -empty -delete override_dh_install-arch: dh_install -ppython3-mpi4py -X*.cpython-3?d*.so dh_install -ppython3-mpi4py-dbg : # create symlinks for .h files : # Can have python$$v symlink pointing to python3.?m or python3.?mu : # see #700995 for more details. So first look where it points to : # and use that directory set -e; for v in $(PY3VERS); do \ ABITAG=`python$$v -c "import sys; print(sys.abiflags)"`; \ [ -d $(CURDIR)/debian/python3-mpi4py/usr/include/python$$v$$ABITAG ] || \ mkdir -p $(CURDIR)/debian/python3-mpi4py/usr/include/python$$v$$ABITAG; \ dh_link -ppython3-mpi4py usr/lib/python3/dist-packages/mpi4py/include/mpi4py usr/include/python$$v$$ABITAG/mpi4py; \ done set -e; for v in $(PY3VERS); do \ ABITAG=`python$$v-dbg -c "import sys; print(sys.abiflags)"`; \ [ -d $(CURDIR)/debian/python3-mpi4py-dbg/usr/include/python$$v$$ABITAG ] || \ mkdir -p $(CURDIR)/debian/python3-mpi4py-dbg/usr/include/python$$v$$ABITAG; \ dh_link -ppython3-mpi4py-dbg usr/lib/python3/dist-packages/mpi4py/include/mpi4py usr/include/python$$v$$ABITAG/mpi4py; \ done override_dh_auto_test: set -e; \ if [ "$(RUNTEST)" = "no" ]; then \ echo Build tests have been disabled; \ else \ for vv in $(PY3VERS); do \ echo "I: testing using python$$vv"; \ v=`echo $$vv | sed "s/\..*//"`; \ PYTHONPATH=`/bin/ls -d $(CURDIR)/.pybuild/cpython$${v}_$${vv}/build` \ /usr/bin/python$$vv /usr/bin/nosetests3 -v --exclude='testPackUnpackExternal' -A "not network" || $(IGNORE_FAILED_TESTS); \ done; \ fi override_dh_sphinxdoc: ifeq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS))) dh_sphinxdoc -ppython-mpi4py-doc endif override_dh_installchangelogs: dh_installchangelogs CHANGES.rst ## Immediately useable documentation override_dh_compress: dh_compress -X.py -X.html -X.css -X.jpg -X.txt -X.js -X.json -X.rtc -X.par -X.bin -Xobjects.inv override_dh_strip: ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS))) dh_strip -ppython3-mpi4py --dbg-package=python3-mpi4py-dbg # dh_strip seemingly doesn't catch the PEP 3149-style debug names rm -f debian/python3-mpi4py/usr/lib/python3*/*-packages/*/*.cpython-3?d*.so endif override_dh_dwz: echo "dh_dwz is currently deactivated since it generates an error: \".debug_line reference above end of section\"" override_dh_auto_clean: dh_auto_clean $@ rm -rf `find -name build -type d` rm -rf `find -name _build -type d` : # Remove Cython generated files rm -f src/mpi4py.MPE.c src/mpi4py.MPI.c src/include/mpi4py/mpi4py.MPI_api.h get-orig-dev-source: cd ../mpi4py-hg/; \ uver=`sed -ne "/__version__/s,.*= *'\(.*\)' *$$,\1,gp" src/__init__.py`; \ tarball=../tarballs/mpi4py_$$uver+hg`date +"20%y%m%d"`.orig.tar.gz; \ echo "I: Generating $$tarball"; \ hg archive --exclude 'misc' -t tgz $$tarball;