File: rules

package info (click to toggle)
pdns-recursor 4.1.11-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 6,708 kB
  • sloc: cpp: 54,116; sh: 11,872; makefile: 453; xml: 37
file content (72 lines) | stat: -rwxr-xr-x 2,333 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/make -f
include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/pkg-info.mk
include /usr/share/dpkg/vendor.mk

# Vendor and version
version := $(DEB_VERSION).$(DEB_VENDOR)
CXXFLAGS += -DPACKAGEVERSION='"$(version)"'

# (Re-)Enable warnings
CXXFLAGS += -Wall

# Turn on all hardening flags, as we're a networked daemon.
# Note: blhc (build log hardening check) will find these false positivies: CPPFLAGS 2 missing, LDFLAGS 1 missing
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# Disable systemd integration on non-linux archs
ifeq ($(DEB_HOST_ARCH_OS),linux)
CONFIGURE_ARGS += --enable-systemd --with-systemd=/lib/systemd/system
else
CONFIGURE_ARGS += --disable-systemd
endif

SUBSTVARS = -Vbuild:PublicSuffixVersion=$(shell (dpkg-query -W publicsuffix | awk '{print $$2}'))


%:
	dh $@

override_dh_auto_clean:
	dh_auto_clean
	rm -f effective_tld_names.dat
	chmod +x mkpubsuffixcc || true

override_dh_auto_configure:
	cp -f /usr/share/publicsuffix/public_suffix_list.dat effective_tld_names.dat
	dh_auto_configure -- \
		--sysconfdir=/etc/powerdns \
		--enable-reproducible \
		--enable-unit-tests \
		--with-lua \
		--enable-libsodium \
		--with-protobuf=yes \
		$(CONFIGURE_ARGS)

override_dh_auto_install:
	dh_auto_install
	install -d debian/pdns-recursor/usr/share/pdns-recursor/lua-config
	install -m 644 -t debian/pdns-recursor/usr/share/pdns-recursor/lua-config debian/lua-config/rootkeys.lua
	install -m 644 -t debian/pdns-recursor/etc/powerdns debian/recursor.lua
	rm -f debian/pdns-recursor/etc/powerdns/recursor.conf-dist
	./pdns_recursor --no-config --config | sed \
		-e 's!# config-dir=.*!config-dir=/etc/powerdns!' \
		-e 's!# include-dir=.*!&\ninclude-dir=/etc/powerdns/recursor.d!' \
		-e 's!# local-address=.*!local-address=127.0.0.1!' \
		-e 's!# lua-config-file=.*!lua-config-file=/etc/powerdns/recursor.lua!' \
		-e 's!# quiet=.*!quiet=yes!' \
		-e 's!# setgid=.*!setgid=pdns!' \
		-e 's!# setuid=.*!setuid=pdns!' \
		-e 's!# hint-file=.*!&\nhint-file=/usr/share/dns/root.hints!' \
		-e 's!# security-poll-suffix=.*!&\nsecurity-poll-suffix=!' \
		> debian/pdns-recursor/etc/powerdns/recursor.conf

override_dh_auto_test:
	dh_auto_test
	-cat testrunner.log

override_dh_installinit:
	dh_installinit --error-handler=initscript_error

override_dh_gencontrol:
	dh_gencontrol -- $(SUBSTVARS)