]>
Commit | Line | Data |
---|---|---|
decc6173 PL |
1 | #!/usr/bin/make -f |
2 | DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) | |
3 | ||
4 | # Enable hardening features for daemons | |
ef2ea4bf | 5 | # Note: blhc (build log hardening check) will find these false positives: CPPFLAGS 2 missing, LDFLAGS 1 missing |
decc6173 PL |
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 | |
10 | ||
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 | |
c436b421 | 14 | DH_ARGS += --with systemd |
decc6173 PL |
15 | else |
16 | CONFIGURE_ARGS += --disable-systemd | |
17 | endif | |
18 | ||
19 | ||
20 | # Use new build system | |
21 | %: | |
c436b421 PL |
22 | dh $@ \ |
23 | --with autoreconf \ | |
24 | $(DH_ARGS) | |
decc6173 PL |
25 | |
26 | override_dh_auto_configure: | |
27 | dh_auto_configure -- \ | |
28 | --sysconfdir=/etc/powerdns \ | |
29 | --enable-unit-tests \ | |
66f0acb2 | 30 | --with-lua=luajit \ |
88301a04 | 31 | --with-libcap \ |
cb264691 | 32 | --with-libsodium \ |
decc6173 | 33 | --with-protobuf=yes \ |
51ad9bdf | 34 | --enable-dnstap \ |
decc6173 | 35 | --without-net-snmp \ |
c436b421 | 36 | --disable-silent-rules \ |
02a1700a PL |
37 | --with-service-user=pdns \ |
38 | --with-service-group=pdns \ | |
decc6173 PL |
39 | $(CONFIGURE_ARGS) |
40 | ||
41 | override_dh_auto_install: | |
42 | dh_auto_install | |
46a7f788 PL |
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 | |
decc6173 | 46 | rm -f debian/pdns-recursor/etc/powerdns/recursor.conf-dist |
df51bc1f | 47 | ./pdns_recursor --no-config --config=default | sed \ |
decc6173 | 48 | -e 's!# config-dir=.*!config-dir=/etc/powerdns!' \ |
46a7f788 | 49 | -e 's!# include-dir=.*!&\ninclude-dir=/etc/powerdns/recursor.d!' \ |
decc6173 | 50 | -e 's!# local-address=.*!local-address=127.0.0.1!' \ |
46a7f788 | 51 | -e 's!# lua-config-file=.*!lua-config-file=/etc/powerdns/recursor.lua!' \ |
decc6173 | 52 | -e 's!# quiet=.*!quiet=yes!' \ |
fe9e7b8d PL |
53 | -e 's!# setgid=.*!setgid=pdns!' \ |
54 | -e 's!# setuid=.*!setuid=pdns!' \ | |
decc6173 | 55 | -e 's!# hint-file=.*!&\nhint-file=/usr/share/dns/root.hints!' \ |
063d8ef4 | 56 | -e '/^# version-string=.*/d' \ |
decc6173 PL |
57 | > debian/pdns-recursor/etc/powerdns/recursor.conf |
58 | ||
59 | override_dh_strip: | |
60 | dh_strip --ddeb-migration='pdns-recursor-dbg' | |
61 | ||
62 | override_dh_installinit: | |
63 | dh_installinit --error-handler=initscript_error | |
64 | ||
65 | override_dh_gencontrol: | |
66 | dh_gencontrol -- $(SUBSTVARS) | |
ddf55a09 OM |
67 | |
68 | override_dh_fixperms: | |
69 | dh_fixperms | |
46a7f788 | 70 | # these files often contain passwords. 640 as it is chowned to root:pdns |
316b23af | 71 | chmod 0640 debian/pdns-recursor/etc/powerdns/recursor.conf |