| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
# DH_VERBOSE := 1 |
| 4 |
export LC_ALL=C.UTF-8 |
| 5 |
|
| 6 |
include /usr/share/dpkg/default.mk |
| 7 |
|
| 8 |
export DEB_BUILD_MAINT_OPTIONS=hardening=+all |
| 9 |
|
| 10 |
%: |
| 11 |
dh $@ |
| 12 |
|
| 13 |
# Only disable extended cpu flags support when they break the build |
| 14 |
# process, or are not properly probed at run time on the platform. |
| 15 |
# See mail exchanges on [email protected][1] for the rationale. |
| 16 |
# |
| 17 |
# [1]: https://lists.debian.org/debian-med/2022/10/msg00010.html |
| 18 |
execute_after_dh_auto_configure: |
| 19 |
ifeq ($(DEB_HOST_ARCH),i386) |
| 20 |
@ echo 'I: Disable 64-bit SIMD on i386.' |
| 21 |
sed -i -e '/HAVE_AVX2/d' \ |
| 22 |
-e '/HAVE_AVX512/d' \ |
| 23 |
-e '/HAVE_POPCNT/d' \ |
| 24 |
-e '/HAVE_SSE4_1/d' \ |
| 25 |
-e '/HAVE_SSSE3/d' config.h |
| 26 |
endif |
| 27 |
ifneq (,$(filter armel armhf,$(DEB_HOST_ARCH))) |
| 28 |
@ echo 'I: Disable NEON on $(DEB_HOST_ARCH).' |
| 29 |
echo '#undef __ARM_NEON' >> config.h |
| 30 |
endif |
| 31 |
|
| 32 |
# dh_missing warned about files not installed |
| 33 |
override_dh_auto_install: |
| 34 |
dh_auto_install |
| 35 |
d-shlibmove --commit \ |
| 36 |
--multiarch \ |
| 37 |
--devunversioned \ |
| 38 |
--exclude-la \ |
| 39 |
--movedev debian/tmp/usr/include usr \ |
| 40 |
debian/tmp/usr/lib/*/*.so |
| 41 |
find debian -name "lib*.la" -delete |
| 42 |
|
| 43 |
override_dh_auto_test: |
| 44 |
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) |
| 45 |
make check |
| 46 |
endif |
| 47 |
|
| 48 |
override_dh_installexamples: |
| 49 |
rm -Rf tests/.libs tests/*.trs tests/tokenise_name3 \ |
| 50 |
tests/test.out tests/*.o tests/*log \ |
| 51 |
tests/Makefile tests/Makefile.in tests/arith_dynamic tests/fqzcomp_qual \ |
| 52 |
tests/rans4x16pr tests/rans4x8 tests/varint tests/entropy |
| 53 |
dh_installexamples |
| 54 |
|
| 55 |
override_dh_auto_clean: |
| 56 |
dh_auto_clean |
| 57 |
find . -name "*.o" -o -name "*.lo" -delete |