File: rules

package info (click to toggle)
cpio 2.4.2-23
  • links: PTS
  • area: main
  • in suites: slink
  • size: 836 kB
  • ctags: 704
  • sloc: ansic: 7,997; makefile: 208; sh: 176
file content (84 lines) | stat: -rwxr-xr-x 2,212 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
#!/usr/bin/make -f
# -*- makefile -*-
# debian/rules file - for cpio
# Copyright 1998 by Brian Mays
# Patterned after the hello package by Ian Jackson.

package=cpio

build:
	$(checkdir)
	./configure --prefix=/usr
	$(MAKE) CFLAGS='-O2 -g -Wall' all rmt info
	touch build

clean:
	$(checkdir)
	$(RM) build
	$(MAKE) -i distclean || $(MAKE) -f Makefile.in distclean
	$(RM) config.cache
	$(RM) -r *~ debian/tmp debian/*~ debian/files*

binary-indep:	checkroot build
	$(checkdir)

binary-arch:	checkroot build
	$(chechdir)
	$(RM) -r debian/tmp
	install -d debian/tmp debian/tmp/DEBIAN
	install -d debian/tmp/usr/doc/$(package)
# Install Debian package control information files
	install debian/postinst \
		debian/prerm debian/tmp/DEBIAN/.
# Install directories
	install -d	\
		debian/tmp/etc	\
		debian/tmp/sbin	\
		debian/tmp/bin	\
		debian/tmp/usr/sbin	\
		debian/tmp/usr/man/man1	\
		debian/tmp/usr/man/man8	\
		debian/tmp/usr/info
# Install files
	$(MAKE) install prefix=debian/tmp/usr exec_prefix=debian/tmp \
	  libexecdir=debian/tmp/usr/sbin
	ln -sf ../usr/sbin/rmt debian/tmp/etc/rmt
	ln -sf ../usr/sbin/rmt debian/tmp/sbin/rmt
# Strip binaries
	strip debian/tmp/bin/*
	strip debian/tmp/usr/sbin/*
# Install documentation
	install -m 644 ChangeLog debian/tmp/usr/doc/$(package)/changelog
	install -m 644 NEWS README debian/tmp/usr/doc/$(package)/.
# Install changelog & copyright
	install -m 644 debian/changelog \
	  debian/tmp/usr/doc/$(package)/changelog.Debian
	install -m 644 rmt.8 debian/tmp/usr/man/man8/.
	gzip -9v debian/tmp/usr/doc/$(package)/*
	gzip -9v debian/tmp/usr/man/*/*
	gzip -9v debian/tmp/usr/info/*
	install -m 644 debian/copyright debian/tmp/usr/doc/$(package)/.
# Determine shared library dependencies
	dpkg-shlibdeps cpio mt rmt
# Genereate deb file
	dpkg-gencontrol
	chown -R root.root debian/tmp
	chmod -R g-ws debian/tmp
	dpkg-deb --build debian/tmp ..

define checkdir
	test -f $(package).h -a -f debian/rules
endef

# 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

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

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