File: rules

package info (click to toggle)
request-tracker4 4.4.3-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 42,872 kB
  • sloc: perl: 61,900; sh: 1,084; makefile: 467; php: 15
file content (207 lines) | stat: -rwxr-xr-x 7,655 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
#!/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

VER=4

DEBIAN=$(CURDIR)/debian

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

RT_PKG = $(DEBIAN)/$(RT)
CLIENTS_PKG = $(DEBIAN)/$(CLIENTS)

RT_BUGDIR = $(RT_PKG)/usr/share/bug/$(RT)
CLIENTS_BUGDIR = $(CLIENTS_PKG)/usr/share/bug/$(CLIENTS)
TPSRC=third-party-source/devel/third-party

build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp

configure: build-stamp
build-stamp: configure
	dh_testdir

	# Update translations
	debconf-updatepo

	# Keep aside automatically generated files shipped in the upstream tarball
	mkdir bak
	find . -name '*.in' -print | egrep -v '\.pc|\.\/debian' | sed -e 's/\.in$$//' | while read f; do mkdir -p bak/`dirname $$f`; mv -v $$f bak/$$f; done
	test -d $(TPSRC)

	dh_autoreconf

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	# The test suite needs a different configuration in place
	./configure \
	  --with-my-user-group \
	  --enable-layout=inplace \
	  --with-db-type=SQLite \
	  --enable-externalauth \
	  --with-s3 \
	  --with-dropbox \
	  --enable-developer

	-$(MAKE) testdeps
	mkdir -p var
	RT_TEST_PARALLEL_NUM=3 http_proxy= $(MAKE) test-parallel
	rm -rf var
endif

	# --enable-gpg and --enable-smime disabled for #654697
	# still usable when manually configured
	./configure \
	  --enable-layout=Debian \
	  --enable-graphviz \
	  --enable-gd \
	  --with-rt-group=root \
	  --with-web-user=www-data \
	  --with-web-group=www-data \
	  --with-web-handler=standalone,fastcgi,modperl2 \
	  --with-libs-group=root \
	  --with-db-type=Pg \
	  --with-db-dba=postgres \
	  --enable-externalauth \
	  --with-s3 \
	  --with-dropbox \

	-$(MAKE) testdeps
	mkdir man
	perl debian/scripts/fix-whatis < debian/whatis

	PERL5LIB=lib devel/tools/rt-static-docs --to html-docs

	touch build-stamp

clean:
	dh_testdir
	dh_testroot

	$(RM) -r man
	# Restore shipped generated files
	-find bak -type f -print | sed -e 's/^bak\///' | while read f; do mv bak/$$f $$f; done
	-rm -rf bak
	rm -rf html-docs
	rm -f config.status config.log config.pld bak t/tmp/ports t/data/gnupg/keyrings/random_seed
	dh_autoreconf_clean
	dh_clean build-stamp

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs

	$(MAKE) install DESTDIR=$(RT_PKG)
	rm -rf $(RT_PKG)/usr/share/$(RT)/lib/t/
	rm -rf $(RT_PKG)/usr/bin/mason_handler.svc
	rm -rf $(RT_PKG)/usr/sbin/rt-test-dependencies
	rm -rf $(RT_PKG)/usr/share/$(RT)/html/NoAuth/RichText/FCKeditor/license.txt
	# We will install a symlink to the separately-packaged javascript
	# libraries instead
	# (leave below as example as there'll be different ones to add back)
	#rm -rf $(RT_PKG)/usr/share/$(RT)/html/NoAuth/js/prototype
	# We will install symlinks to the fonts provided by the fonts-noto
	# and fonts-droid-fallback packages
	rm -rf $(RT_PKG)/usr/share/$(RT)/fonts

	for x in rt-server rt-server.fcgi standalone_httpd; do \
	  mv $(RT_PKG)/usr/sbin/$$x $(RT_PKG)/usr/share/$(RT)/libexec/; \
	done
	dh_install
		
