| 1 |
|
| 2 |
|
| 3 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 4 |
export DH_VERBOSE=1 |
| 5 |
|
| 6 |
include /usr/share/dpkg/default.mk |
| 7 |
|
| 8 |
ifneq (,$(filter $(DEB_HOST_ARCH),i386 kfreebsd-i386 hurd-i386)) |
| 9 |
DEB_CFLAGS_MAINT_APPEND=-msse -mfpmath=sse |
| 10 |
endif |
| 11 |
DEB_CFLAGS_MAINT_APPEND+=-ffat-lto-objects |
| 12 |
DEB_LDFLAGS_MAINT_APPEND+=-Wl,-flto -fvisibility=hidden -ffat-lto-objects |
| 13 |
|
| 14 |
export DEB_CFLAGS_MAINT_APPEND |
| 15 |
export DEB_LDFLAGS_MAINT_APPEND |
| 16 |
|
| 17 |
|
| 18 |
UPSTREAM_VERSION := $(shell echo $(DEB_VERSION_UPSTREAM) | sed 's/+.*//') |
| 19 |
|
| 20 |
libdir = /usr/lib/$(DEB_HOST_MULTIARCH) |
| 21 |
plugindir = $(libdir)/htslib |
| 22 |
|
| 23 |
%: |
| 24 |
dh $@ |
| 25 |
|
| 26 |
hello: |
| 27 |
echo "Upstream version: $(UPSTREAM_VERSION)" |
| 28 |
|
| 29 |
override_dh_auto_configure: |
| 30 |
ifneq (,$(filter $(DEB_HOST_ARCH),i386 kfreebsd-i386 hurd-i386)) |
| 31 |
cp htslib.pc.in debian/ |
| 32 |
cp debian/i386-htslib.pc.in ./htslib.pc.in |
| 33 |
endif |
| 34 |
|
| 35 |
cp -a test test_backup |
| 36 |
|
| 37 |
export ac_cv_func_mmap_fixed_mapped=yes \ |
| 38 |
&& autoconf \ |
| 39 |
&& dh_auto_configure -- \ |
| 40 |
--enable-libcurl \ |
| 41 |
--enable-gcs \ |
| 42 |
--enable-s3 \ |
| 43 |
--enable-plugins \ |
| 44 |
--with-plugin-dir='$(libdir)/htslib' \ |
| 45 |
--with-external-htscodecs \ |
| 46 |
--with-plugin-path='/usr/local/lib/htslib:/usr/local/libexec/htslib:$(plugindir)' |
| 47 |
|
| 48 |
override_dh_auto_build-arch: |
| 49 |
dh_auto_build -- \ |
| 50 |
CFLAGS="$$(dpkg-buildflags --get CFLAGS)" \ |
| 51 |
CPPFLAGS="-I. -DSAMTOOLS=1 $$(dpkg-buildflags --get CPPFLAGS)" \ |
| 52 |
PACKAGE_VERSION="$(UPSTREAM_VERSION)" \ |
| 53 |
libdir=$(libdir) |
| 54 |
|
| 55 |
|
| 56 |
override_dh_auto_build-indep: |
| 57 |
|
| 58 |
override_dh_auto_install-arch: |
| 59 |
for binary in sam test-regidx hts_endian test-bcf-sr test_bgzf ; do \ |
| 60 |
rm $(CURDIR)/test/$${binary} ; \ |
| 61 |
done |
| 62 |
dh_auto_install -- prefix=/usr \ |
| 63 |
CFLAGS="$$(dpkg-buildflags --get CFLAGS)" \ |
| 64 |
CPPFLAGS="-I. -DSAMTOOLS=1 $$(dpkg-buildflags --get CPPFLAGS)" \ |
| 65 |
PACKAGE_VERSION="$(UPSTREAM_VERSION)" \ |
| 66 |
libdir=$(libdir) |
| 67 |
dh_install |
| 68 |
dh_auto_install |
| 69 |
$(RM) -r test |
| 70 |
mv test_backup test |
| 71 |
|
| 72 |
override_dh_strip: |
| 73 |
|
| 74 |
dh_strip -Xlibhts.a |
| 75 |
|
| 76 |
override_dh_auto_install-indep: |
| 77 |
|
| 78 |
override_dh_auto_test-arch: |
| 79 |
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) |
| 80 |
dh_auto_test -- \ |
| 81 |
CFLAGS="$$(dpkg-buildflags --get CFLAGS)" \ |
| 82 |
CPPFLAGS="-I. -DSAMTOOLS=1 $$(dpkg-buildflags --get CPPFLAGS)" \ |
| 83 |
PACKAGE_VERSION="$(UPSTREAM_VERSION)" \ |
| 84 |
libdir=$(libdir) \ |
| 85 |
|| \ |
| 86 |
if find . -name "FAIL*" > /dev/null ; then \ |
| 87 |
for file in $$(find . -name "FAIL*"); do echo $${file}; cat $${file}; done && false ; \ |
| 88 |
fi |
| 89 |
endif |
| 90 |
|
| 91 |
override_dh_auto_test-indep: |
| 92 |
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) |
| 93 |
echo "Suppress test for Architecture independant builds." |
| 94 |
endif |
| 95 |
|
| 96 |
execute_after_dh_install-indep: |
| 97 |
sed -i 's#\.\./\.\./htslib/#htslib/#' `grep -Rl '../../htslib/' debian/htslib-test/*` |
| 98 |
|
| 99 |
execute_after_dh_installdocs: |
| 100 |
|
| 101 |
for pl in `grep -Rl '#!/usr/bin/env[[:space:]]\+perl' debian/*/usr/*` ; do \ |
| 102 |
sed -i '1s?^#!/usr/bin/env[[:space:]]\+perl?#!/usr/bin/perl?' $${pl} ; \ |
| 103 |
done |
| 104 |
|
| 105 |
override_dh_installchangelogs: |
| 106 |
dh_installchangelogs NEWS |
| 107 |
|
| 108 |
execute_before_dh_missing: |
| 109 |
|
| 110 |
rm -rf debian/tmp/usr/bin debian/tmp/usr/share/man |
| 111 |
|
| 112 |
execute_after_dh_fixperms: |
| 113 |
find debian -name simple_test_driver.sh -exec chmod +x \{\} \; |
| 114 |
|
| 115 |
execute_before_dh_auto_clean: |
| 116 |
ifneq (,$(filter $(DEB_HOST_ARCH),i386 kfreebsd-i386 hurd-i386)) |
| 117 |
ifneq (,$(wildcard debian/htslib.pc.in)) |
| 118 |
cp debian/htslib.pc.in ./ |
| 119 |
endif |
| 120 |
endif |
| 121 |
|
| 122 |
execute_after_dh_auto_clean: |
| 123 |
rm -rf test_backup/ |