File: rules

package info (click to toggle)
request-tracker3.6 3.6.1-4+etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 9,028 kB
  • ctags: 1,371
  • sloc: perl: 27,270; sh: 671; makefile: 327
file content (136 lines) | stat: -rwxr-xr-x 3,887 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

include /usr/share/dpatch/dpatch.make

VER=3.6

DEBIAN=$(CURDIR)/debian

RT3 = request-tracker$(VER)
CLIENTS = rt$(VER)-clients

RT3_PKG = $(DEBIAN)/$(RT3)
CLIENTS_PKG = $(DEBIAN)/$(CLIENTS)

RT3_BUGDIR = $(RT3_PKG)/usr/share/bug/$(RT3)
CLIENTS_BUGDIR = $(CLIENTS_PKG)/usr/share/bug/$(CLIENTS)

build: patch build-stamp

build-stamp: configure
	dh_testdir

	# Although there's a configure stage, we have no make step.

	chmod u+x ./configure
	./configure \
	  --enable-layout=Debian \
	  --with-rt-group=root \
	  --with-web-user=www-data \
	  --with-web-group=www-data \
	  --with-libs-group=root \
	  --with-db-type=Pg \
	  --with-db-dba=postgres \
	  --with-speedycgi=/usr/bin/speedy

	mkdir man
	perl debian/fix-whatis < debian/whatis

	touch build-stamp

clean: unpatch
	dh_testdir
	dh_testroot
	rm -f build-stamp 
	rm -f config.log config.status config.pld
	# Remove automatically generated files
	find . -name '*.in' -print | perl -ne 'chomp; s/\.in$$//; unlink'
	rm -rf man
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	$(MAKE) install DESTDIR=$(RT3_PKG)
	rm -rf $(RT3_PKG)/usr/share/$(RT3)/lib/t/
	rm -rf $(RT3_PKG)/usr/bin/mason_handler.svc
	rm -rf $(RT3_PKG)/usr/sbin/rt-test-dependencies

	for x in webmux.pl mason_handler.fcgi mason_handler.scgi; do \
	  mv $(RT3_PKG)/usr/bin/$$x $(RT3_PKG)/usr/share/$(RT3)/libexec/; \
	done
#	mv $(RT3_PKG)/usr/bin/standalone_httpd \
#           $(RT3_PKG)/usr/bin/rt-standalone_httpd
	rm $(RT3_PKG)/usr/bin/standalone_httpd
	dh_install


test:
	perl debian/check-deps

# Build architecture-dependent files here.
binary-arch: build install
# We have nothing to do by default.

# Build architecture-independent files here.
binary-indep: build install 
	dh_testdir
	dh_testroot
	dh_usrlocal
	dh_installchangelogs Changelog
	dh_installdocs
	dh_installexamples bin/mason_handler.svc bin/standalone_httpd
	dh_installman man/*
	dh_installlogcheck
	cd $(RT3_PKG) && perl $(DEBIAN)/move-alts $(VER) \
	    $(DEBIAN)/alts $(DEBIAN)/$(CLIENTS).alts
#	for x in usr/bin/rt-crontool /usr/sbin/rt-setup-database; do \
#	    mv $(RT3_PKG)/$$x $(RT3_PKG)/$$x-$(VER); \
#	done
#	for x in usr/bin/rt /usr/bin/rt-mailgate; do \
#	    mv $(RT3_PKG)/$$x $(CLIENTS_PKG)/$$x-$(VER); \
#	done
#	mv     $(RT3_PKG)/usr/share/man/man1/rt-mailgate.1 \
#	   $(CLIENTS_PKG)/usr/share/man/man1/rt-mailgate-3.0.1
	dh_movefiles --sourcedir=debian/$(RT3)
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	find $(RT3_PKG)/etc -type f -print0 | xargs -0 chmod a-x
	# Fix permissions for Mason files
	find $(RT3_PKG)/usr/share/$(RT3)/html -type f -print0 | xargs -0 --no-run-if-empty chmod 0644
	# Ensure that the stuff in libexec is executable by everyone
	find $(RT3_PKG)/usr/share/$(RT3)/libexec -type f -print0 | xargs -0 --no-run-if-empty chmod 0755
	# Remove any leftover .in files
	find $(RT3_PKG)/usr/share/$(RT3)/lib -type f -name '*.in' -print0 | xargs -0 --no-run-if-empty rm 
	# Fix permissions for Perl modules
	find $(RT3_PKG)/usr/share/$(RT3)/lib  -type f -print0 | xargs -0 --no-run-if-empty chmod 0644

	# This file has a password in it
	chmod 600 $(RT3_PKG)/etc/$(RT3)/RT_SiteConfig.pm
	install -m 644 debian/lintian-overrides $(RT3_PKG)/usr/share/lintian/overrides/$(RT3)

	chmod 755 $(RT3_PKG)/usr/share/bug/$(RT3)/script
	find $(RT3_PKG)/var/cache/$(RT3)/ -type d -print0 | xargs --null chown www-data:root
	find $(RT3_PKG)/var/cache/$(RT3)/ -type d -print0 | xargs --null chmod 2750

	chown www-data:www-data $(RT3_PKG)/var/log/$(RT3)/
	chmod 2755 $(RT3_PKG)/var/log/$(RT3)/
	dh_perl
	dh_usrlocal
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install test