File: rules

package info (click to toggle)
gnats 3.113-13
  • links: PTS
  • area: main
  • in suites: potato
  • size: 5,640 kB
  • ctags: 2,917
  • sloc: ansic: 25,624; tcl: 8,071; sh: 5,362; perl: 3,619; makefile: 3,164; yacc: 820; lisp: 742; sql: 280; sed: 181
file content (355 lines) | stat: -rwxr-xr-x 12,445 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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
#! /usr/bin/make -f
#
# Debian build rules for "Gnats" by Brian White <bcwhite@pobox.com>
# Taken over by Milan Zamazal <pdm@debian.org>

package	:= gnats

DATADIR := /var/lib
DBDIR   := $(DATADIR)/gnats/gnats-db
LISPDIR := /usr/share/emacs/site-lisp/gnats
GSITE	:= unknown-site
GADDR	:= unknown-addr
GORG	:= unknown-org
GADMIN  := gnats-admin
GUSER   := gnats
MAKEDEFS:= DEFAULT_SITE=$(GSITE) GNATS_SITE=$(GSITE) GNATS_ADMIN=$(GADMIN) \
	   GNATS_ADDR=$(GADDR) DEFAULT_ORGANIZATION=$(GORG) SUBMITTER=$(GORG) \
	   GNATS_USER=$(GUSER)
GTKDEFS	:= CHECK_CFG=no
CFLAGS	:= -O2 -g
CONFLAGS:= --prefix=/usr --libexecdir='$${prefix}/lib' --infodir='$${prefix}/share/info' --mandir='$${prefix}/share/man' --with-gnats-root=$(DBDIR) --with-gnats-service=gnats
PWD	:= $(shell pwd)
TKGNATS := tkgnats

default:
	@echo "What to do?"
	@echo " - build-server, build-user, build-tk, build-www,"
	@echo " - binary, binary-server, binary-user, binary-tk, binary-www,"
	@echo " - clean, distclean"
	@echo " "

build:
	@echo "There is no general 'build' rule."
	@echo "(appropriate builds will be done as required by the binaries)"

build-server:
	dh_testdir
	rm -f stamp-build-user
	./configure $(CONFLAGS) --with-full-gnats
	cd gnats && ./configure $(CONFLAGS) --with-full-gnats
	cd send-pr && ./configure $(CONFLAGS) --with-full-gnats
	echo "$(MAKE) all info CFLAGS="$(CFLAGS)" datadir=$(DATADIR) $(MAKEDEFS)"
	$(MAKE) all info CFLAGS="$(CFLAGS)" datadir=$(DATADIR) $(MAKEDEFS)
	cd gnats && texi2html -split_chapter -I ../send-pr gnats.texi
	touch stamp-build

build-user:
	dh_testdir
	rm -f stamp-build
	./configure $(CONFLAGS)
	cd gnats && ./configure $(CONFLAGS) --with-full-gnats
	cd send-pr && ./configure $(CONFLAGS) --with-full-gnats
	$(MAKE) all info CFLAGS="$(CFLAGS)" datadir=$(DATADIR) $(MAKEDEFS)
	cd gnats && texi2html -split_chapter -I ../send-pr gnats.texi
	touch stamp-build-user

build-tk:
	dh_testdir
	$(MAKE) -C contrib/$(TKGNATS) LDIR=/usr SHRDIR=$(DATADIR) \
		$(MAKEDEFS) $(GTKDEFS) clean
	$(MAKE) -C contrib/$(TKGNATS) LDIR=/usr SHRDIR=$(DATADIR) \
		$(MAKEDEFS) $(GTKDEFS) prefix=/usr LIBEXECDIR=/usr/lib
	touch stamp-build-tkgnats

build-www:
	dh_testdir
	touch stamp-build-gnatsweb

