Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2 # Sample debian/rules that uses debhelper.
3 # GNU copyright 1997 to 1999 by Joey Hess.
4
5 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
6 DPKG_EXPORT_BUILDFLAGS = 1
7
8 export DEB_CFLAGS_MAINT_APPEND = -fno-strict-aliasing -fno-delete-null-pointer-checks -DNO_VERSION_DATE -DDIG_SIGCHASE
9
10 export DPKG_GENSYMBOLS_CHECK_LEVEL := 4
11
12 include /usr/share/dpkg/default.mk
13
14 # Uncomment this to turn on verbose mode.
15 #export DH_VERBOSE=1
16
17 COMMA = ,
18 ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
19 NJOBS := -j $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
20 endif
21
22 export arch = $(DEB_HOST_ARCH)
23
24 ifeq ($(DEB_HOST_ARCH_OS),kfreebsd)
25 EXTRA_FEATURES=--disable-linux-caps
26 endif
27
28 DEB_VERSION_REVISION := $(call dpkg_late_eval,DEB_VERSION_REVISION,echo '$(DEB_VERSION_UPSTREAM_REVISION)' | sed -e 's/^[^-]*//')
29
30 SED_VERSION_EXTENSIONS := \
31 sed -e 's/\[bind_VERSION_EXTRA\], .*)/[bind_VERSION_EXTRA], $(DEB_VERSION_REVISION)-$(DEB_VENDOR))/'
32
33 EXCLUDE_FILES := \
34 --exclude=.la \
35 --exclude=lwresd \
36 --exclude=__pycache_ \
37 --exclude=sample.so \
38 --exclude=dlzexternal.so \
39 --exclude=test-async.so \
40 --exclude=libbind9.la \
41 --exclude=libdns.la \
42 --exclude=libirs.la \
43 --exclude=libisccc.la \
44 --exclude=libisccfg.la \
45 --exclude=libisc.la \
46 --exclude=libns.la
47
48 %:
49 dh $@
50
51 prepare_version_extensions:
52 if [ ! -f configure.ac.bak ]; then \
53 mv configure.ac configure.ac.bak; \
54 $(SED_VERSION_EXTENSIONS) < configure.ac.bak > configure.ac; \
55 fi
56
57 clean_version_extensions:
58 if [ -f configure.ac.bak ]; then \
59 mv configure.ac.bak configure.ac; \
60 fi
61
62 override_dh_autoreconf: prepare_version_extensions
63 dh_autoreconf
64
65 override_dh_auto_configure:
66 dh_auto_configure -- \
67 --libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
68 --sysconfdir=/etc/bind \
69 --with-python=python3 \
70 --localstatedir=/ \
71 --enable-threads \
72 --enable-largefile \
73 --with-libtool \
74 --enable-shared \
75 --disable-static \
76 --with-gost=no \
77 --with-openssl=/usr \
78 --with-gssapi=yes \
79 --with-libidn2 \
80 --with-json-c \
81 --with-lmdb=/usr \
82 --with-gnu-ld \
83 --with-maxminddb \
84 --with-atf=no \
85 --enable-ipv6 \
86 --enable-rrl \
87 --enable-filter-aaaa \
88 --disable-native-pkcs11 \
89 --enable-dnstap \
90 $(EXTRA_FEATURES)
91
92 override_dh_auto_build:
93 sed -i 's/:gl:`\([#!][^`]*\)`/[GL \1]/g' doc/notes/*.rst
94 dh_auto_build -- all html
95
96 override_dh_auto_clean: clean_version_extensions
97 sed -i 's/\[GL \([#!][^]]*\)]/:gl:`\1`/g' doc/notes/*.rst
98 dh_auto_clean
99
100 override_dh_auto_install:
101 dh_auto_install --destdir=$(CURDIR)/debian/tmp -- install install-html
102
103 override_dh_auto_test:
104 :
105
106 override_dh_installinit:
107 dh_installinit -pbind9 --name=named
108 dh_installinit --remaining
109
110 override_dh_installsystemd:
111 dh_installsystemd -pbind9 --no-enable --name=named-resolvconf named-resolvconf.service
112 dh_installsystemd -pbind9 --name=named named.service
113 dh_installsystemd --remaining
114
115 override_dh_install:
116 dh_install $(EXCLUDE_FILES)
117 # Install apparmor profile
118 dh_apparmor -pbind9 --profile-name=usr.sbin.named
119
120 override_dh_missing:
121 dh_missing $(EXCLUDE_FILES) --fail-missing
122
123 .PHONY: prepare_version_extensions clean_version_extensions