3 # Enable hardening features for daemons
4 # Note: blhc (build log hardening check) will find these false positives: CPPFLAGS 2 missing, LDFLAGS 1 missing
5 export DEB_BUILD_MAINT_OPTIONS
=hardening
=+bindnow
,+pie
6 DPKG_EXPORT_BUILDFLAGS
= 1
7 # Include buildflags.mk so we can append to the vars it sets.
8 include /usr
/share
/dpkg
/buildflags.mk
10 ENABLE_SYSTEMD
:= --enable-systemd
--with-systemd
=/lib
/systemd
/system
11 LIBSYSTEMD_DEV
:= , libsystemd-dev
12 DEBHELPER_WITH_SYSTEMD
:= --with systemd
14 ENABLE_LIBSODIUM
:= --enable-libsodium
15 LIBSODIUM_DEV
:= , libsodium-dev
17 ENABLE_NETSNMP
:= --with-net-snmp
18 NETSNMP_DEV
:= , libsnmp-dev
20 # $(ID) and $(VERSION_ID) come from the environment, source this from /etc/os-release
22 ifeq ($(VERSION_ID
), 14.04)
23 # Disable building with and depending on systemd on Ubuntu Trusty
26 DEBHELPER_WITH_SYSTEMD
=
28 # Also disable libsodium
35 ifeq ($(VERSION_ID
), 9)
36 # SNMP is linked to OpenSSL 1.0 while we link against OpenSSL 1.1
37 ENABLE_NETSNMP
= --without-net-snmp
42 debian
/control
: debian
/control.in
43 sed
-e
"s!@LIBSYSTEMDDEV@!$(LIBSYSTEMD_DEV)!" \
44 -e
"s!@LIBSODIUMDEV@!$(LIBSODIUM_DEV)!" \
45 -e
"s!@LIBSNMPDEV@!$(LIBSNMP_DEV)!" \
48 # Use new build system
53 $(DEBHELPER_WITH_SYSTEMD
)
55 override_dh_auto_configure
:
57 --host
=$(DEB_HOST_GNU_TYPE
) \
58 --build
=$(DEB_BUILD_GNU_TYPE
) \
60 --sysconfdir
=/etc
/powerdns \
61 --mandir=\
$${prefix}/share
/man \
62 --infodir=\
$${prefix}/share
/info \
63 --libdir='$${prefix}/lib/$(DEB_HOST_MULTIARCH)' \
64 --libexecdir
='$${prefix}/lib' \
71 override_dh_auto_install
:
72 .
/pdns_recursor
--config | sed \
73 -e
's!# config-dir=.*!config-dir=/etc/powerdns!' \
74 -e
's!# local-address=.*!local-address=127.0.0.1!' \
75 -e
's!# quiet=.*!quiet=yes!' \
76 -e
's!# setgid=.*!setgid=pdns!' \
77 -e
's!# setuid=.*!setuid=pdns!' \
78 -e
's!# include-dir=.*!include-dir=/etc/powerdns/recursor.d/!' \
79 > debian
/pdns-recursor
/etc
/powerdns
/recursor.conf
80 dh_auto_install
-- STRIP_BINARIES
=0
81 rm -f debian
/pdns-recursor
/etc
/powerdns
/recursor.conf-dist
84 dh_strip
--dbg-package
=pdns-recursor-dbg
86 override_dh_installinit
:
87 dh_installinit
--error-handler
=initscript_error
-- defaults
19 85
89 override_dh_auto_test
:
90 $(MAKE
) check ||
(cat test-suite.log
&& false
)