File: rules

package info (click to toggle)
bind9-libs 1%3A9.11.19%2Bdfsg-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 42,008 kB
  • sloc: ansic: 341,272; sh: 38,449; xml: 22,061; perl: 8,266; makefile: 3,913; cpp: 2,086; python: 535; tcl: 13
file content (125 lines) | stat: -rwxr-xr-x 4,158 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1

export DEB_CFLAGS_MAINT_APPEND = -fno-strict-aliasing -fno-delete-null-pointer-checks -DNO_VERSION_DATE -DDIG_SIGCHASE

export DPKG_GENSYMBOLS_CHECK_LEVEL := 4

include /usr/share/dpkg/default.mk

DEB_REVISION = $(call dpkg_late_eval,DEB_REVISION,echo '$(DEB_VERSION)' | sed -e 's/^.*-/-/')

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

COMMA = ,
ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
  NJOBS := -j $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
endif

export arch = $(DEB_HOST_ARCH)

%:
	dh $@ --fail-missing --exclude=.la --exclude=lwresd --exclude=__pycache__

prepare_version:
	if [ ! -f version.bak ]; then cp version version.bak; fi
	sed -i 's,^EXTENSIONS=.*$$,EXTENSIONS=$(DEB_REVISION)-$(DEB_VENDOR),' version

clean_version:
	if [ -f version.bak ]; then cp version.bak version; fi

override_dh_autoreconf: prepare_version
	dh_autoreconf

CONFIGURE_COMMON := \
	--disable-devpoll \
	--disable-epoll \
	--disable-kqueue \
	--disable-linux-caps \
	--disable-threads \
	--enable-ipv6 \
	--enable-largefile \
	--enable-rrl \
	--enable-shared \
	--enable-static \
	--enable-threads \
	--localstatedir=/ \
	--sysconfdir=/etc/bind \
	--with-atf=no \
	--with-gnu-ld \
	--with-gost=no \
	--with-libtool \
	--with-openssl=/usr \
	--without-geoip2 \
	--without-libidn2 \
	--without-libjson \
	--without-libxml2 \
	--without-lmdb \
	--without-python \
	--without-readline \
	--with-randomdev=/dev/urandom

override_dh_auto_configure:
	debian/checkapi
	dh_auto_configure -B build -- \
		--with-gssapi=/usr \
		--libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
		$(CONFIGURE_COMMON)
	dh_auto_configure -B build-udeb -- \
		--with-gssapi=no \
		--libdir=/lib/$(DEB_HOST_MULTIARCH) \
		--includedir=/usr/include/bind-export \
		$(CONFIGURE_COMMON)
	sh debian/apply-export-patch
	# no need to build these targets here
	cp lib/dns/dnstap.proto build/lib/dns

override_dh_auto_build:
	dh_auto_build -B build
	dh_auto_build -B build-udeb

override_dh_auto_clean: clean_version
	dh_auto_clean -B build
	dh_auto_clean -B build-udeb

override_dh_auto_install:
	dh_auto_install -B build      --destdir=$(CURDIR)/debian/tmp
	dh_auto_install -B build-udeb --destdir=$(CURDIR)/debian/tmp-udeb

override_dh_install:
	dh_install --exclude=.la --exclude=lwresd --exclude=__pycache__ --fail-missing

	# Fix symlink for export libs to be absolute
	for lib in `find debian/tmp-udeb/lib/$(DEB_HOST_MULTIARCH)/ -type l -name 'lib*-export.so.*'`; do \
	  lib=$$(basename $$lib); \
	  dev=$$(echo $$lib | sed 's/\.so\..*/.so/'); \
	  echo /lib/$(DEB_HOST_MULTIARCH)/$$lib /usr/lib/$(DEB_HOST_MULTIARCH)/$$dev; \
	  dh_link -plibbind-export-dev /lib/$(DEB_HOST_MULTIARCH)/$$lib \
	    /usr/lib/$(DEB_HOST_MULTIARCH)/$$dev; \
	done

override_dh_makeshlibs: DNS_SOVER=$(shell debian/getapi dns)
override_dh_makeshlibs: IRS_SOVER=$(shell debian/getapi irs)
override_dh_makeshlibs: ISCCC_SOVER=$(shell debian/getapi isccc)
override_dh_makeshlibs: ISCCFG_SOVER=$(shell debian/getapi isccfg)
override_dh_makeshlibs: ISC_SOVER=$(shell debian/getapi isc)
override_dh_makeshlibs:
	dh_makeshlibs -plibdns-export$(DNS_SOVER) --add-udeb=libdns-export$(DNS_SOVER)-udeb
	dh_makeshlibs -plibirs-export$(IRS_SOVER) --add-udeb=libirs-export$(IRS_SOVER)-udeb
	dh_makeshlibs -plibisccc-export$(ISCCC_SOVER) --add-udeb=libisccc-export$(ISCCC_SOVER)-udeb
	dh_makeshlibs -plibisccfg-export$(ISCCFG_SOVER) --add-udeb=libisccfg-export$(ISCCFG_SOVER)-udeb
	dh_makeshlibs -plibisc-export$(ISC_SOVER) --add-udeb=libisc-export$(ISC_SOVER)-udeb
	dh_makeshlibs --remaining-packages

override_dh_shlibdeps:
	dh_shlibdeps
	# Downgrade libcrypto1.1-udeb dependency from 1.1.1 to 1.1.0
	# The udebs don't use any newer symbols, but due to them using
	# shlibs the dependency is generated anyway. This blocks migration
	# to testing until OpenSSL 1.1.1 is sorted out
	sed -i 's:libcrypto1.1-udeb (>= 1.1.1):libcrypto1.1-udeb (>= 1.1.0):' debian/*-udeb.substvars