]> git.ipfire.org Git - thirdparty/pdns.git/blame - builder-support/debian/recursor/debian-jessie/rules
builder: avoid config change prompts on each pdns-recursor update
[thirdparty/pdns.git] / builder-support / debian / recursor / debian-jessie / rules
CommitLineData
c436b421
PL
1#!/usr/bin/make -f
2DEB_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
c436b421
PL
6export DEB_BUILD_MAINT_OPTIONS=hardening=+bindnow,+pie
7DPKG_EXPORT_BUILDFLAGS = 1
8# Include buildflags.mk so we can append to the vars it sets.
9include /usr/share/dpkg/buildflags.mk
10
11# Disable systemd integration on non-linux archs
12ifeq ($(DEB_HOST_ARCH_OS),linux)
13CONFIGURE_ARGS += --enable-systemd --with-systemd=/lib/systemd/system
14DH_ARGS += --with systemd
15else
16CONFIGURE_ARGS += --disable-systemd
17endif
18
19
20# Use new build system
21%:
22 dh $@ \
23 --with autoreconf \
24 $(DH_ARGS)
25
26override_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 \
c436b421
PL
33 --with-protobuf=yes \
34 --with-net-snmp \
35 --disable-silent-rules \
02a1700a
PL
36 --with-service-user=pdns \
37 --with-service-group=pdns \
c436b421
PL
38 $(CONFIGURE_ARGS)
39
40override_dh_auto_install:
41 dh_auto_install -- STRIP_BINARIES=0
46a7f788
PL
42 install -d debian/pdns-recursor/usr/share/pdns-recursor/lua-config
43 install -m 644 -t debian/pdns-recursor/usr/share/pdns-recursor/lua-config debian/lua-config/rootkeys.lua
44 install -m 644 -t debian/pdns-recursor/etc/powerdns debian/recursor.lua
c436b421 45 rm -f debian/tmp/etc/powerdns/recursor.conf-dist
df51bc1f 46 ./pdns_recursor --no-config --config=default | sed \
c436b421 47 -e 's!# config-dir=.*!config-dir=/etc/powerdns!' \
46a7f788 48 -e 's!# include-dir=.*!&\ninclude-dir=/etc/powerdns/recursor.d!' \
c436b421 49 -e 's!# local-address=.*!local-address=127.0.0.1!' \
46a7f788 50 -e 's!# lua-config-file=.*!lua-config-file=/etc/powerdns/recursor.lua!' \
c436b421 51 -e 's!# quiet=.*!quiet=yes!' \
fe9e7b8d
PL
52 -e 's!# setgid=.*!setgid=pdns!' \
53 -e 's!# setuid=.*!setuid=pdns!' \
c436b421 54 -e 's!# hint-file=.*!&\nhint-file=/usr/share/dns/root.hints!' \
063d8ef4 55 -e '/^# version-string=.*/d' \
c436b421
PL
56 > debian/tmp/etc/powerdns/recursor.conf
57
58override_dh_strip:
59 dh_strip --dbg-package=pdns-recursor-dbg
60
61override_dh_installinit:
62 dh_installinit --error-handler=initscript_error
63
64override_dh_gencontrol:
65 dh_gencontrol -- $(SUBSTVARS)
ddf55a09
OM
66
67override_dh_fixperms:
68 dh_fixperms
46a7f788 69# these files often contain passwords. 640 as it is chowned to root:pdns
316b23af 70 chmod 0640 debian/tmp/etc/powerdns/recursor.conf