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