| 1 |
|
| 2 |
.NOTPARALLEL: |
| 3 |
|
| 4 |
SHELL = /bin/sh -e |
| 5 |
|
| 6 |
export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
| 7 |
|
| 8 |
export DEB_CFLAGS_MAINT_APPEND = -ffile-prefix-map=../../= |
| 9 |
|
| 10 |
|
| 11 |
ifeq (${DEB_HOST_MULTIARCH},) |
| 12 |
$(foreach d, $(shell dpkg-architecture | sed 's/=/?=/'), $(eval export $d)) |
| 13 |
endif |
| 14 |
|
| 15 |
|
| 16 |
MAKEFLAGS += $(subst parallel=,-j,$(filter parallel=%,${DEB_BUILD_OPTIONS})) |
| 17 |
|
| 18 |
libonly := $(filter pkg.unbound.libonly,${DEB_BUILD_PROFILES}) |
| 19 |
|
| 20 |
CONFIGURE_ARGS = \ |
| 21 |
--disable-rpath \ |
| 22 |
--with-pidfile=/run/unbound.pid \ |
| 23 |
--with-libevent \ |
| 24 |
--enable-tfo-client \ |
| 25 |
|
| 26 |
|
| 27 |
CONFIGURE_ARGS += --with-rootkey-file=/usr/share/dns/root.key |
| 28 |
|
| 29 |
ifneq (${DEB_HOST_ARCH}, amd64) |
| 30 |
|
| 31 |
|
| 32 |
CONFIGURE_ARGS += --disable-flto |
| 33 |
endif |
| 34 |
|
| 35 |
ifneq (${DEB_HOST_ARCH_OS}, linux) |
| 36 |
|
| 37 |
CONFIGURE_ARGS += --with-libbsd |
| 38 |
endif |
| 39 |
|
| 40 |
ifneq (${DEB_HOST_ARCH_OS}, kfreebsd) |
| 41 |
|
| 42 |
CONFIGURE_ARGS += --enable-tfo-server |
| 43 |
endif |
| 44 |
|
| 45 |
ifneq (${DEB_BUILD_ARCH},${DEB_HOST_ARCH}) |
| 46 |
|
| 47 |
export _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata__${DEB_HOST_MULTIARCH} |
| 48 |
endif |
| 49 |
|
| 50 |
build-arch build-indep build \ |
| 51 |
install-arch install-indep install \ |
| 52 |
binary-arch binary-indep binary \ |
| 53 |
clean \ |
| 54 |
: %: |
| 55 |
dh $@ |
| 56 |
|
| 57 |
|
| 58 |
unbound-config: b/unbound/config.h |
| 59 |
b/unbound/config.h: |
| 60 |
PYTHON_VERSION="$(shell py3versions -vd)" \ |
| 61 |
PYTHON_SITE_PKG=/usr/lib/python3/dist-packages \ |
| 62 |
dh_auto_configure -Bb/unbound -- \ |
| 63 |
--with-pythonmodule \ |
| 64 |
--with-pyunbound \ |
| 65 |
--enable-subnet \ |
| 66 |
--enable-dnstap \ |
| 67 |
--enable-systemd \ |
| 68 |
--enable-cachedb --with-libhiredis \ |
| 69 |
--with-libnghttp2 \ |
| 70 |
--with-chroot-dir="" \ |
| 71 |
--with-dnstap-socket-path=/run/dnstap.sock \ |
| 72 |
${CONFIGURE_ARGS} |
| 73 |
unbound-build: b/unbound/build-stamp |
| 74 |
b/unbound/build-stamp: b/unbound/config.h |
| 75 |
${MAKE} -Cb/unbound |
| 76 |
touch $@ |
| 77 |
|
| 78 |
|
| 79 |
libunbound-config: b/libunbound/config.h |
| 80 |
b/libunbound/config.h: |
| 81 |
dh_auto_configure -Bb/libunbound -- \ |
| 82 |
--with-libunbound-only \ |
| 83 |
--without-pythonmodule \ |
| 84 |
--without-pyunbound \ |
| 85 |
--enable-event-api \ |
| 86 |
${CONFIGURE_ARGS} |
| 87 |
libunbound-build: b/libunbound/stamp-build |
| 88 |
b/libunbound/stamp-build: b/libunbound/config.h |
| 89 |
${MAKE} -Cb/libunbound lib |
| 90 |
touch $@ |
| 91 |
|
| 92 |
override_dh_auto_configure: $(if ${libonly},, unbound-config) libunbound-config |
| 93 |
|
| 94 |
override_dh_auto_build: $(if ${libonly},, unbound-build) libunbound-build |
| 95 |
|
| 96 |
override_dh_auto_test: $(if ${libonly},, unbound-build) |
| 97 |
ifeq (,$(filter nocheck,${DEB_BUILD_OPTIONS})) |
| 98 |
$(if ${libonly},, ${MAKE} -Cb/unbound test) |
| 99 |
endif |
| 100 |
|
| 101 |
override_dh_auto_install: override_dh_auto_build |
| 102 |
$(if ${libonly},, ${MAKE} -Cb/unbound install DESTDIR=${CURDIR}/debian/tmp) |
| 103 |
|
| 104 |
${MAKE} -Cb/libunbound install-lib DESTDIR=${CURDIR}/debian/tmp |
| 105 |
|
| 106 |
rm -f debian/tmp/usr/lib/${DEB_HOST_MULTIARCH}/libunbound.a |
| 107 |
|
| 108 |
sed -r -i '/^(Libs|Requires)\.private/D' \ |
| 109 |
debian/tmp/usr/lib/${DEB_HOST_MULTIARCH}/pkgconfig/libunbound.pc |
| 110 |
|
| 111 |
ifeq (,${libonly}) |
| 112 |
install -Dp -m 0644 debian/apparmor-profile debian/unbound/etc/apparmor.d/usr.sbin.unbound |
| 113 |
dh_apparmor --profile-name=usr.sbin.unbound -punbound |
| 114 |
|
| 115 |
dh_installsystemd -punbound |
| 116 |
dh_installsystemd -punbound --name=unbound-resolvconf --no-start --no-stop-on-upgrade |
| 117 |
dh_installinit --error-handler=true --restart-after-upgrade |
| 118 |
|
| 119 |
install -d debian/unbound/etc/insserv.conf.d |
| 120 |
echo '$$named unbound' > debian/unbound/etc/insserv.conf.d/unbound |
| 121 |
install -Dp -m 0755 debian/resolvconf-forwards debian/unbound/etc/resolvconf/update.d/unbound |
| 122 |
install -Dp -m 0755 debian/resolvconf-package debian/unbound/usr/lib/resolvconf/dpkg-event.d/unbound |
| 123 |
install -Dp -m 0644 contrib/update-anchor.sh -t debian/unbound/usr/share/doc/unbound/contrib/ |
| 124 |
install -Dp -m 0755 contrib/unbound_munin_ -t debian/unbound/usr/share/munin/plugins/ |
| 125 |
endif |
| 126 |
|
| 127 |
override_dh_installsystemd: |
| 128 |
override_dh_installinit: |
| 129 |
|
| 130 |
override_dh_compress: |
| 131 |
dh_compress -Xusr/share/doc/unbound/examples/unbound.conf |
| 132 |
|
| 133 |
override_dh_auto_clean: |
| 134 |
rm -rf b/ |