File: rules

package info (click to toggle)
tct 1.07-9
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,828 kB
  • ctags: 1,128
  • sloc: perl: 9,604; ansic: 4,861; makefile: 516; sh: 77
file content (194 lines) | stat: -rwxr-xr-x 4,740 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
#!/usr/bin/make -f 

PACKAGE = tct
PACKAGE-ALT = timeout
SHELL = /bin/bash

tmp = debian/tmp
tmp-ALT = debian/timeout
sysconfdir = etc
docdir = usr/share/doc
mandir = usr/share/man
sbindir =usr/sbin
bindir = usr/bin


clean: checkroot
	test -f debian/control
	rm -rf $(tmp) $(tmp-ALT) debian/substvar debian/files build-stamp
	$(MAKE) tidy
	chmod 755 debian/rules


checkroot:
	test root = "`whoami`" || (echo Need root privelages; exit 1)

build: 
	$(MAKE)
	touch build-stamp

binary-indep: build
	$(checkroot)


binary-arch: checkroot build
	#
	# Build the main binary package.
	#
	
	install --mode=755 -d $(tmp)/DEBIAN
	install --mode=755 -d $(tmp)/$(sysconfdir)/tct
	install --mode=755 -d $(tmp)/usr/{bin,sbin}
	install --mode=755 -d $(tmp)/var/cache/$(PACKAGE)/data
	install --mode=755 -d $(tmp)/usr/share/$(PACKAGE)
	install --mode=755 -d $(tmp)/usr/share/man/{man1,man5}
	install --mode=755 -d $(tmp)/usr/share/doc/$(PACKAGE)/contrib
	
	#
	# Install documentation.
	#
	
	install --mode=644 Beware $(tmp)/$(docdir)/$(PACKAGE)
	install --mode=644 README.FIRST $(tmp)/$(docdir)/$(PACKAGE)
	install --mode=644 TODO*	$(tmp)/$(docdir)/$(PACKAGE)
	install --mode=644 bibliography $(tmp)/$(docdir)/$(PACKAGE)
	install --mode=644 help*	$(tmp)/$(docdir)/$(PACKAGE)
	install --mode=644 CHANGES 	$(tmp)/$(docdir)/$(PACKAGE)/changelog
	install --mode=644 debian/changelog \
		$(tmp)/$(docdir)/$(PACKAGE)/changelog.Debian
	install --mode=644 debian/copyright \
		$(tmp)/$(docdir)/$(PACKAGE)
	install --mode=644 docs/*	$(tmp)/$(docdir)/$(PACKAGE)
	install --mode=644 debian/contrib/md5_image_maker \
		$(tmp)/$(docdir)/$(PACKAGE)/contrib
	install --mode=644 man/man1/{ils.1,mactime.1,unrm.1} \
		$(tmp)/$(mandir)/man1
	install --mode=644 man/man1/icat.1 \
		$(tmp)/$(mandir)/man1/inode-cat.1
	install --mode=644 man/man1/{grave-robber.1,lazarus.1,pcat.1} \
		$(tmp)/$(mandir)/man1
	install --mode=644 man/man1/major_minor.1 \
		$(tmp)/$(mandir)/man1
	install --mode=644 man/man5/tm-format.5 \
		$(tmp)/$(mandir)/man5
	install --mode=644 debian/ils2mac.1 \
		$(tmp)/$(mandir)/man1
	
	#
	# Install binaries.
	#
	
	install --mode=755 lazarus/lazarus \
		$(tmp)/$(bindir)
	install -p --mode=755 bin/{grave-robber,mactime} \
		$(tmp)/$(bindir)
	install -p -s --mode=755 bin/{unrm,pcat,ils,major_minor} \
		$(tmp)/$(bindir)
	install -p -s --mode=755 bin/icat \
		$(tmp)/$(bindir)/inode-cat
	install --mode=755 extras/ils2mac $(tmp)/$(bindir)
	
	#
	# Install package related files.
	#
	
	install --mode=644 debian/conffiles \
	    $(tmp)/DEBIAN
	install --mode=755 debian/{postinst,prerm,postrm} \
		$(tmp)/DEBIAN
	
	#
	# Install configuration files and additional perl stuff.
	#
	
	install --mode=644 "conf/save_these_files" \
		$(tmp)/$(sysconfdir)/$(PACKAGE)
	install --mode=644 "conf/look@first" \
	    $(tmp)/$(sysconfdir)/$(PACKAGE)/
	install --mode=644 conf/lazarus.cf \
	    $(tmp)/$(sysconfdir)/$(PACKAGE)/lazarus.conf
	install --mode=644 conf/coroner.cf \
	    $(tmp)/$(sysconfdir)/$(PACKAGE)/coroner.conf
	install --mode=644 conf/grave-robber.cf \
	    $(tmp)/$(sysconfdir)/$(PACKAGE)/grave-robber.conf
	install --mode=644 conf/paths.pl    \
	    $(tmp)/$(sysconfdir)/$(PACKAGE)
	install --mode=644 lib/* \
	    $(tmp)/usr/share/$(PACKAGE)
	    
	#
	# Compress documenation.
	#
	
	gzip -9f $(tmp)/$(mandir)/{man1,man5}/*
	gzip -9f $(tmp)/$(docdir)/$(PACKAGE)/changelog*
	
	#
	# Build the binary package.
	#
	
	dpkg-shlibdeps $(tmp)/$(bindir)/*
	dpkg-gencontrol -ips -p$(PACKAGE) -P$(tmp)
	dpkg --build $(tmp) ..
	
	#
	# Build the timeout package
	#
	
	install --mode=755 -d $(tmp-ALT)/DEBIAN
	install --mode=755 -d $(tmp-ALT)/usr/bin
	install --mode=755 -d $(tmp-ALT)/usr/share/doc/$(PACKAGE-ALT)
	install --mode=755 -d $(tmp-ALT)/usr/share/man/man1
	
	#
	# Install documentation
	#
	
	install --mode=644 debian/copyright.timeout \
		$(tmp-ALT)/usr/share/doc/$(PACKAGE-ALT)/copyright
	install --mode=644 debian/changelog \
		$(tmp-ALT)/usr/share/doc/$(PACKAGE-ALT)/changelog.Debian
	install --mode=644 man/man1/timeout.1 \
		$(tmp-ALT)/usr/share/man/man1
		
	#
	# Compress stuff.
	#
	
	gzip -9f $(tmp-ALT)/usr/share/man/man1/*
	gzip -9f $(tmp-ALT)/usr/share/doc/$(PACKAGE-ALT)/changelog*
	
	
	#
	# Install binary
	#
	
	install --mode=755 -p -s bin/timeout \
		$(tmp-ALT)/usr/bin
	
	#
	# Install package related scripts.
	#
	
	install --mode=755 debian/postinst.timeout \
		$(tmp-ALT)/DEBIAN/postinst
	install --mode=755 debian/prerm.timeout \
		$(tmp-ALT)/DEBIAN/prerm
	
	#
	# Create the package
	#
	
	dpkg-shlibdeps $(tmp-ALT)/usr/bin/*
	dpkg-gencontrol -ips -p$(PACKAGE-ALT) -P$(tmp-ALT)
	dpkg --build $(tmp-ALT) ..
	
	

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

binary: binary-indep binary-arch