| 1 |
#!/usr/bin/make -f |
| 2 |
# Uncomment this to turn on verbose mode. |
| 3 |
#export DH_VERBOSE=1 |
| 4 |
|
| 5 |
# This has to be exported to make some magic below work. |
| 6 |
#export DH_OPTIONS |
| 7 |
|
| 8 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 9 |
|
| 10 |
install_file = /usr/bin/install -p -o root -g root -m 644 |
| 11 |
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) |
| 12 |
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) |
| 13 |
arch = $(shell dpkg-architecture -qDEB_BUILD_ARCH) |
| 14 |
|
| 15 |
# Which MPI implementation? |
| 16 |
# set ARCH_DEFAULT_MPI_IMPL |
| 17 |
include /usr/share/mpi-default-dev/debian_defaults |
| 18 |
|
| 19 |
ifneq ($(wildcard /usr/lib/$(DEB_HOST_MULTIARCH)/hdf5/$(ARCH_DEFAULT_MPI_IMPL)/libhdf5.so),) |
| 20 |
export DEB_CPPFLAGS_MAINT_APPEND := -I/usr/include/hdf5/$(ARCH_DEFAULT_MPI_IMPL) |
| 21 |
export DEB_LDFLAGS_MAINT_APPEND := -Wl,-L/usr/lib/$(DEB_HOST_MULTIARCH)/hdf5/$(ARCH_DEFAULT_MPI_IMPL) |
| 22 |
endif |
| 23 |
|
| 24 |
CONFIGURE_FLAGS = --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \ |
| 25 |
--prefix=/usr --mandir=\$${prefix}/share/man \ |
| 26 |
--infodir=\$${prefix}/share/info \ |
| 27 |
--with-libctl=/usr/share/libctl \ |
| 28 |
--with-gcc-arch=no \ |
| 29 |
--enable-shared --with-pic --enable-cxx \ |
| 30 |
--with-mpi=yes \ |
| 31 |
--enable-maintainer-mode |
| 32 |
|
| 33 |
%: |
| 34 |
dh $@ --with autoreconf |
| 35 |
|
| 36 |
override_dh_auto_configure: |
| 37 |
# the latest patch is only needed on architectures without SSE or other special stuff |
| 38 |
if [ "${arch}" = "i386" ] || \ |
| 39 |
[ "${arch}" = "hurd-i386" ] ; then \ |
| 40 |
echo "all patches needed, do nothing here"; \ |
| 41 |
else \ |
| 42 |
echo "we don't need the last patch"; \ |
| 43 |
quilt pop; \ |
| 44 |
fi |
| 45 |
F77=gfortran dh_auto_configure -- $(CONFIGURE_FLAGS) |
| 46 |
|
| 47 |
override_dh_auto_install: |
| 48 |
dh_installchangelogs NEWS.md |
| 49 |
dh_auto_install |
| 50 |
find |
| 51 |
$(RM) debian/tmp/usr/lib/python*/site-packages/meep/*.pyc |
| 52 |
$(RM) debian/tmp/usr/lib/python*/site-packages/meep/*.pyo |
| 53 |
$(RM) debian/tmp/usr/lib/python*/site-packages/meep/*.a |
| 54 |
$(RM) debian/tmp/usr/lib/python*/site-packages/meep/*.la |
| 55 |
$(RM) debian/tmp/usr/lib/python*/site-packages/meep/mpb/*.pyc |
| 56 |
$(RM) debian/tmp/usr/lib/python*/site-packages/meep/mpb/*.pyo |
| 57 |
$(RM) debian/tmp/usr/lib/python*/site-packages/meep/mpb/*.a |
| 58 |
$(RM) debian/tmp/usr/lib/python*/site-packages/meep/mpb/*.la |
| 59 |
$(RM) -rf debian/tmp/usr/lib/python*/site-packages/meep/__pycache__/ |
| 60 |
$(RM) -rf debian/tmp/usr/lib/python*/site-packages/meep/adjoint/__pycache__/ |
| 61 |
|
| 62 |
|
| 63 |
override_dh_clean: |
| 64 |
# we do not need this anymore |
| 65 |
rm -f tests/latest_output |
| 66 |
dh_clean |
| 67 |
|
| 68 |
override_dh_auto_test: |
| 69 |
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) |
| 70 |
echo ${arch} |
| 71 |
if [ "${arch}" = "armel" ] || \ |
| 72 |
[ "${arch}" = "riscv64" ] || \ |
| 73 |
[ "${arch}" = "hurd-i386" ] ; then \ |
| 74 |
echo "Do not make tests on this architecture" ;\ |
| 75 |
else \ |
| 76 |
echo "Do make tests on this architecture" ;\ |
| 77 |
make check; \ |
| 78 |
cat tests/test-suite.log; \ |
| 79 |
fi |
| 80 |
# # check whether testsuite runs everywhere |
| 81 |
# make check; \ |
| 82 |
# cat tests/test-suite.log |
| 83 |
endif |
| 84 |
|
| 85 |
override_dh_shlibdeps: |
| 86 |
dh_shlibdeps |
| 87 |
dh_numpy3 |