2 DEB_HOST_ARCH_OS ?
= $(shell dpkg-architecture
-qDEB_HOST_ARCH_OS
)
4 # Enable hardening features for daemons
5 # Note: blhc (build log hardening check) will find these false positives: CPPFLAGS 2 missing, LDFLAGS 1 missing
6 export DEB_BUILD_MAINT_OPTIONS
=hardening
=+bindnow
,+pie
7 DPKG_EXPORT_BUILDFLAGS
= 1
8 # Include buildflags.mk so we can append to the vars it sets.
9 include /usr
/share
/dpkg
/buildflags.mk
11 # Disable systemd integration on non-linux archs
12 ifeq ($(DEB_HOST_ARCH_OS
),linux
)
13 CONFIGURE_ARGS
+= --enable-systemd
--with-systemd
=/lib
/systemd
/system
14 DH_ARGS
+= --with systemd
16 CONFIGURE_ARGS
+= --disable-systemd
20 # Use new build system
26 override_dh_auto_configure
:
27 dh_auto_configure
-- \
28 --sysconfdir
=/etc
/powerdns \
36 --disable-silent-rules \
37 --with-service-user
=pdns \
38 --with-service-group
=pdns \
41 override_dh_auto_install
:
43 install -d debian
/pdns-recursor
/usr
/share
/pdns-recursor
/lua-config
44 install -m
644 -t debian
/pdns-recursor
/usr
/share
/pdns-recursor
/lua-config debian
/lua-config
/rootkeys.lua
45 install -m
644 -t debian
/pdns-recursor
/etc
/powerdns debian
/recursor.lua
46 rm -f debian
/pdns-recursor
/etc
/powerdns
/recursor.conf-dist
47 .
/pdns_recursor
--no-config
--config
=default | sed \
48 -e
's!# config-dir=.*!config-dir=/etc/powerdns!' \
49 -e
's!# include-dir=.*!&\ninclude-dir=/etc/powerdns/recursor.d!' \
50 -e
's!# local-address=.*!local-address=127.0.0.1!' \
51 -e
's!# lua-config-file=.*!lua-config-file=/etc/powerdns/recursor.lua!' \
52 -e
's!# quiet=.*!quiet=yes!' \
53 -e
's!# setgid=.*!setgid=pdns!' \
54 -e
's!# setuid=.*!setuid=pdns!' \
55 -e
's!# hint-file=.*!&\nhint-file=/usr/share/dns/root.hints!' \
56 > debian
/pdns-recursor
/etc
/powerdns
/recursor.conf
59 dh_strip
--ddeb-migration
='pdns-recursor-dbg'
61 override_dh_installinit
:
62 dh_installinit
--error-handler
=initscript_error
64 override_dh_gencontrol
:
65 dh_gencontrol
-- $(SUBSTVARS
)
69 # these files often contain passwords. 640 as it is chowned to root:pdns
70 chmod
0640 debian
/pdns-recursor
/etc
/powerdns
/recursor.conf