]> git.ipfire.org Git - thirdparty/pdns.git/blob - builder-support/debian/authoritative/debian-stretch/rules
configure: with-libsodium
[thirdparty/pdns.git] / builder-support / debian / authoritative / debian-stretch / rules
1 #!/usr/bin/make -f
2 DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
3 DEB_HOST_ARCH_BITS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_BITS)
4 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
5
6 # Backends
7 backends := bind ldap pipe gmysql godbc gpgsql gsqlite3 geoip lua lua2 mydns remote random opendbx tinydns
8
9 # Disable systemd integration on non-linux archs
10 ifeq ($(DEB_HOST_ARCH_OS),linux)
11 CONFIGURE_ARGS += --enable-systemd --with-systemd=/lib/systemd/system
12 else
13 CONFIGURE_ARGS += --disable-systemd
14 endif
15
16
17 # Use new build system
18 %:
19 dh $@ \
20 --with autoreconf \
21 --with systemd \
22 --parallel
23
24 override_dh_auto_configure:
25 test -f pdns/dnslabeltext.cc && mv pdns/dnslabeltext.cc debian/dnslabeltext.cc.moved || true
26 dh_auto_configure -- \
27 --sysconfdir=/etc/powerdns \
28 --with-dynmodules="$(backends)" \
29 --with-modules="" \
30 --enable-tools \
31 --with-libsodium \
32 --with-lua=luajit \
33 --with-protobuf \
34 --enable-unit-tests \
35 --enable-experimental-pkcs11 \
36 --enable-lua-records \
37 --enable-ixfrdist \
38 $(CONFIGURE_ARGS)
39
40 override_dh_strip:
41 dh_strip --ddeb-migration='pdns-server-dbg (<< 4.0.0-0)'
42
43 override_dh_systemd_enable:
44 dh_systemd_enable --name=pdns
45
46 # init script needs to be named pdns, not pdns-server. if no pdns-backend
47 # is installed, start will fail, so pass --no-start. backends will trigger
48 # a restart.
49 override_dh_installinit:
50 dh_installinit --error-handler=initscript_error --no-start --restart-after-upgrade --name=pdns
51
52 override_dh_install:
53 dh_install
54 ./pdns/pdns_server --no-config --config | sed \
55 -e 's!# module-dir=.*!!' \
56 -e 's!# include-dir=.*!&\ninclude-dir=/etc/powerdns/pdns.d!' \
57 -e 's!# launch=.*!&\nlaunch=!' \
58 -e 's!# setgid=.*!setgid=pdns!' \
59 -e 's!# setuid=.*!setuid=pdns!' \
60 > debian/pdns-server/etc/powerdns/pdns.conf
61 ifeq ($(DEB_HOST_ARCH_BITS),32)
62 echo RestrictAddressFamilies is broken on 32bit, removing it from service file
63 perl -ni -e 'print unless /RestrictAddressFamilies/' debian/pdns-server/lib/systemd/system/*.service
64 endif
65
66 # Verbose tests (shows used compiler/linker and their flags)
67 override_dh_auto_test:
68 echo Skipping make test, as dependencies are missing.
69 make check
70
71 override_dh_fixperms:
72 dh_fixperms
73 # these files often contain passwords.
74 chmod 0600 debian/pdns-server/etc/powerdns/pdns.conf
75
76 # restore moved files
77 override_dh_clean:
78 test -f debian/dnslabeltext.cc.moved && mv debian/dnslabeltext.cc.moved pdns/dnslabeltext.cc || true
79 dh_clean