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
|
#!/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
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)
# Although there's a configure stage, we have no make step.
chmod u+x ./configure
./configure \
--enable-layout=Debian \
--enable-graphviz \
--enable-gd \
--enable-gpg \
--with-rt-group=root \
--with-web-user=www-data \
--with-web-group=www-data \
--with-web-handler=fastcgi,modperl2 \
--with-libs-group=root \
--with-db-type=Pg \
--with-db-dba=postgres
mkdir man
perl debian/scripts/fix-whatis < debian/whatis
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 -f config.status config.log config.pld bak
dh_clean build-stamp
install: build
dh_testdir
dh_testroot
dh_clean -k
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
# depends on packages not yet in Debian (libstarlet-perl and deps)
# if it is being installed again, it should be moved into libexec below
# and no longer installed as an example
rm -rf $(RT_PKG)/usr/sbin/standalone_httpd
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 ttf-droid
# package
rm -rf $(RT_PKG)/usr/share/$(RT)/fonts
for x in rt-server rt-server.fcgi; 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
find $(RT_PKG)/usr/share/$(RT)/etc -type f -print0 | xargs -0 chmod a-x
# Fix permissions for Mason files
find $(RT_PKG)/usr/share/$(RT)/html -type f -print0 | xargs -0 --no-run-if-empty chmod 0644
# Ensure that the stuff in libexec is executable by everyone
find $(RT_PKG)/usr/share/$(RT)/libexec -type f -print0 | xargs -0 --no-run-if-empty chmod 0755
# Remove any leftover .in files
find $(RT_PKG)/usr/share/$(RT)/lib -type f -name '*.in' -print0 | xargs -0 --no-run-if-empty rm
# Fix permissions for Perl modules
find $(RT_PKG)/usr/share/$(RT)/lib -type f -print0 | xargs -0 --no-run-if-empty chmod 0644
chmod +x $(RT_PKG)/usr/share/$(RT)/etc/upgrade/3.8-branded-queues-extension
chmod +x $(RT_PKG)/usr/share/$(RT)/etc/upgrade/3.8-ical-extension
chmod +x $(RT_PKG)/usr/share/$(RT)/etc/upgrade/upgrade-mysql-schema.pl
chmod +x $(RT_PKG)/usr/share/$(RT)/etc/upgrade/shrink_cgm_table.pl
chmod +x $(RT_PKG)/usr/share/$(RT)/etc/upgrade/split-out-cf-categories
chmod +x $(RT_PKG)/usr/share/$(RT)/etc/upgrade/generate-rtaddressregexp
chmod +x $(RT_PKG)/usr/share/$(RT)/etc/upgrade/shrink_transactions_table.pl
chmod +x $(RT_PKG)/usr/share/$(RT)/etc/upgrade/upgrade-articles
chmod +x $(RT_PKG)/usr/share/$(RT)/etc/upgrade/vulnerable-passwords
chmod +x $(RT_PKG)/usr/share/$(RT)/etc/upgrade/sanity-check-stylesheets.pl
rm -f $(RT_PKG)/usr/share/$(RT)/etc/upgrade/*.in
# 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 755 debian/scripts/update-rt-siteconfig $(RT_PKG)/usr/sbin/update-rt-siteconfig-$(VER)
install -m 644 debian/scripts/update-rt-siteconfig.man $(RT_PKG)/usr/share/man/man8/update-rt-siteconfig-$(VER).8
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
# No sqlite upgrade file provided for this
install -m 755 debian/scripts/dbconfig-upgrade-4.0.7-5+deb7u2-mysql $(RT_PKG)/usr/share/dbconfig-common/scripts/$(RT)/upgrade/mysql/4.0.7-5+deb7u2
install -m 755 debian/scripts/dbconfig-upgrade-4.0.7-5+deb7u2-pgsql $(RT_PKG)/usr/share/dbconfig-common/scripts/$(RT)/upgrade/pgsql/4.0.7-5+deb7u2
chmod 755 $(RT_PKG)/usr/share/bug/$(RT)/script
mkdir -p $(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
mkdir $(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
dh_installinit
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
|