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
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 >> $@ ; \
43 cat $(CURDIR)/cron.d/db-postgresql-2 >> $@ ; \
45 echo "copy $(CURDIR)/cron.d/$* to $@" ; \
46 cp $(CURDIR)/cron.d/$* $@ ; \
49 debian/$(PACKAGE)-%.dirs:
51 cp $(CURDIR)/dirs/$* $@
53 debian/$(PACKAGE)-%.install:
55 cp $(CURDIR)/install/$* $@
57 configure: configure-stamp debian/po/templates.pot
58 configure-stamp: remove-binary-files
63 debian/po/templates.pot: $(wildcard debian/*.templates) $(wildcard debian/*.templates.dsfh-in) $(wildcard debian/dsf-helper/*.templates)
66 build: configure-stamp build-stamp
70 # Build man pages from Docbook sources
71 /usr/bin/docbook-to-man debian/cvssh.sgml > cvssh.1
72 /usr/bin/docbook-to-man debian/gforge-config.sgml > gforge-config.1
74 # Uudecode binary files
75 sh $(CURDIR)/deb-specific/manage-uufiles.sh decode
77 # Build gettext *.mo files
78 utils/manage-translations.sh build
82 clean: remove-binary-files unpatch
85 rm -f build-stamp configure-stamp
86 rm -f $(CURDIR)/debian/*.cron.d
87 rm -f $(CURDIR)/debian/*.dirs
88 rm -f $(CURDIR)/debian/*.install
89 rm -f cvssh.1 gforge-config.1
93 perl $(CURDIR)/deb-specific/dsf-helper.pl --clean
101 # Generate conffiles *.cron.d *.dirs *.install
102 $(CURDIR)/debian/rules conffiles
106 # Preprocess files with DSF-Helper
107 perl $(CURDIR)/deb-specific/dsf-helper.pl
110 #dh_install --fail-missing -X.svn -X.arch-ids -X.bzr -X.cvsignore --sourcedir=$(CURDIR)
111 dh_install -X.svn -X.arch-ids -X.bzr -X.cvsignore --sourcedir=$(CURDIR)
114 ln -s database-pgsql.php $(CURDIR)/debian/$(PACKAGE)-common/usr/share/$(PACKAGE)/common/include/database.php
115 ln -s /usr/share/mediawiki/skins/$(PACKAGE)/loader.php $(CURDIR)/debian/$(PACKAGE)-plugin-mediawiki/etc/mediawiki-extensions/extensions-available/GforgeAuth.php
118 for i in $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) ; do find $$i -type f -exec chmod 644 {} \; ; done
119 -chmod 755 $(CURDIR)/debian/*/*/*/*/bin/* $(CURDIR)/debian/*/*/*/*/cronjobs/* \
120 $(CURDIR)/debian/*/bin/* $(CURDIR)/debian/*/usr/share/*/plugins/*/bin/* \
121 $(CURDIR)/debian/*/usr/share/*/plugins/*/cronjobs/*
123 chmod 755 $(CURDIR)/debian/$(PACKAGE)-db-postgresql/usr/share/*/db/*.php
124 chmod 644 $(CURDIR)/debian/$(PACKAGE)-db-postgresql/usr/share/gforge/cronjobs/*.inc
126 find $(CURDIR)/debian/$(PACKAGE)-web-apache2/usr/share/*/www/scm/viewvc -type f -exec chmod 0644 {} \;
127 grep -ril '^#!' $(CURDIR)/debian/$(PACKAGE)-web-apache2/usr/share/*/www/scm/viewvc | xargs chmod 0755
129 find $(CURDIR)/debian/$(PACKAGE)-common/usr/share/*/common/docman/engine/ -type f -name \*.php -not -name \*.inc.php -exec chmod 0755 {} \;
130 find $(CURDIR)/debian/$(PACKAGE)-common/usr/share/*/common/docman/engine/ -type f -name \*.sh -exec chmod 0755 {} \;
132 rm -f $(CURDIR)/debian/$(PACKAGE)-plugin-scm*/usr/share/*/plugins/scm*/*/README
133 chmod 755 $(CURDIR)/debian/$(PACKAGE)-plugin-scmcvs/usr/share/*/plugins/scmcvs/sbin/*
134 # remove windows files
135 rm -rf $(CURDIR)/debian/$(PACKAGE)-web-apache2/usr/share/*/www/scm/viewvc/windows
137 rm -f $(CURDIR)/debian/$(PACKAGE)-web-apache2/usr/share/*/www/themes/gforge/COPYING
139 # Remove Snoopy class from binary packages (provided by libphp-snoopy)
140 for i in $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) ; do find $$i -name Snoopy.class.php | xargs rm -rf ; done
142 # Remove potential SCM artefacts from binary packages
143 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
144 # Also remove uuencoded files
145 for i in $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) ; do find $$i -name \*.uu | xargs echo rm ; done
148 binary-indep: build install
162 dh_installchangelogs ChangeLog
175 binary-arch: build install
176 # (No architecture-dependent files for Gforge, doing nothing here)
178 binary: binary-indep binary-arch
179 .PHONY: build clean binary-indep binary-arch binary install configure remove-binary-files patch unpatch