2 # debian/rules that uses debhelper.
3 # GNU copyright 1997 to 1999 by Joey Hess (sample file)
4 # Copyright 2000 to 2002 by Roland Mas and Christian Bayle for the Sourceforge package
5 # Copyright 2002 to 2003 by Roland Mas and Christian Bayle for the Gforge package
7 # Uncomment this to turn on verbose mode.
11 include /usr/share/dpatch/dpatch.make
13 # This one should be declared like other when it will be unified with rpm
14 CRONFILESLIST=debian/$(PACKAGE)-lists-mailman.cron.d debian/$(PACKAGE)-web-apache2.cron.d debian/$(PACKAGE)-db-postgresql.cron.d debian/$(PACKAGE)-dns-bind9.cron.d debian/$(PACKAGE)-plugin-scmcvs.cron.d debian/$(PACKAGE)-ftp-proftpd.cron.d debian/$(PACKAGE)-shell-postgresql.cron.d debian/$(PACKAGE)-plugin-scmsvn.cron.d
15 DIRSFILESLIST=$(patsubst dirs/%,debian/$(PACKAGE)-%.dirs,$(wildcard dirs/[a-z]*))
16 INSTALLFILESLIST=$(patsubst install/%,debian/$(PACKAGE)-%.install,$(wildcard install/[a-z]*))
19 @echo $(CRONFILESLIST)
20 @echo $(DIRSFILESLIST)
21 @echo $(INSTALLFILESLIST)
24 # Remove files in contrib, especially binaries that break dpkg-source
25 # find contrib/ -name CVS -prune -not -name CVS -or -type f | xargs rm -f
27 # rm -f www/themes/gforge/images/es_*
28 sh $(CURDIR)/deb-specific/manage-uufiles.sh clean
30 cronfiles: $(CRONFILESLIST)
32 dirsfiles: $(DIRSFILESLIST)
34 installfiles: $(INSTALLFILESLIST)
36 conffiles: cronfiles dirsfiles installfiles gencontrol
38 debian/$(PACKAGE)-%.cron.d:
40 @if [ "$@" = "debian/$(PACKAGE)-db-postgresql.cron.d" ] ; then \
41 cat $(CURDIR)/cron.d/00phpcron > $@ ; \
42 cat $(CURDIR)/cron.d/db-postgresql >> $@ ; \
44 echo "copy $(CURDIR)/cron.d/$* to $@" ; \
45 cp $(CURDIR)/cron.d/$* $@ ; \
48 debian/$(PACKAGE)-%.dirs:
50 cp $(CURDIR)/dirs/$* $@
52 debian/$(PACKAGE)-%.install:
54 cp $(CURDIR)/install/$* $@
57 ls $(CURDIR)/control/[0-9][0-9][0-9]* | grep -v shortdesc | while read file ; do cat $${file}; if [ -f $${file}.shortdesc ] ; then cat $(CURDIR)/control/AAAdesc; echo ' .'; cat $${file}.shortdesc; fi; echo ''; done | sed 's/@PACKAGE@/$(PACKAGE)/g' > $(CURDIR)/debian/control
59 configure: configure-stamp debian/po/templates.pot
60 configure-stamp: remove-binary-files
65 debian/po/templates.pot: $(wildcard debian/*.templates) $(wildcard debian/*.templates.dsfh-in) $(wildcard debian/dsf-helper/*.templates)
68 build: configure-stamp build-stamp
72 # Build man pages from Docbook sources
73 /usr/bin/docbook-to-man debian/cvssh.sgml > cvssh.1
74 /usr/bin/docbook-to-man debian/gforge-config.sgml > gforge-config.1
76 # Uudecode binary files
77 sh $(CURDIR)/deb-specific/manage-uufiles.sh decode
79 # Build gettext *.mo files
80 utils/manage-translations.sh build
84 clean: remove-binary-files unpatch
87 rm -f build-stamp configure-stamp
88 rm -f $(CURDIR)/debian/*.cron.d
89 rm -f $(CURDIR)/debian/*.dirs
90 rm -f $(CURDIR)/debian/*.install
91 rm -f cvssh.1 gforge-config.1
95 perl $(CURDIR)/deb-specific/dsf-helper.pl --clean
103 # Generate conffiles *.cron.d *.dirs *.install
104 $(CURDIR)/debian/rules conffiles
108 # Preprocess files with DSF-Helper
109 perl $(CURDIR)/deb-specific/dsf-helper.pl
112 #dh_install --fail-missing -X.svn -X.arch-ids -X.bzr -X.cvsignore --sourcedir=$(CURDIR)
113 dh_install -X.svn -X.arch-ids -X.bzr -X.cvsignore --sourcedir=$(CURDIR)
116 ln -s database-pgsql.php $(CURDIR)/debian/$(PACKAGE)-common/usr/share/$(PACKAGE)/common/include/database.php
117 ln -s /usr/share/mediawiki/skins/$(PACKAGE)/loader.php $(CURDIR)/debian/$(PACKAGE)-plugin-mediawiki/etc/mediawiki-extensions/extensions-available/GforgeAuth.php
120 for i in $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) ; do find $$i -type f -exec chmod 644 {} \; ; done
121 -chmod 755 $(CURDIR)/debian/*/*/*/*/bin/* $(CURDIR)/debian/*/*/*/*/cronjobs/* \
122 $(CURDIR)/debian/*/bin/* $(CURDIR)/debian/*/usr/share/*/plugins/*/bin/* \
123 $(CURDIR)/debian/*/usr/share/*/plugins/*/cronjobs/*
125 chmod 755 $(CURDIR)/debian/$(PACKAGE)-db-postgresql/usr/share/*/db/*.php
126 chmod 644 $(CURDIR)/debian/$(PACKAGE)-db-postgresql/usr/share/gforge/cronjobs/*.inc
128 # gforge-plugin-extratabs
129 cp -r plugins/extratabs/bin/* $(CURDIR)/debian/gforge-plugin-extratabs/usr/lib/gforge/plugins/extratabs/bin/
130 cp -r plugins/extratabs/common/* $(CURDIR)/debian/gforge-plugin-extratabs/usr/share/gforge/plugins/extratabs/common/
131 cp -r plugins/extratabs/db/* $(CURDIR)/debian/gforge-plugin-extratabs/usr/lib/gforge/plugins/extratabs/lib/
132 cp -r plugins/extratabs/www/* $(CURDIR)/debian/gforge-plugin-extratabs/usr/share/gforge/www/plugins/extratabs/
135 find $(CURDIR)/debian/$(PACKAGE)-web-apache2/usr/share/*/www/scm/viewvc -type f -exec chmod 0644 {} \;
136 grep -ril '^#!' $(CURDIR)/debian/$(PACKAGE)-web-apache2/usr/share/*/www/scm/viewvc | xargs chmod 0755
138 find $(CURDIR)/debian/$(PACKAGE)-common/usr/share/*/common/docman/engine/ -type f -name \*.php -not -name \*.inc.php -exec chmod 0755 {} \;
139 find $(CURDIR)/debian/$(PACKAGE)-common/usr/share/*/common/docman/engine/ -type f -name \*.sh -exec chmod 0755 {} \;
141 rm -f $(CURDIR)/debian/$(PACKAGE)-plugin-scm*/usr/share/*/plugins/scm*/*/README
142 chmod 755 $(CURDIR)/debian/$(PACKAGE)-plugin-scmcvs/usr/share/*/plugins/scmcvs/sbin/*
143 # remove windows files
144 rm -rf $(CURDIR)/debian/$(PACKAGE)-web-apache2/usr/share/*/www/scm/viewvc/windows
146 rm -f $(CURDIR)/debian/$(PACKAGE)-web-apache2/usr/share/*/www/themes/gforge/COPYING
148 # Remove Snoopy class from binary packages (provided by libphp-snoopy)
149 for i in $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) ; do find $$i -name Snoopy.class.php | xargs rm -rf ; done
151 # Remove potential SCM artefacts from binary packages
152 for i in $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) ; do find $$i -name .svn -or -name {arch} -or -name .arch-ids -or -name .bzr -or -name .cvsignore | xargs rm -rf ; done
153 # Also remove uuencoded files
154 for i in $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) ; do find $$i -name \*.uu | xargs echo rm ; done
157 binary-indep: build install
171 dh_installchangelogs ChangeLog
184 binary-arch: build install
185 # (No architecture-dependent files for Gforge, doing nothing here)
187 binary: binary-indep binary-arch
188 .PHONY: build clean binary-indep binary-arch binary install configure remove-binary-files patch unpatch