]> git.ipfire.org Git - thirdparty/pdns.git/blob - builder-support/debian/dnsdist/debian-jessie/rules
Merge pull request #8777 from omoerbeek/rec-wip-qname-vs-ds
[thirdparty/pdns.git] / builder-support / debian / dnsdist / debian-jessie / 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 $@ --with systemd
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 --without-gnutls \
42 --enable-dns-over-tls \
43 --enable-dnscrypt \
44 --with-libcap \
45 --with-libsodium \
46 --with-re2 \
47 --with-ebpf \
48 --with-lua=luajit \
49 --with-protobuf \
50 --with-service-user='_dnsdist' \
51 --with-service-group='_dnsdist' \
52 $(CONFIGURE_ARGS)
53
54 override_dh_auto_build-arch:
55 dh_auto_build -- V=1
56
57 override_dh_install:
58 dh_install
59 ifeq ($(DEB_HOST_ARCH_BITS),32)
60 echo RestrictAddressFamilies is broken on 32bit, removing it from service file
61 perl -ni -e 'print unless /RestrictAddressFamilies/' debian/dnsdist/lib/systemd/system/*.service
62 else
63 echo Keeping RestrictAddressFamilies in debian/dnsdist/lib/systemd/system/*.service
64 endif
65
66 override_dh_installexamples:
67 cp dnsdistconf.lua dnsdist.conf
68 dh_installexamples
69 rm -f dnsdist.conf
70
71 override_dh_strip:
72 dh_strip --dbg-package=dnsdist-dbg
73
74 override_dh_installinit:
75 dh_installinit
76 dh_systemd_start -pdnsdist --restart-after-upgrade dnsdist.service
77
78 override_dh_fixperms:
79 dh_fixperms
80 # these files often contain passwords. 640 as it is chowned to root:_dnsdist
81 touch debian/dnsdist/etc/dnsdist/dnsdist.conf
82 chmod 0640 debian/dnsdist/etc/dnsdist/dnsdist.conf