]> git.ipfire.org Git - thirdparty/pdns.git/blob - builder-support/debian/dnsdist/debian-stretch/rules
set --enable-option-checking=fatal on all package builds
[thirdparty/pdns.git] / builder-support / debian / dnsdist / debian-stretch / rules
1 #!/usr/bin/make -f
2 # See debhelper(7) (uncomment to enable)
3 # output every command that modifies files on the build system.
4 #DH_VERBOSE = 1
5
6 # Enable hardening features for daemons
7 export DEB_BUILD_MAINT_OPTIONS=hardening=+bindnow,+pie
8 # see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
9 DPKG_EXPORT_BUILDFLAGS = 1
10 include /usr/share/dpkg/default.mk
11
12 # for atomic support on powerpc (automatic on mipsel)
13 LDFLAGS += -latomic
14
15 # Disable systemd integration on non-linux archs
16 ifeq ($(DEB_HOST_ARCH_OS),linux)
17 CONFIGURE_ARGS += --enable-systemd --with-systemd=/lib/systemd/system
18 else
19 CONFIGURE_ARGS += --disable-systemd
20 endif
21
22
23 %:
24 dh $@
25
26 override_dh_auto_clean:
27 rm -f dnslabeltext.cc
28 dh_auto_clean
29
30 override_dh_auto_configure:
31 ./configure \
32 --enable-option-checking=fatal \
33 --host=$(DEB_HOST_GNU_TYPE) \
34 --build=$(DEB_BUILD_GNU_TYPE) \
35 --prefix=/usr \
36 --sysconfdir=/etc/dnsdist \
37 --mandir=\$${prefix}/share/man \
38 --infodir=\$${prefix}/share/info \
39 --libdir='$${prefix}/lib/$(DEB_HOST_MULTIARCH)' \
40 --libexecdir='$${prefix}/lib' \
41 --enable-dns-over-tls \
42 --enable-dnscrypt \
43 --enable-dnstap \
44 --with-gnutls \
45 --with-libcap \
46 --with-libsodium \
47 --with-re2 \
48 --with-ebpf \
49 --with-lua=luajit \
50 --with-protobuf \
51 $(CONFIGURE_ARGS)
52
53 override_dh_auto_build-arch:
54 dh_auto_build -- V=1
55
56 override_dh_install:
57 dh_auto_install
58 echo Patching uid and git into debian/dnsdist/lib/systemd/system/*.service
59 perl -pi -e 's/(^ExecStart=.*)/$$1 -u _dnsdist -g _dnsdist/' debian/dnsdist/lib/systemd/system/*.service
60 ifeq ($(DEB_HOST_ARCH_BITS),32)
61 echo RestrictAddressFamilies is broken on 32bit, removing it from service file
62 perl -ni -e 'print unless /RestrictAddressFamilies/' debian/dnsdist/lib/systemd/system/*.service
63 else
64 echo Keeping RestrictAddressFamilies in debian/dnsdist/lib/systemd/system/*.service
65 endif
66
67 override_dh_installexamples:
68 cp dnsdistconf.lua dnsdist.conf
69 dh_installexamples
70 rm -f dnsdist.conf
71
72 override_dh_installinit:
73 # do nothing here. avoids referencing a non-existant init script.
74