File: rules

package info (click to toggle)
pdns-recursor 5.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,108 kB
  • sloc: cpp: 109,513; javascript: 20,651; python: 5,657; sh: 5,069; makefile: 780; ansic: 582; xml: 37
file content (70 lines) | stat: -rwxr-xr-x 2,360 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/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/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
	chmod +x mkpubsuffixcc || true
	rm -rf debian/cargo_registry

override_dh_auto_configure:
	$(CARGO) prepare-debian debian/cargo_registry --link-from-system
	echo> ./rec-rust-lib/rust/Cargo.lock
	PATH=debian/configure-helpers/:$$PATH dh_auto_configure -- \
		--sysconfdir=/etc/powerdns \
		-Dreproducible=true \
		-Dunit-tests=true \
		-Dsystemd-service=enabled \
		-Dsystemd-service-user=pdns \
		-Dsystemd-service-group=pdns \
		-Dlibcap=enabled \
		-Dsigners-libsodium=enabled \
		-Dsigners-libcrypto=enabled \
		-Dlua=auto \
		-Dsnmp=enabled \
		-Ddns-over-tls=enabled \
		-Ddnstap=enabled

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/
	install -m 644 -t debian/pdns-recursor/etc/powerdns debian/recursor.conf
	# workaround for static libs in non-default dir, see https://salsa.debian.org/rust-team/dh-cargo/-/issues/1
	ln -s ./obj-*/target .
	sed -e '/rustc-link-lib=static=recrust/d' -i target/*/release/build/recrust*/output
	/usr/share/cargo/bin/dh-cargo-built-using pdns-recursor

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	dh_auto_test
	-cat ./obj-*/meson-logs/testlog.txt
endif

override_dh_gencontrol:
	dh_gencontrol -- $(SUBSTVARS)