#!/usr/bin/make -f # Turn on all hardening flags, as we're a networked daemon. # Note: blhc (build log hardening check) will find these false positives: CPPFLAGS 2 missing, LDFLAGS 1 missing export DEB_BUILD_MAINT_OPTIONS = hardening=+all include /usr/share/dpkg/architecture.mk include /usr/share/dpkg/buildflags.mk include /usr/share/rustc/architecture.mk export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS export DEB_HOST_RUST_TYPE DEB_HOST_GNU_TYPE export CARGO=/usr/share/cargo/bin/cargo export CARGO_HOME=$(CURDIR)/debian/cargo_home export CARGO_REGISTRY=$(CURDIR)/debian/cargo_registry export DEB_CARGO_CRATE=$(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM) # for pdns makefile export RUSTC_TARGET_ARCH=$(DEB_HOST_RUST_TYPE) # Vendor and version CXXFLAGS += -DPACKAGEVERSION='"$(DEB_VERSION).$(DEB_VENDOR)"' CONFIGURE_ARGS = # Workaround for #1078387 https://github.com/PowerDNS/pdns/issues/14084 CONFIGURE_ARGS += --with-libcrypto=/usr %: dh $@ override_dh_auto_clean: dh_auto_clean rm -f dnslabeltext.cc chmod +x mkpubsuffixcc || true rm -rf debian/cargo_registry override_dh_auto_configure: $(CARGO) prepare-debian debian/cargo_registry --link-from-system echo> ./settings/rust/Cargo.lock PATH=debian/configure-helpers/:$$PATH dh_auto_configure -- \ --sysconfdir=/etc/powerdns \ --enable-systemd --with-systemd=$$(pkgconf --variable=systemdsystemunitdir systemd) \ --enable-reproducible \ --disable-silent-rules \ --enable-unit-tests \ --with-service-user=pdns \ --with-service-group=pdns \ --with-libcap \ --with-libsodium \ --with-lua \ --with-net-snmp \ --with-protobuf=yes \ --enable-dns-over-tls \ --enable-dnstap \ $(CONFIGURE_ARGS) cat config.log grep 'OpenSSL ECDSA: yes' config.log override_dh_auto_install: dh_auto_install install -d debian/pdns-recursor/usr/share/pdns-recursor/snmp install -m 644 -t debian/pdns-recursor/usr/share/pdns-recursor/snmp RECURSOR-MIB.txt rm -f debian/pdns-recursor/etc/powerdns/recursor.conf-dist install -d debian/pdns-recursor/usr/share/doc/pdns-recursor/examples mv debian/pdns-recursor/etc/powerdns/recursor.yml-dist debian/pdns-recursor/usr/share/doc/pdns-recursor/examples/ echo "\ dnssec:\n\ # validation: process # default\n\ trustanchorfile: /usr/share/dns/root.key\n\ recursor:\n\ hint_file: /usr/share/dns/root.hints\n\ include_dir: /etc/powerdns/recursor.d\n\ security_poll_suffix: ''\n\ incoming:\n\ # listen:\n\ # - 127.0.0.1 # default\n\ outgoing:\n\ # source_address:\n\ # - 0.0.0.0 # default\n\ " > debian/pdns-recursor/etc/powerdns/recursor.conf override_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) dh_auto_test -cat testrunner.log endif override_dh_gencontrol: dh_gencontrol -- $(SUBSTVARS)