File: rules

package info (click to toggle)
whereami 0.3.34-0.4
  • links: PTS
  • area: main
  • in suites: bullseye, buster, stretch
  • size: 424 kB
  • ctags: 33
  • sloc: sh: 1,103; perl: 524; makefile: 82
file content (108 lines) | stat: -rwxr-xr-x 4,279 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
#!/usr/bin/make -f
# -*- makefile -*-
# debian/rules file - for whereami
# Copyright 1999-2006 by Andrew McMillan
# Based on the pcmcia package by Brian Mays
# Patterned after the hello package by Ian Jackson.

# The package we are dealing with
package=whereami

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

build-stamp:
	dh_testdir
	umask 022; $(MAKE) all
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	-$(MAKE) clean
	dh_clean

build:	build-stamp

binary-arch binary-indep: binary

binary:	build
	dh_testdir
	dh_testroot
	dh_clean -k
	$(RM) -r debian/$(package)
# Install directories
	dh_installdirs DEBIAN etc etc/init.d etc/$(package) \
							etc/$(package) etc/apm etc/apm/scripts.d \
							etc/apm/suspend.d etc/apm/resume.d \
							etc/dhcp etc/dhcp/dhclient-exit-hooks.d \
							etc/dhcp3 etc/dhcp3/dhclient-exit-hooks.d \
							etc/network etc/network/if-up.d \
							etc/network/if-pre-up.d \
							etc/network/if-down.d \
							etc/network/if-post-down.d \
							usr usr/sbin usr/share usr/share/doc \
							usr/share/$(package) \
							usr/share/$(package)/actions \
							usr/share/$(package)/tests \
							usr/share/doc/$(package) \
							usr/share/doc/$(package)/html/ \
							usr/share/doc/$(package)/html/images \
							usr/share/doc/$(package)/patches/ \
							usr/share/man usr/share/man/man8 \
							var/lib/whereami

# Install files
	install bin/$(package) debian/$(package)/usr/sbin/.
	dh_installinit --no-restart-on-upgrade --update-rcd-params="defaults 35 65"
	install bin/whereami.apm debian/$(package)/etc/apm/scripts.d/$(package)
	cd debian/$(package)/etc/apm/suspend.d; ln -s ../scripts.d/$(package) 01$(package)
	cd debian/$(package)/etc/apm/resume.d; ln -s ../scripts.d/$(package) 99$(package)
	install -m644 whereami.conf mail-relay.conf apm.conf detect.conf debian/$(package)/etc/$(package)/.
	install -m755 debian/whereami.dhclient3-exit-hook debian/$(package)/etc/dhcp/dhclient-exit-hooks.d/whereami
	install -m755 debian/whereami.dhclient3-exit-hook debian/$(package)/etc/dhcp3/dhclient-exit-hooks.d/whereami
	install -m755 debian/whereami.network-hook debian/$(package)/etc/network/if-pre-up.d/whereami
# If we want to run other than in "pre-up" then we should include something like this.  At this stage just "pre-up" seems right-ish...
# 	(cd debian/$(package)/etc/network; ln -s ../if-pre-up.d/whereami if-up.d/whereami; ln -s ../if-pre-up.d/whereami if-post-down.d/whereami; ln -s ../if-pre-up.d/whereami if-down.d/whereami)
	install -m644 debian/*.patch debian/$(package)/usr/share/doc/$(package)/patches/.
	install -m644 html/*.html debian/$(package)/usr/share/doc/$(package)/html/.
	install -m644 `find html/images -maxdepth 1 -type f` debian/$(package)/usr/share/doc/$(package)/html/images/.
	install -m755 `find scripts -maxdepth 1 -type f ` debian/$(package)/usr/share/$(package)/actions/.
	cd debian/$(package)/usr/share/$(package); sh -c 'for FILE in actions/* ; do ln -s $$FILE; done'
	install -m755 `find scripts/tests -maxdepth 1 -type f ` debian/$(package)/usr/share/$(package)/tests/.
# Find configuration files
	# find debian/$(package)/etc/$(package) -name "*.conf" -not -type d | \
		# sed 's%debian/$(package)%%' >debian/conffiles
	# echo "/etc/init.d/$(package)" >>debian/conffiles
	# echo "/etc/apm/event.d/10$(package)" >>debian/conffiles
	# sort <debian/conffiles | uniq >debian/$(package)/DEBIAN/conffiles
# Install documentation
	install -m644 AUTHORS README VERSION TODO \
	  debian/$(package)/usr/share/doc/$(package)/.
	dh_installman man/whereami.8 man/detect.conf.5 man/whereami.conf.5
	dh_installchangelogs
	dh_compress
	install -m644 debian/copyright \
	  debian/$(package)/usr/share/doc/$(package)/copyright
	dh_fixperms
	# Set permissions on our helper scripts
	chmod 755 debian/$(package)/usr/share/$(package)/*
	dh_installdeb
	dh_perl
	dh_gencontrol
	sed '/:/s/, *$$//' debian/$(package)/DEBIAN/control \
	  >debian/$(package)/DEBIAN/control.new
	mv debian/$(package)/DEBIAN/control.new debian/$(package)/DEBIAN/control
	dh_md5sums
	dh_builddeb


# Below here is fairly generic really

binary:		binary-indep binary-arch

source diff:
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

.PHONY: binary-arch binary-indep clean