File: rules

package info (click to toggle)
isc-dhcp 4.4.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 7,664 kB
  • sloc: ansic: 93,167; perl: 4,383; sh: 3,702; xml: 680; makefile: 304
file content (86 lines) | stat: -rwxr-xr-x 2,933 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
#!/usr/bin/make -f

export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS=hardening=+all

DEB_HOST_ARCH_OS=$(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
DEB_HOST_GNU_TYPE=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE=$(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

LEASE_PATH=/var/lib/dhcp
DHCLIENT_SCRIPT=/sbin/dhclient-script

CFLAGS+=-Wall
CFLAGS+=-I/usr/include/bind-export
CFLAGS+=-DCALL_SCRIPT_ON_ONETRY_FAIL
CFLAGS+=$(shell dpkg-buildflags --get CFLAGS)

CFLAGS+=-D_PATH_DHCPD_CONF='\"/etc/dhcp/dhcpd.conf\"'
CFLAGS+=-D_PATH_DHCPD_DB='\"$(LEASE_PATH)/dhcpd.leases\"'
CFLAGS+=-D_PATH_DHCPD6_DB='\"$(LEASE_PATH)/dhcpd6.leases\"'

CFLAGS+=-D_PATH_DHCLIENT_SCRIPT='\"$(DHCLIENT_SCRIPT)\"'
CFLAGS+=-D_PATH_DHCLIENT_CONF='\"/etc/dhcp/dhclient.conf\"'
CFLAGS+=-D_PATH_DHCLIENT_DB='\"$(LEASE_PATH)/dhclient.leases\"'
CFLAGS+=-D_PATH_DHCLIENT6_DB='\"$(LEASE_PATH)/dhclient6.leases\"'

CONFFLAGS=--prefix=/usr --with-libbind=/usr --enable-log-pid --enable-paranoia

# cross-architecture building
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
CONFFLAGS+=--build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) --with-randomdev=/dev/random
endif

# hurd support
ifeq ($(DEB_HOST_ARCH_OS), hurd)
export DO_LPF=1
CONFFLAGS+=--enable-use-sockets
endif

%:
	dh $@ --parallel --with autoreconf

override_dh_auto_configure:

override_dh_auto_build:
	# ldap-enabled build
	test -f Makefile && $(MAKE) distclean || true
	./configure --with-ldap --with-ldapcrypto CFLAGS="$(CFLAGS) -DNSUPDATE" LDFLAGS="-lirs-export $(LDFLAGS)" $(CONFFLAGS)
	$(MAKE)
	mv server/dhcpd dhcpd
	# ddns-disabled build
	test -f Makefile && $(MAKE) distclean || true
	./configure CFLAGS="$(CFLAGS)" $(CONFFLAGS)
	$(MAKE)
	mv client/dhclient dhclient
	# ldap-disabled build
	test -f Makefile && $(MAKE) distclean || true
	./configure CFLAGS="$(CFLAGS) -DNSUPDATE" LDFLAGS="-lirs-export $(LDFLAGS)" $(CONFFLAGS)
	$(MAKE)

override_dh_install:
	# rename some upstream files
	cp RELNOTES debian/tmp/changelog
	cp server/dhcpd.conf.example debian/tmp/dhcpd.conf
	cp doc/examples/dhcpd-dhcpv6.conf debian/tmp/dhcpd6.conf
	# install
	dh_install
	# rename scripts
	cp debian/dhclient-script.$(DEB_HOST_ARCH_OS) \
	    debian/isc-dhcp-client$(DHCLIENT_SCRIPT)
	cp debian/dhclient-script.$(DEB_HOST_ARCH_OS).udeb \
	    debian/isc-dhcp-client-udeb$(DHCLIENT_SCRIPT)
	cp debian/rfc3442-classless-routes.$(DEB_HOST_ARCH_OS) \
	    debian/isc-dhcp-client/etc/dhcp/dhclient-exit-hooks.d/rfc3442-classless-routes
	cp contrib/dhcp-lease-list.pl \
	    debian/isc-dhcp-server/usr/sbin/dhcp-lease-list
	# use actual paths rather than undefined variables in man pages
	sed -e 's|ETCDIR|/etc/dhcp|g' \
	    -e 's/RUNDIR/\/var\/run/g' \
	    -e 's/CLIENTBINDIR/\/sbin/g' \
	    -e 's/DBDIR/\/var\/lib\/dhcp/g' \
	    -i debian/tmp/usr/share/man/man*/*

override_dh_installinit:
	dh_installinit -Nisc-dhcp-server
	dh_installinit -pisc-dhcp-server --error-handler=true