Debian Codegraph @

debian/rules

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