| 1 |
#!/usr/bin/make -f |
| 2 |
# -*- makefile -*- |
| 3 |
|
| 4 |
# Uncomment this to turn on verbose mode. |
| 5 |
#export DH_VERBOSE=1 |
| 6 |
|
| 7 |
# debian/rules file for the Debian GNU/Linux stunnel package |
| 8 |
# Copyright 2003 by Julien LEMOINE <[email protected]> |
| 9 |
# Copyright 2014 by Peter Pentchev <[email protected]> |
| 10 |
|
| 11 |
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES))) |
| 12 |
DEB_NODOC=0 |
| 13 |
CONFIGURE_DISABLE_DOC= |
| 14 |
else |
| 15 |
DEB_NODOC=1 |
| 16 |
CONFIGURE_DISABLE_DOC=--disable-doc |
| 17 |
endif |
| 18 |
|
| 19 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 20 |
export DEB_CFLAGS_MAINT_APPEND=-Wall |
| 21 |
|
| 22 |
include /usr/share/debhelper/dh_package_notes/package-notes.mk |
| 23 |
|
| 24 |
multiarch_path= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) |
| 25 |
|
| 26 |
override_dh_auto_configure: |
| 27 |
dh_auto_configure -- \ |
| 28 |
--enable-ipv6 --with-threads=pthread $(CONFIGURE_DISABLE_DOC) |
| 29 |
|
| 30 |
# Do not allow this file to be regenerated |
| 31 |
[ -f src/dhparam.c ] |
| 32 |
sleep 1 |
| 33 |
touch src/dhparam.c |
| 34 |
|
| 35 |
override_dh_auto_test: |
| 36 |
dh_auto_test || { \ |
| 37 |
printf '\n\n=== Some tests failed; here are all the logs...\n\n' 1>&2; \ |
| 38 |
find tests/logs/ -type f -name '*.log' -exec grep -EHe '^' -- '{}' + 1>&2; \ |
| 39 |
false; \ |
| 40 |
} |
| 41 |
|
| 42 |
override_dh_auto_install: |
| 43 |
dh_auto_install --destdir '$(CURDIR)/debian/stunnel' -- -C src |
| 44 |
ifeq ($(DEB_NODOC),0) |
| 45 |
dh_auto_install --destdir '$(CURDIR)/debian/stunnel' -- -C doc |
| 46 |
endif |
| 47 |
|
| 48 |
# .la file is useless |
| 49 |
rm $(CURDIR)/debian/stunnel/usr/lib/$(multiarch_path)/stunnel/libstunnel.la |
| 50 |
|
| 51 |
ifeq ($(DEB_NODOC),0) |
| 52 |
# Manpages will be installed by dh_installman |
| 53 |
rm -rf $(CURDIR)/debian/stunnel/usr/share/man |
| 54 |
|
| 55 |
# Basic docs for the user on how to create an initial configuration |
| 56 |
install -p -m 0644 $(CURDIR)/debian/stunnel.conf.README \ |
| 57 |
$(CURDIR)/debian/stunnel/etc/stunnel/README |
| 58 |
endif |
| 59 |
|
| 60 |
override_dh_installdocs: |
| 61 |
ifeq ($(DEB_NODOC),0) |
| 62 |
dh_installdocs |
| 63 |
else |
| 64 |
mkdir -p $(CURDIR)/debian/stunnel/usr/share/doc/stunnel |
| 65 |
install -p -m 644 $(CURDIR)/debian/copyright $(CURDIR)/debian/stunnel/usr/share/doc/stunnel/ |
| 66 |
endif |
| 67 |
|
| 68 |
override_dh_installman: |
| 69 |
ifeq ($(DEB_NODOC),0) |
| 70 |
dh_installman |
| 71 |
endif |
| 72 |
|
| 73 |
execute_after_dh_link: |
| 74 |
ifeq ($(DEB_NODOC),1) |
| 75 |
rm $(CURDIR)/debian/stunnel/usr/share/man/man8/stunnel.8.gz |
| 76 |
rmdir $(CURDIR)/debian/stunnel/usr/share/man/man8 |
| 77 |
rmdir $(CURDIR)/debian/stunnel/usr/share/man |
| 78 |
endif |
| 79 |
|
| 80 |
execute_after_dh_installchangelogs: |
| 81 |
install -m 644 NEWS.md $(CURDIR)/debian/stunnel/usr/share/doc/stunnel/NEWS |
| 82 |
|
| 83 |
override_dh_compress: |
| 84 |
dh_compress --exclude=StunnelConf-0.1.pl |
| 85 |
|
| 86 |
%: |
| 87 |
dh $@ |