test:
	perl debian/scripts/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
	dh_installdocs
	dh_installexamples sbin/standalone_httpd
	dh_installman man/*
	dh_installdebconf
	dh_installlogcheck
	cd $(RT_PKG) && perl $(DEBIAN)/scripts/move-alts $(VER) \
	    $(DEBIAN)/alts $(DEBIAN)/$(CLIENTS).alts
	dh_movefiles --sourcedir=debian/$(RT)
	dh_link
	dh_fixperms
	# Remove any leftover .in files
	find $(RT_PKG)/usr/share/$(RT)/lib -type f -name '*.in' -print0 | xargs -0 --no-run-if-empty rm 
	rm -f $(RT_PKG)/usr/share/$(RT)/etc/upgrade/*.in
	
	# Remove a test file
	rm -f .prove

	# This is generated by the maintainer scripts
	$(RM) $(RT_PKG)/usr/share/$(RT)/etc/RT_SiteConfig.pm

	install -m 644 debian/scripts/siteconfig.template $(RT_PKG)/usr/share/$(RT)/debian/
	install -m 644 debian/scripts/dbconfig.template $(RT_PKG)/usr/share/$(RT)/debian/
	install -m 755 debian/scripts/write-siteconfig $(RT_PKG)/usr/share/$(RT)/debian/

	install -m 644 debian/lintian-overrides $(RT_PKG)/usr/share/lintian/overrides/$(RT)

	# dh_link already made the pgsql and sqlite links
	install -m 755 debian/scripts/dbconfig-install $(RT_PKG)/usr/share/dbconfig-common/scripts/$(RT)/install/mysql
	install -m 755 debian/scripts/dbconfig-upgrade-4.0.4 $(RT_PKG)/usr/share/dbconfig-common/scripts/$(RT)/upgrade/mysql/4.0.4
	install -m 755 debian/scripts/dbconfig-upgrade-4.0.6-mysql $(RT_PKG)/usr/share/dbconfig-common/scripts/$(RT)/upgrade/mysql/4.0.6
	install -m 755 debian/scripts/dbconfig-upgrade-4.0.6 $(RT_PKG)/usr/share/dbconfig-common/scripts/$(RT)/upgrade/pgsql/4.0.6
	install -m 755 debian/scripts/dbconfig-upgrade-4.0.10 $(RT_PKG)/usr/share/dbconfig-common/scripts/$(RT)/upgrade/mysql/4.0.10
	install -m 755 debian/scripts/dbconfig-upgrade-4.0.12 $(RT_PKG)/usr/share/dbconfig-common/scripts/$(RT)/upgrade/mysql/4.0.12
	# No sqlite upgrade file provided for this
	install -m 755 debian/scripts/dbconfig-upgrade-4.0.12-2-mysql $(RT_PKG)/usr/share/dbconfig-common/scripts/$(RT)/upgrade/mysql/4.0.12-2
	install -m 755 debian/scripts/dbconfig-upgrade-4.0.12-2-pgsql $(RT_PKG)/usr/share/dbconfig-common/scripts/$(RT)/upgrade/pgsql/4.0.12-2
	install -m 755 debian/scripts/dbconfig-upgrade-4.0.19-mysql $(RT_PKG)/usr/share/dbconfig-common/scripts/$(RT)/upgrade/mysql/4.0.19
	install -m 755 debian/scripts/dbconfig-upgrade-4.0.19 $(RT_PKG)/usr/share/dbconfig-common/scripts/$(RT)/upgrade/pgsql/4.0.19
	install -m 755 debian/scripts/dbconfig-upgrade-4.2.3 $(RT_PKG)/usr/share/dbconfig-common/scripts/$(RT)/upgrade/mysql/4.2.3
	install -m 755 debian/scripts/dbconfig-upgrade-4.2.4 $(RT_PKG)/usr/share/dbconfig-common/scripts/$(RT)/upgrade/mysql/4.2.4
	install -m 755 debian/scripts/dbconfig-upgrade-4.2.6 $(RT_PKG)/usr/share/dbconfig-common/scripts/$(RT)/upgrade/mysql/4.2.6
	install -m 755 debian/scripts/dbconfig-upgrade-4.2.7 $(RT_PKG)/usr/share/dbconfig-common/scripts/$(RT)/upgrade/mysql/4.2.7
	install -m 755 debian/scripts/dbconfig-upgrade-4.2.10 $(RT_PKG)/usr/share/dbconfig-common/scripts/$(RT)/upgrade/mysql/4.2.10
	install -m 755 debian/scripts/dbconfig-upgrade-4.2.11 $(RT_PKG)/usr/share/dbconfig-common/scripts/$(RT)/upgrade/mysql/4.2.11
	install -m 755 debian/scripts/dbconfig-upgrade-4.4.1 $(RT_PKG)/usr/share/dbconfig-common/scripts/$(RT)/upgrade/mysql/4.4.1
	install -m 755 debian/scripts/dbconfig-upgrade-4.4.2 $(RT_PKG)/usr/share/dbconfig-common/scripts/$(RT)/upgrade/mysql/4.4.2

	chmod 755 $(RT_PKG)/usr/share/bug/$(RT)/script

	install -d $(RT_PKG)/var/lib/$(RT)/data
	find $(RT_PKG)/var/cache/$(RT)/ -type d -print0 | xargs --null chown www-data:root
	find $(RT_PKG)/var/lib/$(RT)/ -type d -print0 | xargs --null chown www-data:root
	find $(RT_PKG)/var/cache/$(RT)/ -type d -print0 | xargs --null chmod 2750
	find $(RT_PKG)/var/lib/$(RT)/ -type d -print0 | xargs --null chmod 2750

	chown www-data:www-data $(RT_PKG)/var/log/$(RT)/
	# special perms for gpg
	install -d $(RT_PKG)/var/lib/$(RT)/data/gpg
	chown www-data:www-data $(RT_PKG)/var/lib/$(RT)/data/gpg
	chmod 700 $(RT_PKG)/var/lib/$(RT)/data/gpg

	chmod 2755 $(RT_PKG)/var/log/$(RT)/
	dh_compress
	dh_perl
	# NB - we don't enable this by default, in common with the init script
	#dh_systemd_enable
	dh_installinit
	dh_systemd_start
	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