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.
12 include /usr/share/dpatch/dpatch.make
14 CRONFILESLIST=$(patsubst packaging/cron.d/%,debian/$(PACKAGE)-%.cron.d,$(wildcard packaging/cron.d/[a-z]*))
15 DIRSFILESLIST=$(patsubst packaging/dirs/%,debian/$(PACKAGE)-%.dirs,$(wildcard packaging/dirs/[a-z]*))
16 INSTALLFILESLIST=$(patsubst packaging/install/%,debian/$(PACKAGE)-%.install,$(wildcard packaging/install/[a-z]*))
17 DOCSFILESLIST=$(patsubst packaging/docs/pkgname%,debian/$(PACKAGE)%.docs,$(wildcard packaging/docs/pkgname*))
20 @echo $(CRONFILESLIST)
21 @echo $(DIRSFILESLIST)
22 @echo $(INSTALLFILESLIST)
24 @echo $(DOCSFILESLIST)
27 sh $(CURDIR)/deb-specific/manage-uufiles.sh clean
29 cronfiles: $(CRONFILESLIST)
31 dirsfiles: $(DIRSFILESLIST)
33 installfiles: $(INSTALLFILESLIST)
35 docsfiles: $(DOCSFILESLIST)
37 conffiles: cronfiles dirsfiles installfiles gencontrol docsfiles
39 debian/$(PACKAGE)-%.cron.d:
41 (cat $(CURDIR)/packaging/cron.d/00phpcron ; sed -e 's/\$$FFUSER/$(PACKAGE)/g' $(CURDIR)/packaging/cron.d/$*) > $@
43 debian/$(PACKAGE)-%.dirs:
45 cp $(CURDIR)/packaging/dirs/$* $@
47 debian/$(PACKAGE)-%.install:
49 cp $(CURDIR)/packaging/install/$* $@
53 cp $(CURDIR)/packaging/docs/$(patsubst $(PACKAGE)%,pkgname%,$*) $@
56 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
58 configure: configure-stamp debian/po/templates.pot
59 configure-stamp: remove-binary-files
64 debian/po/templates.pot: $(wildcard debian/*.templates) $(wildcard debian/*.templates.dsfh-in) $(wildcard debian/dsf-helper/*.templates)
67 build: configure-stamp build-stamp
71 # Build man pages from Docbook sources
72 cat debian/dsf-in/config.sgml | sed 's/pkgname/$(PACKAGE)/g' > debian/$(PACKAGE)-config.sgml
73 cat debian/dsf-in/common.manpages | sed 's/pkgname/$(PACKAGE)/g' > $(PACKAGE)-common.manpages
74 /usr/bin/docbook-to-man debian/cvssh.sgml > cvssh.1
75 /usr/bin/docbook-to-man debian/$(PACKAGE)-config.sgml > $(PACKAGE)-config.1
77 # Uudecode binary files
78 sh $(CURDIR)/deb-specific/manage-uufiles.sh decode
80 # Build gettext *.mo files
81 utils/manage-translations.sh build
85 clean: remove-binary-files unpatch
88 rm -f build-stamp configure-stamp
89 rm -f $(CURDIR)/debian/*.cron.d
90 rm -f $(CURDIR)/debian/*.dirs
91 rm -f $(CURDIR)/debian/*.install
92 rm -f $(CURDIR)/debian/*.docs
93 rm -f $(CURDIR)/debian/$(PACKAGE)-config.sgml
94 rm -f $(CURDIR)/debian/$(PACKAGE)-common.manpages
95 rm -f cvssh.1 $(PACKAGE)-config.1
99 perl $(CURDIR)/deb-specific/dsf-helper.pl --clean
107 # Generate conffiles *.cron.d *.dirs *.install control
108 $(CURDIR)/debian/rules conffiles
112 # Preprocess files with DSF-Helper
113 perl $(CURDIR)/deb-specific/dsf-helper.pl
116 #dh_install --fail-missing -X.svn -X.arch-ids -X.bzr -X.cvsignore --sourcedir=$(CURDIR)
117 dh_install -X.svn -X.arch-ids -X.bzr -X.cvsignore --sourcedir=$(CURDIR)
120 ln -s database-pgsql.php $(CURDIR)/debian/$(PACKAGE)-common/usr/share/$(PACKAGE)/common/include/database.php
121 ln -s /usr/share/mediawiki/skins/$(PACKAGE)/loader.php $(CURDIR)/debian/$(PACKAGE)-plugin-mediawiki/etc/mediawiki-extensions/extensions-available/GforgeAuth.php
124 for i in $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) ; do find $$i -type f -exec chmod 644 {} \; ; done
125 -chmod 755 $(CURDIR)/debian/*/*/*/*/bin/* $(CURDIR)/debian/*/*/*/*/cronjobs/* \
126 $(CURDIR)/debian/*/bin/* $(CURDIR)/debian/*/usr/share/*/plugins/*/bin/* \
127 $(CURDIR)/debian/*/usr/share/*/plugins/*/cronjobs/*
129 chmod 755 $(CURDIR)/debian/$(PACKAGE)-db-postgresql/usr/share/*/db/*.php
130 chmod 644 $(CURDIR)/debian/$(PACKAGE)-db-postgresql/usr/share/$(PACKAGE)/cronjobs/*.inc
133 find $(CURDIR)/debian/$(PACKAGE)-web-apache2/usr/share/*/www/scm/viewvc -type f -exec chmod 0644 {} \;
134 grep -ril '^#!' $(CURDIR)/debian/$(PACKAGE)-web-apache2/usr/share/*/www/scm/viewvc | xargs chmod 0755
136 find $(CURDIR)/debian/$(PACKAGE)-common/usr/share/*/common/docman/engine/ -type f -name \*.php -not -name \*.inc.php -exec chmod 0755 {} \;
137 find $(CURDIR)/debian/$(PACKAGE)-common/usr/share/*/common/docman/engine/ -type f -name \*.sh -exec chmod 0755 {} \;
139 rm -f $(CURDIR)/debian/$(PACKAGE)-plugin-scm*/usr/share/*/plugins/scm*/*/README
140 chmod 755 $(CURDIR)/debian/$(PACKAGE)-plugin-scmcvs/usr/share/*/plugins/scmcvs/sbin/*
141 # remove windows files
142 rm -rf $(CURDIR)/debian/$(PACKAGE)-web-apache2/usr/share/*/www/scm/viewvc/windows
144 rm -f $(CURDIR)/debian/$(PACKAGE)-web-apache2/usr/share/*/www/themes/$(PACKAGE)/COPYING
146 # Remove Snoopy class from binary packages (provided by libphp-snoopy)
147 for i in $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) ; do find $$i -name Snoopy.class.php | xargs rm -rf ; done
149 # Remove potential SCM artefacts from binary packages
150 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
151 # Also remove uuencoded files
152 for i in $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) ; do find $$i -name \*.uu | xargs echo rm ; done
155 binary-indep: build install
169 dh_installchangelogs ChangeLog
182 binary-arch: build install
183 # (No architecture-dependent files for Gforge, doing nothing here)
185 binary: binary-indep binary-arch
186 .PHONY: build clean binary-indep binary-arch binary install configure remove-binary-files patch unpatch