File: rules

package info (click to toggle)
iproute 991023-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 932 kB
  • ctags: 767
  • sloc: ansic: 12,199; sh: 1,018; makefile: 172; perl: 100
file content (78 lines) | stat: -rwxr-xr-x 2,622 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
#!/usr/bin/make -f
#
# Copyright (C) 1999 Roberto Lumbreras <rover@debian.org>
# Copyright (C) 1999 Juan Cespedes <cespedes@debian.org>
# Copying: GPL

SHELL	=	bash

PACKAGE	=	$(shell perl -e 'print <> =~ /^(.*) \(.*\)/' debian/changelog)
PKG_VER	=	$(shell perl -e 'print <> =~ /\((.*)\)/' debian/changelog)
PKG_UPVER=	$(shell perl -e 'print <> =~ /\((.*)-[^-]*\)/' debian/changelog)

BINS	=	ip/ip ip/rtmon ip/rtacct tc/tc
SHBINS	=	ip/routef ip/routel # ip/ifcfg ip/rtpr
DOCS	=	README* doc/Plan
MAN8	=	debian/iproute.8
MAN7	=	debian/iproute.7
MANLINKS=	ip rtmon rtacct tc routef routel
TEXDOCS	=	ip-cref ip-tunnels api-ip6-flowlabels

build:		stamp-build

stamp-build:
		$(MAKE) KERNEL_INCLUDE=/usr/include
		$(MAKE) -C doc
		touch stamp-build

binary:		binary-indep binary-arch

binary-indep:

binary-arch:	checkroot stamp-build
		$(RM) -r debian/tmp
		install -d -m0755 debian/tmp/{DEBIAN,sbin,usr/{bin,share/doc/$(PACKAGE),share/man/man{7,8}}}
		install -s -m0755 $(BINS) debian/tmp/sbin/
		install -m0755 $(SHBINS) debian/tmp/usr/bin/
		cp -p $(DOCS) debian/tmp/usr/share/doc/$(PACKAGE)/
		cp -rp examples debian/tmp/usr/share/doc/$(PACKAGE)/
		find debian/tmp/usr/share/doc/$(PACKAGE)/examples -type f -exec chmod -x {} \;
		install -m0644 debian/changelog debian/tmp/usr/share/doc/$(PACKAGE)/changelog.Debian
		cp -p RELNOTES debian/tmp/usr/share/doc/$(PACKAGE)/changelog
		for i in $(TEXDOCS); do \
			install -m0644 doc/$$i.tex debian/tmp/usr/share/doc/$(PACKAGE)/; \
			install -m0644 doc/$$i.dvi debian/tmp/usr/share/doc/$(PACKAGE)/; \
			install -m0644 doc/$$i.ps debian/tmp/usr/share/doc/$(PACKAGE)/; \
		done
		install -m0644 $(MAN7) debian/tmp/usr/share/man/man7/
##		install -m0644 $(MAN8) debian/tmp/usr/share/man/man8/
		gzip -9fr debian/tmp/usr/share
		for i in $(MANLINKS); do \
			ln -s ../man7/iproute.7.gz debian/tmp/usr/share/man/man8/$$i.8.gz; \
		done
		cp -p debian/copyright debian/tmp/usr/share/doc/$(PACKAGE)/
		cp -rp etc debian/tmp/
		install -m0644 debian/conffiles debian/tmp/DEBIAN/
		install debian/postinst debian/tmp/DEBIAN/
		install debian/prerm debian/tmp/DEBIAN/

		dpkg-shlibdeps $(BINS)
		dpkg-gencontrol
		chown -R root.root debian/tmp
		chmod -R u=rwX,go=rX debian/tmp
		dpkg --build debian/tmp ..

checkdir:
		@test -f debian/rules

checkroot:	checkdir
		@test 0 = `id -u` || { echo "Error: not super-user"; exit 1; }

clean:		checkdir debian/control
		$(RM) stamp-build debian/files debian/substvars
		$(MAKE) clean
		$(MAKE) -C doc clean
		$(RM) `find . -name "*~" -o -name core`
		$(RM) -r debian/tmp

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