File: rules

package info (click to toggle)
dnsdist 2.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,640 kB
  • sloc: cpp: 91,323; javascript: 24,456; sh: 4,744; python: 1,328; makefile: 832; ansic: 816
file content (87 lines) | stat: -rwxr-xr-x 2,454 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/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=enabled \
	  -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