gnatsclean:
	dh_testdir
	-rm -f stamp-*
	./configure $(CONFLAGS)
	-$(MAKE) -C contrib/$(TKGNATS) clean
	-$(MAKE) distclean
	cd etc && rm -f *.info*
	cd gnats && rm -f *.html

clean: gnatsclean
	dh_testdir
	-rm -f build build-user build-tk build-www
	dh_clean

binary-server:
	dh_testdir
	dh_testroot
	test -f stamp-build || $(MAKE) -f debian/rules gnatsclean build-server
	-rm -rf debian/tmp
	dh_installdirs etc/cron.daily etc/cron.d etc/emacs/site-start.d \
		etc/gnats/db-config usr/bin usr/share/doc/$(package)/html \
		usr/share/info usr/lib/emacsen-common/packages/install \
		usr/lib/emacsen-common/packages/remove \
		usr/lib/gnats usr/share/man/man1 usr/share/man/man8 \
		var/lib/gnats/dist
	$(MAKE) -C gnats CFLAGS="$(CFLAGS)" prefix=$(PWD)/debian/tmp/usr \
		install install-info \
		$(MAKEDEFS) \
		datadir=$(PWD)/debian/tmp$(DATADIR) \
		lispdir=$(PWD)/debian/tmp$(LISPDIR) \
		GNATS_ROOT=$(PWD)/debian/tmp$(DBDIR)
	$(MAKE) -C send-pr CFLAGS="$(CFLAGS)" prefix=$(PWD)/debian/tmp/usr \
		install install-info \
		$(MAKEDEFS) \
		datadir=$(PWD)/debian/tmp$(DATADIR) \
		lispdir=$(PWD)/debian/tmp$(LISPDIR) \
		GNATS_ROOT=$(PWD)/debian/tmp$(DBDIR) 
	set -e; for i in contrib/scripts/*-*; do \
		j=`basename $$i`; \
		sed $$i >debian/tmp/usr/lib/gnats/$$j \
			-e 's|GNATS_ROOT=.*|GNATS_ROOT=$(DBDIR)|' \
			-e 's|/usr/local|/usr|g' \
			-e 's|^#!/bin/ksh|#!/usr/bin/ksh|'; \
		chmod 755 debian/tmp/usr/lib/gnats/$$j; \
		dh_undocumented $$j.8; \
	done
	set -e; for i in debian/tmp/usr/bin/*; do \
		j=`basename $$i`; \
		if head -1 $$i | egrep -q '^#!'; then \
			cp $$i /tmp/$$j; \
			sed -e 's|$$GNATS_ROOT/gnats-bin|/usr/lib/gnats|g' \
			/tmp/$$j > $$i; \
		fi; \
		if [ ! -f debian/tmp/usr/share/man/man1/$$j.1.gz -a \
		     ! -f debian/tmp/usr/share/man/man8/$$j.8.gz ]; then \
			dh_undocumented $$j.8; \
		fi; \
	done
#	dh_undocumented check-db.8 delete-pr.8
	cp debian/gnats.el debian/tmp/etc/emacs/site-start.d/50gnats.el
	dh_installdocs CYGNUS
	install -m 644 gnats/*.html debian/tmp/usr/share/doc/$(package)/html/
	install -m 644 debian/dhelp \
		debian/tmp/usr/share/doc/$(package)/html/.dhelp
	ln -s gnats_toc.html \
		debian/tmp/usr/share/doc/$(package)/html/index.html
	dh_installchangelogs ChangeLog -pgnats -Pdebian/tmp
	dh_installdebconf -pgnats -Pdebian/tmp
	set -e; for i in install remove; do \
		sed 's/|PACKAGE|/gnats/' debian/emacs.$$i \
		>debian/tmp/usr/lib/emacsen-common/packages/$$i/gnats; \
		chmod 755 \
			debian/tmp/usr/lib/emacsen-common/packages/$$i/gnats;\
	done
	install -m 644 gnats/gnats-db.conf debian/tmp/etc/gnats/
	install debian/cron.daily debian/tmp/etc/cron.daily/gnats
	install -m 644 debian/cron.d debian/tmp/etc/cron.d/gnats
	install -m 644 debian/user/profile debian/tmp$(DBDIR)/.profile
	chown -R gnats.gnats debian/tmp$(DATADIR)/gnats
	dh_compress
	gzip -9 debian/tmp/var/lib/gnats/dist/*
	dh_strip
	dh_installdeb
	sed 's/^PACKAGE=$$/PACKAGE=$(package)/' debian/scripts/init \
		>debian/tmp/DEBIAN/preinst
	set -e; for s in fixprobs; do \
		sed -e 1,3d debian/scripts/$$s >>debian/tmp/DEBIAN/preinst; \
	done
	sed 's/^PACKAGE=$$/PACKAGE=$(package)/' debian/scripts/init \
		>debian/tmp/DEBIAN/postinst
	set -e; for s in addinfo adduser addinetd addmail addconfig \
		addemacs addfhs addhtml; do \
		sed -e 1,3d debian/scripts/$$s >>debian/tmp/DEBIAN/postinst; \
	done
	sed 's/^PACKAGE=$$/PACKAGE=$(package)/' debian/scripts/init \
		>debian/tmp/DEBIAN/prerm
	set -e; for s in rmconfig rmmail rminfo rmfhs; do \
		sed -e 1,3d debian/scripts/$$s >>debian/tmp/DEBIAN/prerm; \
	done
	sed 's/^PACKAGE=$$/PACKAGE=$(package)/' debian/scripts/init \
		>debian/tmp/DEBIAN/postrm
	set -e; for s in rmdebconf rmemacs rminetd; do \
		sed -e 1,3d debian/scripts/$$s >>debian/tmp/DEBIAN/postrm; \
	done
	chmod 755 debian/tmp/DEBIAN/p*
	dh_shlibdeps -pgnats -Pdebian/tmp
	dpkg-gencontrol -isp -pgnats -Pdebian/tmp
	chmod -R u+w,go=rX debian/tmp
	chmod 640 debian/tmp/var/lib/gnats/gnats-db/gnats-adm/gnatsd.access
	find debian/tmp$(DATADIR)/gnats -type d -print | xargs -r chmod g+s
	dh_md5sums
	dpkg --build debian/tmp
	dpkg-name -o -s .. debian/tmp.deb

binary-user:
	dh_testdir
	dh_testroot
	test -f stamp-build-user || $(MAKE) -f debian/rules gnatsclean \
		build-user
	-rm -rf debian/tmp
	dh_installdirs etc/emacs/site-start.d usr/bin \
		usr/share/doc/$(package)-user/html \
		usr/lib/emacsen-common/packages/install \
		usr/lib/emacsen-common/packages/remove \
		usr/lib/gnats usr/share/info \
		usr/share/man/man1 usr/share/man/man8 \
		var/lib/gnats/dist
	$(MAKE) -C gnats CFLAGS="$(CFLAGS)" prefix=$(PWD)/debian/tmp/usr \
		install install-info \
		$(MAKEDEFS) \
		datadir=$(PWD)/debian/tmp$(DATADIR) \
		lispdir=$(PWD)/debian/tmp$(LISPDIR)-user \
		GNATS_ROOT=$(PWD)/debian/tmp$(DBDIR)
	$(MAKE) -C send-pr CFLAGS="$(CFLAGS)" prefix=$(PWD)/debian/tmp/usr \
		install install-info \
		$(MAKEDEFS) \
		datadir=$(PWD)/debian/tmp$(DATADIR) \
		lispdir=$(PWD)/debian/tmp$(LISPDIR)-user \
		GNATS_ROOT=$(PWD)/debian/tmp$(DBDIR)
	rm -rf debian/tmp$(DATADIR)/gnats/*
	set -e; for i in debian/tmp/usr/bin/*; do \
		j=`basename $$i`; \
		if [ ! -f debian/tmp/usr/share/man/man1/$$j.1 -a \
		     ! -f debian/tmp/usr/share/man/man8/$$j.8 ]; then \
			dh_undocumented $$j.8; \
		fi; \
	done
	cp debian/gnats.el debian/tmp/etc/emacs/site-start.d/50gnats.el
	dh_installdocs CYGNUS -pgnats-user -Pdebian/tmp
	install -m 644 gnats/*.html \
		debian/tmp/usr/share/doc/$(package)-user/html/
	install -m 644 debian/dhelp \
		debian/tmp/usr/share/doc/$(package)-user/html/.dhelp
	mv debian/tmp/usr/share/doc/$(package)-user/html/gnats_toc.html \
		debian/tmp/usr/share/doc/$(package)-user/html/index.html
	dh_installchangelogs ChangeLog -pgnats-user -Pdebian/tmp
	dh_installdebconf -pgnats -Pdebian/tmp # really `gnats'
	set -e; for i in install remove; do \
		sed 's/|PACKAGE|/gnats-user/' debian/emacs.$$i \
		>debian/tmp/usr/lib/emacsen-common/packages/$$i/gnats-user; \
		chmod 755 debian/tmp/usr/lib/emacsen-common/packages/$$i/gnats-user;\
	done
	dh_compress
	dh_strip
	dh_shlibdeps -pgnats-user -Pdebian/tmp
	install -d debian/tmp/DEBIAN
	sed 's/^PACKAGE=$$/PACKAGE=$(package)-user/' debian/scripts/init \
		 >debian/tmp/DEBIAN/postinst
	set -e; for s in addinfo-user adduser-user addconfig-user \
		addemacs-user addfhs addhtml-user; do \
		sed -e 1,3d debian/scripts/$$s >>debian/tmp/DEBIAN/postinst; \
	done
	sed 's/^PACKAGE=$$/PACKAGE=$(package)-user/' debian/scripts/init \
		>debian/tmp/DEBIAN/prerm
	set -e; for s in rmconfig-user rmemacs-user rmfhs rminfo-user; do \
		sed -e 1,3d debian/scripts/$$s >>debian/tmp/DEBIAN/prerm; \
	done
	sed 's/^PACKAGE=$$/PACKAGE=$(package)/' debian/scripts/init \
		>debian/tmp/DEBIAN/postrm
	set -e; for s in rmdebconf; do \
		sed -e 1,3d debian/scripts/$$s >>debian/tmp/DEBIAN/postrm; \
	done
	chmod 755 debian/tmp/DEBIAN/*
	dpkg-gencontrol -is -ip -pgnats-user -Pdebian/tmp
	chmod -R u+w,go=rX debian/tmp
	dh_md5sums
	dpkg --build debian/tmp
	dpkg-name -o -s .. debian/tmp.deb

binary-tk:
	dh_testdir
	dh_testroot
	test -f stamp-build-tkgnats || $(MAKE) -f debian/rules build-tk
	-rm -rf debian/tmp
	dh_installdirs usr/share/doc/$(package)-tk/examples usr/share/man/man1
	$(MAKE) -C contrib/$(TKGNATS) prefix=$(PWD)/debian/tmp/usr \
		$(GTKDEFS) install
	cp contrib/$(TKGNATS)/tkgnats.1 debian/tmp/usr/share/man/man1
	dh_installdocs -pgnats-tk -Pdebian/tmp \
		contrib/$(TKGNATS)/FILES \
		contrib/$(TKGNATS)/README* \
		contrib/$(TKGNATS)/TECHNOTES \
		contrib/$(TKGNATS)/TO-DO \
		contrib/$(TKGNATS)/VERSION
	install -m 644 contrib/$(TKGNATS)/CONFIG* \
		debian/tmp/usr/share/doc/gnats-tk/examples/
	dh_installchangelogs contrib/$(TKGNATS)/CHANGES \
		-pgnats-tk -Pdebian/tmp
	dh_installmenu -pgnats-tk -Pdebian/tmp
	dh_compress
	install -d debian/tmp/DEBIAN
	sed 's/^PACKAGE=$$/PACKAGE=$(package)-tk/' debian/scripts/init \
		 >debian/tmp/DEBIAN/postinst
	set -e; for s in addfhs addmenu; do \
		sed -e 1,3d debian/scripts/$$s >>debian/tmp/DEBIAN/postinst; \
	done
	sed 's/^PACKAGE=$$/PACKAGE=$(package)-tk/' debian/scripts/init \
		>debian/tmp/DEBIAN/postrm
	set -e; for s in rmmenu; do \
		sed -e 1,3d debian/scripts/$$s >>debian/tmp/DEBIAN/postrm; \
	done
	sed 's/^PACKAGE=$$/PACKAGE=$(package)-tk/' debian/scripts/init \
		>debian/tmp/DEBIAN/prerm
	set -e; for s in rmfhs; do \
		sed -e 1,3d debian/scripts/$$s >>debian/tmp/DEBIAN/prerm; \
	done
	dpkg-gencontrol -is -ip -pgnats-tk -Pdebian/tmp
	chmod -R u+w,go=rX debian/tmp
	chmod 755 debian/tmp/DEBIAN/*
	dh_md5sums
	dpkg --build debian/tmp
	dpkg-name -o -s .. debian/tmp.deb

binary-www:
	dh_testdir
	dh_testroot
	test -f stamp-build-gnatsweb || $(MAKE) -f debian/rules build-www
	-rm -rf debian/tmp
	dh_installdirs usr/lib/cgi-bin
	install contrib/gnatsweb/gnatsweb.pl debian/tmp/usr/lib/cgi-bin/
	dh_installdocs -pgnatsweb -Pdebian/tmp \
		contrib/gnatsweb/INSTALL \
		contrib/gnatsweb/README \
		contrib/gnatsweb/TODO \
		contrib/gnatsweb/gnatsweb.html
	install -m 644 debian/README.gnatsweb \
		debian/tmp/usr/share/doc/gnatsweb/README.Debian
	dh_installchangelogs -pgnatsweb -Pdebian/tmp \
		contrib/gnatsweb/ChangeLog
	dh_compress
	install -d debian/tmp/DEBIAN
	sed 's/^PACKAGE=$$/PACKAGE=gnatsweb/' debian/scripts/init \
		 >debian/tmp/DEBIAN/postinst
	set -e; for s in addfhs; do \
		sed -e 1,3d debian/scripts/$$s >>debian/tmp/DEBIAN/postinst; \
	done
	sed 's/^PACKAGE=$$/PACKAGE=gnatsweb/' debian/scripts/init \
		>debian/tmp/DEBIAN/prerm
	set -e; for s in rmfhs; do \
		sed -e 1,3d debian/scripts/$$s >>debian/tmp/DEBIAN/prerm; \
	done
	dpkg-gencontrol -is -ip -pgnatsweb -Pdebian/tmp
	chmod -R u+w,go=rX debian/tmp
	chmod 755 debian/tmp/DEBIAN/*
	dh_md5sums
	dpkg --build debian/tmp
	dpkg-name -o -s .. debian/tmp.deb

binary-arch:
	$(MAKE) -f debian/rules binary-server
	$(MAKE) -f debian/rules binary-user
	@echo "All architecture-dependant binaries built!"

binary-indep:
	$(MAKE) -f debian/rules binary-tk
	$(MAKE) -f debian/rules binary-www
	@echo "All architecture-independant binaries built!"

binary:
	$(MAKE) -f debian/rules binary-arch
	$(MAKE) -f debian/rules binary-indep
	@echo "All binaries built!"


.PHONY: binary binary-arch binary-indep binary-server binary-user binary-tk \
	binary-www build-server build-user build-tk build-www clean \
	gnatsclean checkroot distfiles