File: rules

package info (click to toggle)
dhcp-helper 1.2-3.1
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 160 kB
  • sloc: ansic: 441; sh: 97; makefile: 79
file content (94 lines) | stat: -rwxr-xr-x 3,280 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
#!/usr/bin/make -f
# debian/rules file - for dhcp-helper.
# Copyright 2004 by Simon Kelley
# Based on the sample in the debian hello package which carries the following:
# Copyright 1994,1995 by Ian Jackson.
# I hereby give you perpetual unlimited permission to copy,
# modify and relicense this file, provided that you do not remove
# my name from the file itself.  (I assert my moral right of
# paternity under the Copyright, Designs and Patents Act 1988.)
# This file may have to be extensively modified

package=dhcp-helper

CFLAGS = $(shell export DEB_BUILD_OPTIONS=$(DEB_BUILD_OPTIONS); dpkg-buildflags --get CFLAGS)
CFLAGS += $(shell dpkg-buildflags --get CPPFLAGS)
CFLAGS += $(shell dpkg-buildflags --get LDFLAGS)
CFLAGS += -Wall -W
BUILD_DATE := $(shell dpkg-parsechangelog --show-field Date)

build:
	$(checkdir)
	make CC=gcc CFLAGS="$(CFLAGS)"
	touch build

clean:
	$(checkdir)
	rm -f build
	rm -rf debian/tmp debian/*~ debian/files* debian/substvars
	make clean

binary-indep:	checkroot build
	$(checkdir)
# There are no architecture-independent files to be uploaded
# generated by this package.  If there were any they would be
# made here.

binary-arch:	checkroot build
	$(checkdir)
	rm -rf debian/tmp
	install -d debian/tmp/DEBIAN\
		-d debian/tmp/usr/sbin\
	        -d debian/tmp/usr/share/doc/$(package)\
		-d debian/tmp/usr/share/man/man8\
                -d debian/tmp/etc/init.d\
                -d debian/tmp/etc/default\
		-d debian/tmp/lib/systemd/system\
		-d debian/tmp/var/run
	install -m 644 debian/conffiles debian/tmp/DEBIAN
	install -m 755 debian/postinst debian/postrm debian/prerm debian/tmp/DEBIAN
	install -m 755 dhcp-helper debian/tmp/usr/sbin
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	strip -R .note -R .comment debian/tmp/usr/sbin/dhcp-helper	
endif
	install -m 755 debian/init debian/tmp/etc/init.d/dhcp-helper
	install -m 644 debian/default debian/tmp/etc/default/dhcp-helper
	install -m 644 debian/systemd.service debian/tmp/lib/systemd/system/dhcp-helper.service
ifeq (,$(findstring nodocs,$(DEB_BUILD_OPTIONS)))
	cp CHANGELOG debian/tmp/usr/share/doc/$(package)/changelog
	gzip -9n debian/tmp/usr/share/doc/$(package)/changelog
	cp README debian/tmp/usr/share/doc/$(package)/README
	gzip -9n debian/tmp/usr/share/doc/$(package)/README
endif
	cp debian/changelog debian/tmp/usr/share/doc/$(package)/changelog.Debian
	gzip -9n debian/tmp/usr/share/doc/$(package)/changelog.Debian
	cp debian/copyright debian/tmp/usr/share/doc/$(package)/copyright
	cp dhcp-helper.8 debian/tmp/usr/share/man/man8
	gzip -9n debian/tmp/usr/share/man/man8/dhcp-helper.8
	cd debian/tmp && find . -type f ! -regex '.*DEBIAN/.*' -printf '%P\0' | LC_ALL=C sort -z | xargs -r0 md5sum > DEBIAN/md5sums
	dpkg-shlibdeps debian/tmp/usr/sbin/dhcp-helper
	dpkg-gencontrol
	find debian/tmp -depth -newermt '$(BUILD_DATE)' -print0 | xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
	chown -R root.root debian/tmp
	chmod -R g-ws debian/tmp
	dpkg --build debian/tmp ..

define checkdir
	test -f dhcp-helper.c -a -f debian/rules
endef

# Below here is fairly generic really

binary:		binary-indep binary-arch

build:          
build-arch:
build-indep:

checkroot:
	$(checkdir)
	test root = "`whoami`"

.PHONY: binary binary-arch binary-indep clean checkroot