#!/usr/bin/make -f # Turn on all hardening flags, as we're a networked daemon. export DEB_BUILD_MAINT_OPTIONS=hardening=+all # see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/* DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/default.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 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)"' %: dh $@ --buildsystem=meson override_dh_auto_clean: dh_auto_clean rm -f dnslabeltext.cc rm -rf debian/cargo_registry override_dh_auto_configure: $(CARGO) prepare-debian debian/cargo_registry --link-from-system echo> ./dnsdist-rust-lib/rust/Cargo.lock chmod a+x debian/configure-helpers/* PATH=debian/configure-helpers/:$$PATH dh_auto_configure -- \ --sysconfdir=/etc/dnsdist \ -Dreproducible=true \ -Dsystemd-service=enabled \ -Dunit-tests=true \ -Ddnscrypt=enabled \ -Ddns-over-https=enabled \ -Ddns-over-tls=enabled \ -Ddnstap=enabled \ -Dyaml=enabled \ -Debpf=enabled \ -Dtls-gnutls=disabled \ -Dtls-libssl=enabled \ -Dlibsodium=enabled \ -Dlibcrypto=enabled \ -Dlmdb=enabled \ -Dlua=auto \ -Dsnmp=enabled \ -Dnghttp2=enabled \ -Dre2=enabled \ -Dxsk=enabled \ -Dsystemd-service-user='_dnsdist' \ -Dsystemd-service-group='_dnsdist' override_dh_auto_test: echo tests disabled, require working ipv4 stack override_dh_install: dh_auto_install install -m 0640 debian/config/dnsdist.conf debian/dnsdist/etc/dnsdist/ rm debian/dnsdist/etc/dnsdist/dnsdist.conf-dist install -d debian/dnsdist/usr/share/dnsdist/snmp install -m 644 -t debian/dnsdist/usr/share/dnsdist/snmp DNSDIST-MIB.txt # workaround for static libs in non-default dir ln -s ./obj-*/target . sed -e '/rustc-link-lib=static=dnsdist_rust/d' -i target/*/release/build/dnsdist-rust*/output /usr/share/cargo/bin/dh-cargo-built-using dnsdist override_dh_installexamples: cp dnsdist.conf-dist dnsdist.conf dh_installexamples rm -f dnsdist.conf override_dh_fixperms: dh_fixperms chmod 0640 debian/dnsdist/etc/dnsdist/dnsdist.conf override_dh_gencontrol: dh_gencontrol -- $(SUBSTVARS) override_dh_dwz: # broken, do nothing