Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2
3 # DH_VERBOSE := 1
4
5 export DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow
6 export LC_ALL=C.UTF-8
7
8 include /usr/share/dpkg/default.mk
9
10 DTMP := $(CURDIR)/debian/tmp
11
12 # a few ISO-8859-1 files needing conversion to UTF-8
13 ISOFILES = $(DTMP)/usr/share/hyphy/TemplateBatchFiles/PARRIS.bf
14 ISOFILES += $(DTMP)/usr/share/hyphy/TemplateBatchFiles/TemplateModels/MEC.mdl
15 ISOFILES += $(DTMP)/usr/share/hyphy/TemplateBatchFiles/TemplateModels/models.lst
16
17 %:
18 dh $@ --buildsystem=cmake
19
20 # FIXME: build NEON SIMDe variants for Aarch64.
21
22 override_dh_auto_clean:
23 ifeq (amd64,$(DEB_HOST_ARCH))
24 dh_auto_clean --builddirectory obj-avx
25 dh_auto_clean --builddirectory obj-sse3
26 endif
27 dh_auto_clean
28
29 override_dh_auto_configure:
30 ifeq (amd64,$(DEB_HOST_ARCH))
31 dh_auto_configure -- -DINSTALL_PREFIX=/usr -DNOAVX=ON -DNOSSE3=ON
32 dh_auto_configure --builddirectory obj-avx -- -DINSTALL_PREFIX=/usr -DNOAVX=OFF -DNOSSE3=OFF
33 dh_auto_configure --builddirectory obj-sse3 -- -DINSTALL_PREFIX=/usr -DNOAVX=ON -DNOSSE3=OFF
34 else
35 dh_auto_configure -- -DINSTALL_PREFIX=/usr -DNOAVX=ON -DNOSSE3=ON
36 endif
37
38 override_dh_auto_build:
39 ifeq (amd64,$(DEB_HOST_ARCH))
40 dh_auto_build -- MP MPI
41 dh_auto_build --builddirectory obj-avx -- MP MPI
42 dh_auto_build --builddirectory obj-sse3 -- MP MPI
43 else
44 dh_auto_build -- MP MPI
45 endif
46
47 override_dh_install-arch:
48 # convert a few ISO-8859-1 files to address national-encoding
49 set -e \
50 ; for file in $(ISOFILES) \
51 ; do iconv -f ISO-8859-1 -t UTF-8 < "$${file}" > "$${file}.new" \
52 ; mv -v "$${file}.new" "$${file}" \
53 ; done
54 dh_install -a
55 find -type f -name HYPHYMPI -exec chrpath --delete '{}' ';'
56 ifeq (amd64,$(DEB_HOST_ARCH))
57 mkdir -p debian/hyphy-mpi/usr/lib/$(DEB_SOURCE)/bin
58 mkdir -p debian/hyphy-pt/usr/lib/$(DEB_SOURCE)/bin
59 cp obj-avx/HYPHYMPI debian/hyphy-mpi/usr/lib/$(DEB_SOURCE)/bin/HYPHYMPI-avx
60 cp obj-sse3/HYPHYMPI debian/hyphy-mpi/usr/lib/$(DEB_SOURCE)/bin/HYPHYMPI-sse3
61 cp obj-avx/hyphy debian/hyphy-pt/usr/lib/$(DEB_SOURCE)/bin/hyphy-avx
62 cp obj-sse3/hyphy debian/hyphy-pt/usr/lib/$(DEB_SOURCE)/bin/hyphy-sse3
63 mv debian/hyphy-mpi/usr/bin/HYPHYMPI debian/hyphy-mpi/usr/lib/$(DEB_SOURCE)/bin/
64 mv debian/hyphy-pt/usr/bin/hyphy debian/hyphy-pt/usr/lib/$(DEB_SOURCE)/bin/
65 cd $(CURDIR)/debian/hyphy-mpi/usr/bin && \
66 ln -s ../lib/$(DEB_SOURCE)/bin/simd-dispatch HYPHYMPI
67 cd $(CURDIR)/debian/hyphy-pt/usr/bin && \
68 ln -s ../lib/$(DEB_SOURCE)/bin/simd-dispatch hyphy
69 endif
70
71 override_dh_install-indep:
72 dh_install -i
73 ifeq (amd64,$(DEB_HOST_ARCH))
74 dh_install -phyphy-common debian/bin/simd-dispatch /usr/lib/$(DEB_SOURCE)/bin
75 endif
76
77 override_dh_auto_test:
78 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
79 ifeq (amd64,$(DEB_HOST_ARCH))
80 set -e ; for SIMD in avx sse3 ; do \
81 if lscpu | grep -q $${SIMD} ; then \
82 find "obj-$${SIMD}/" \
83 -not -path "*/CMakeFiles/*" \
84 -type f,l \
85 -executable \
86 -exec cp -v '{}' . \; && \
87 ./run_unit_tests.sh ; \
88 fi ; \
89 done
90 endif
91 find "obj-$(DEB_HOST_GNU_TYPE)/" \
92 -not -path "*/CMakeFiles/*" \
93 -type f,l \
94 -executable \
95 -exec cp -v '{}' . \;
96 ./run_unit_tests.sh
97 endif
98
99 override_dh_installdocs-arch:
100 dh_installdocs -a
101 for news in debian/NEWS.Debian.* ; do \
102 pkg=`echo $${news} | sed 's/.*NEWS.Debian.//'` ; \
103 cp -a $${news} debian/$${pkg}/usr/share/doc/$${pkg}/NEWS.Debian ; \
104 done
105
106 override_dh_installdocs-indep:
107 dh_installdocs -i