| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
# Uncomment this to turn on verbose mode. |
| 4 |
#export DH_VERBOSE=1 |
| 5 |
|
| 6 |
export DEB_BUILD_MAINT_OPTIONS=hardening=+all |
| 7 |
export DEB_CPPFLAGS_MAINT_APPEND = -DUNDEBUG |
| 8 |
export DPKG_GENSYMBOLS_CHECK_LEVEL = 4 |
| 9 |
export COMPILED_BY=Debian |
| 10 |
|
| 11 |
include ./version.mk |
| 12 |
MAJOR=$(NETPBM_MAJOR_RELEASE) |
| 13 |
MINOR=$(NETPBM_MINOR_RELEASE) |
| 14 |
POINT=$(NETPBM_POINT_RELEASE) |
| 15 |
|
| 16 |
include /usr/share/dpkg/pkg-info.mk |
| 17 |
# workaround for #1119850 |
| 18 |
ifneq (,$(findstring arm,$(DEB_HOST_ARCH))) |
| 19 |
export DEB_CFLAGS_MAINT_APPEND += -fno-schedule-insns2 |
| 20 |
endif |
| 21 |
|
| 22 |
%: |
| 23 |
dh $@ --no-parallel |
| 24 |
|
| 25 |
override_dh_auto_configure: |
| 26 |
if [ `printf '%02d.%02d.%02d+ds' $(NETPBM_MAJOR_RELEASE) $(NETPBM_MINOR_RELEASE) $(NETPBM_POINT_RELEASE)` != $(DEB_VERSION_UPSTREAM) ] ; then \ |
| 27 |
echo debian infrastructure for version $(DEB_VERSION_UPSTREAM) used with upstream version $(NETPBM_MAJOR_RELEASE).$(NETPBM_MINOR_RELEASE).$(NETPBM_POINT_RELEASE) ; exit 1 ; fi |
| 28 |
cp config.mk.in config.mk |
| 29 |
cat debian/config.mk.debian >> config.mk |
| 30 |
echo "CFLAGS = `dpkg-buildflags --get CFLAGS`" >> config.mk |
| 31 |
ifeq ($(DEB_HOST_ARCH),amd64) |
| 32 |
echo 'WANT_SSE = Y' >> config.mk |
| 33 |
endif |
| 34 |
# Let blhc ignore build utilities using *_FOR_BUILD_*FLAGS |
| 35 |
@echo 'blhc: ignore-line-regexp: .* -o typegen\.o .*' |
| 36 |
@echo 'blhc: ignore-line-regexp: .* -o endiangen\.o .*' |
| 37 |
@echo 'blhc: ignore-line-regexp: .* -o libopt\.o .*' |
| 38 |
|
| 39 |
override_dh_auto_build: |
| 40 |
dh_auto_build |
| 41 |
# build the manpages |
| 42 |
mkdir netpbmdoc |
| 43 |
cd netpbmdoc; \ |
| 44 |
$(MAKE) USERGUIDE=../userguide/ -f ../buildtools/manpage.mk manpages |
| 45 |
# Fix manual section |
| 46 |
sed -i 's/^\(\.TH "[^"]\+" \)0 /\11 /' netpbmdoc/*.1 |
| 47 |
|
| 48 |
override_dh_auto_clean: |
| 49 |
[ ! -f config.mk ] || $(MAKE) distclean |
| 50 |
rm -rf debian/netpbm-test debian/netpbm-test.bak |
| 51 |
rm -rf netpbmdoc |
| 52 |
|
| 53 |
override_dh_auto_install: |
| 54 |
mkdir -p debian/tmp/ |
| 55 |
$(MAKE) package PKGDIR=$(CURDIR)/debian/tmp/usr |
| 56 |
# install the manpages |
| 57 |
cd netpbmdoc; \ |
| 58 |
$(MAKE) USERGUIDE=../userguide/ -f ../buildtools/manpage.mk report |
| 59 |
# install pkgconfig |
| 60 |
install -m 0755 -d debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig |
| 61 |
sed -e 's|@INCLUDEDIR@|/usr/include/netpbm|' \ |
| 62 |
-e 's|@LINKDIR@|/usr/lib/$(DEB_HOST_MULTIARCH)|' \ |
| 63 |
-e 's|@VERSION@|Netpbm $(MAJOR).$(MINOR).$(POINT)|' \ |
| 64 |
debian/tmp/usr/pkgconfig_template > debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/netpbm.pc |
| 65 |
mv debian/tmp/usr/lib/libnetpbm.so* \ |
| 66 |
debian/tmp/usr/staticlink/libnetpbm.a \ |
| 67 |
debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/ |
| 68 |
ln -s libnetpbm.so.$(MAJOR) \ |
| 69 |
debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libnetpbm.so |
| 70 |
find debian -name "lib*.la" -delete |
| 71 |
rm -rf debian/tmp/usr/sharedlink |
| 72 |
# drop broken command |
| 73 |
rm -vf debian/tmp/usr/bin/pamtojpeg2k netpbmdoc/pamtojpeg2k.1 |
| 74 |
|
| 75 |
execute_after_dh_installman: |
| 76 |
# tool manweb does not work due to missing /etc/manweb.conf |
| 77 |
find debian -name "manweb*" -delete |
| 78 |
|
| 79 |
override_dh_auto_test: |
| 80 |
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) |
| 81 |
$(MAKE) check-tree RESULTDIR=$(CURDIR)/debian/netpbm-test |
| 82 |
endif |