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 2008 by Roland Mas and Christian Bayle for the Gforge package
6 # Copyright 2008 to 2009 by Roland Mas and Christian Bayle for the FusionForge package
8 # Uncomment this to turn on verbose mode.
11 PACKAGE=$(shell dh_listpackages | head -1)
13 include /usr/share/dpatch/dpatch.make
15 CRONFILESLIST=$(patsubst packaging/cron.d/%,debian/$(PACKAGE)-%.cron.d,$(wildcard packaging/cron.d/[a-z]*))
16 DIRSFILESLIST=$(patsubst packaging/dirs/%,debian/$(PACKAGE)-%.dirs,$(wildcard packaging/dirs/[a-z]*))
17 INSTALLFILESLIST=$(patsubst packaging/install/%,debian/$(PACKAGE)-%.install,$(wildcard packaging/install/[a-z]*))
18 DOCSFILESLIST=$(patsubst packaging/docs/pkgname%,debian/$(PACKAGE)%.docs,$(wildcard packaging/docs/pkgname*))
19 POFILES=$(patsubst debian/dsf-po/%,debian/po/%,$(wildcard debian/dsf-po/*) debian/po/POTFILES.in)
25 @echo $(CRONFILESLIST)
26 @echo $(DIRSFILESLIST)
27 @echo $(INSTALLFILESLIST)
29 @echo $(DOCSFILESLIST)
32 sh $(CURDIR)/deb-specific/manage-uufiles.sh clean
34 cronfiles: $(CRONFILESLIST)
36 dirsfiles: $(DIRSFILESLIST)
38 installfiles: $(INSTALLFILESLIST)
40 docsfiles: $(DOCSFILESLIST)
42 conffiles: cronfiles dirsfiles installfiles gencontrol docsfiles
44 debian/$(PACKAGE)-%.cron.d:
46 (cat $(CURDIR)/packaging/cron.d/00phpcron ; sed -e 's/\$$FFUSER/$(PACKAGE)/g' $(CURDIR)/packaging/cron.d/$*) > $@
48 debian/$(PACKAGE)-%.dirs:
50 cp $(CURDIR)/packaging/dirs/$* $@
52 debian/$(PACKAGE)-%.install:
54 cp $(CURDIR)/packaging/install/$* $@
58 cp $(CURDIR)/packaging/docs/$(patsubst $(PACKAGE)%,pkgname%,$*) $@
61 ls $(CURDIR)/packaging/control/[0-9][0-9][0-9]* | grep -v shortdesc | while read file ; do cat $${file}; if [ -f $${file}.shortdesc ] ; then cat $(CURDIR)/packaging/control/AAAdesc; echo ' .'; cat $${file}.shortdesc; fi; echo ''; done | sed 's/@PACKAGE@/$(PACKAGE)/g' > $(CURDIR)/debian/control
63 configure: configure-stamp debian/po/templates.pot
64 configure-stamp: remove-binary-files
69 #$(foreach PO,$(wildcard debian/dsf-po/*.po), cp $(PO) debian/po ; )
71 debian/po/templates.pot: $(POFILES) $(wildcard debian/dsf-in/*.templates.dsfh-in) $(wildcard debian/dsf-helper/*.templates)
72 perl $(CURDIR)/deb-specific/dsf-helper.pl
76 cat $(patsubst debian/po/%,debian/dsf-po/%,$@) | sed 's/@PACKAGE@/$(PACKAGE)/g' | sed 's/@FORGENAME@/$(FORGENAME)/g' > $@
83 build: configure-stamp build-stamp
87 # Build man pages from Docbook sources
88 cat debian/dsf-in/config.sgml | sed 's/@PACKAGE@/$(PACKAGE)/g' | sed 's/@FORGENAME@/$(FORGENAME)/g' > debian/$(PACKAGE)-config.sgml
89 cat debian/dsf-in/common.manpages | sed 's/@PACKAGE@/$(PACKAGE)/g' | sed 's/@FORGENAME@/$(FORGENAME)/g' > debian/$(PACKAGE)-common.manpages
90 /usr/bin/docbook-to-man debian/cvssh.sgml > cvssh.1
91 /usr/bin/docbook-to-man debian/$(PACKAGE)-config.sgml > $(PACKAGE)-config.1
93 # Uudecode binary files
94 sh $(CURDIR)/deb-specific/manage-uufiles.sh decode
96 # Build gettext *.mo files
97 utils/manage-translations.sh build
101 clean: remove-binary-files unpatch cleanpo
104 rm -f build-stamp configure-stamp
105 rm -f $(CURDIR)/debian/*.cron.d
106 rm -f $(CURDIR)/debian/*.dirs
107 rm -f $(CURDIR)/debian/*.install
108 rm -f $(CURDIR)/debian/*.docs
109 rm -f $(CURDIR)/debian/$(PACKAGE)-config.sgml
110 rm -f $(CURDIR)/debian/$(PACKAGE)-common.manpages
111 rm -f cvssh.1 $(PACKAGE)-config.1
115 perl $(CURDIR)/deb-specific/dsf-helper.pl --clean
123 # Generate conffiles *.cron.d *.dirs *.install control
124 $(CURDIR)/debian/rules conffiles
128 # Preprocess files with DSF-Helper
129 perl $(CURDIR)/deb-specific/dsf-helper.pl
132 #dh_install --fail-missing -X.svn -X.arch-ids -X.bzr -X.cvsignore --sourcedir=$(CURDIR)
133 dh_install -X.svn -X.arch-ids -X.bzr -X.cvsignore --sourcedir=$(CURDIR)
136 ln -s database-pgsql.php $(CURDIR)/debian/$(PACKAGE)-common/usr/share/$(PACKAGE)/common/include/database.php
137 ln -s /usr/share/mediawiki/skins/$(PACKAGE)/loader.php $(CURDIR)/debian/$(PACKAGE)-plugin-mediawiki/etc/mediawiki-extensions/extensions-available/GforgeAuth.php
140 for i in $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) ; do find $$i -type f -exec chmod 644 {} \; ; done
141 -chmod 755 $(CURDIR)/debian/*/*/*/*/bin/* $(CURDIR)/debian/*/*/*/*/cronjobs/* \
142 $(CURDIR)/debian/*/bin/* $(CURDIR)/debian/*/usr/share/*/plugins/*/bin/* \
143 $(CURDIR)/debian/*/usr/share/*/plugins/*/cronjobs/*
145 chmod 755 $(CURDIR)/debian/$(PACKAGE)-db-postgresql/usr/share/*/db/*.php
146 chmod 644 $(CURDIR)/debian/$(PACKAGE)-db-postgresql/usr/share/$(PACKAGE)/cronjobs/*.inc
149 find $(CURDIR)/debian/$(PACKAGE)-web-apache2/usr/share/*/www/scm/viewvc -type f -exec chmod 0644 {} \;
150 grep -ril '^#!' $(CURDIR)/debian/$(PACKAGE)-web-apache2/usr/share/*/www/scm/viewvc | xargs chmod 0755
152 find $(CURDIR)/debian/$(PACKAGE)-common/usr/share/*/common/docman/engine/ -type f -name \*.php -not -name \*.inc.php -exec chmod 0755 {} \;
153 find $(CURDIR)/debian/$(PACKAGE)-common/usr/share/*/common/docman/engine/ -type f -name \*.sh -exec chmod 0755 {} \;
155 rm -f $(CURDIR)/debian/$(PACKAGE)-plugin-scm*/usr/share/*/plugins/scm*/*/README
156 chmod 755 $(CURDIR)/debian/$(PACKAGE)-plugin-scmcvs/usr/share/*/plugins/scmcvs/sbin/*
157 # remove windows files
158 rm -rf $(CURDIR)/debian/$(PACKAGE)-web-apache2/usr/share/*/www/scm/viewvc/windows
160 rm -f $(CURDIR)/debian/$(PACKAGE)-web-apache2/usr/share/*/www/themes/$(PACKAGE)/COPYING
162 # Remove Snoopy class from binary packages (provided by libphp-snoopy)
163 for i in $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) ; do find $$i -name Snoopy.class.php | xargs rm -rf ; done
165 # Remove potential SCM artefacts from binary packages
166 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
167 # Also remove uuencoded files
168 for i in $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) ; do find $$i -name \*.uu | xargs echo rm ; done
171 binary-indep: build install
185 dh_installchangelogs ChangeLog
198 binary-arch: build install
199 # (No architecture-dependent files for Gforge, doing nothing here)
201 binary: binary-indep binary-arch
202 .PHONY: build clean binary-indep binary-arch binary install configure remove-binary-files patch unpatch