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 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
|
#!/usr/bin/make -f
# -*- makefile -*-
PY2 = $(shell pyversions -vd)
PY2VERS = $(shell pyversions -vr)
PY3VERS = $(shell py3versions -vr)
# Specify a specific version of MPI to use in the build, otherwise
# just use the default.
# MPI=.openmpi
%:
dh $@ --with python2,python3 --buildsystem python_distutils
# Enforce distutils build system to build for all supported versions
# then build documentation
override_dh_auto_build:
dh_auto_build $@ -- \
--mpicc=/usr/bin/mpicc$(MPI) --mpicxx=/usr/bin/mpicxx$(MPI)
: # Build for Python 3
set -e; for v in $(PY3VERS); do \
python$$v setup.py build \
--mpicc=/usr/bin/mpicc$(MPI) --mpicxx=/usr/bin/mpicxx$(MPI); \
done
: # Build documentation now
PYTHONPATH=`/bin/ls -d $(CURDIR)/build/lib.*$(PY2)` \
make -C docs/source/usrman/ html
-rm -r docs/source/usrman/_build/html/_sources
: # objects inventory is of no use for the package
-rm docs/source/usrman/_build/html/objects.inv
override_dh_auto_install:
dh_auto_install
: # Install for Python 3
set -e; for v in $(PY3VERS); do \
python$$v setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb; \
done
: # Remove python-mpi binaries
find $(CURDIR)/debian/tmp -name python-mpi -delete
find $(CURDIR)/debian/tmp -type d -empty -delete
override_dh_install:
dh_install
: # create symlinks for .h files
set -e; for v in $(PY2VERS); do \
[ -d $(CURDIR)/debian/python-mpi4py/usr/include/python$$v ] || \
mkdir -p $(CURDIR)/debian/python-mpi4py/usr/include/python$$v; \
dh_link usr/lib/python$$v/dist-packages/mpi4py/include/mpi4py usr/include/python$$v/mpi4py; \
done
: # Python 3
: # 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 \
[ -d $(CURDIR)/debian/python3-mpi4py/usr/include/python$$v ] || \
pythonv_inc_dir=$$(readlink -f /usr/include/python$$v); \
mkdir -p $(CURDIR)/debian/python3-mpi4py$$pythonv_inc_dir; \
dh_link -ppython3-mpi4py usr/lib/python3/dist-packages/mpi4py/include/mpi4py $${pythonv_inc_dir#/}/mpi4py; \
done
: # share -dbg and normal package doc dirs
rm -rf debian/python-mpi4py-dbg/usr/share/doc/python-mpi4py-dbg
dh_link -ppython-mpi4py-dbg usr/share/doc/python-mpi4py usr/share/doc/python-mpi4py-dbg
rm -rf debian/python3-mpi4py-dbg/usr/share/doc/python3-mpi4py-dbg
dh_link -ppython3-mpi4py-dbg usr/share/doc/python3-mpi4py usr/share/doc/python3-mpi4py-dbg
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
set -e; for v in $(PY2VERS) $(PY3VERS); do \
PYTHONPATH=`/bin/ls -d $(CURDIR)/build/lib.*-$$v` \
/usr/bin/python$$v /usr/bin/nosetests -v --exclude='testPackUnpackExternal'; \
done
else
: # Skip unittests due to nocheck
endif
override_dh_strip:
dh_strip -ppython-mpi4py --dbg-package=python-mpi4py-dbg
dh_strip -ppython3-mpi4py --dbg-package=python3-mpi4py-dbg
override_dh_installchangelogs:
dh_installchangelogs HISTORY.txt
## 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_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
|