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 2010 by Roland Mas and Christian Bayle for the FusionForge package
10 SRCPACKAGE=fusionforge
13 SED_REPLACE=sed -e 's/@PACKAGE@/$(PACKAGE)/g' -e 's/@SRCPACKAGE@/$(SRCPACKAGE)/g' -e 's/@OLDPACKAGE@/$(OLDPACKAGE)/g' -e 's/@FORGENAME@/$(FORGENAME)/g'
18 include /usr/share/dpatch/dpatch.make
20 PPOSTINST=$(patsubst plugins/%/NAME,debian/$(PACKAGE)-plugin-%.postinst,$(wildcard plugins/*/NAME))
21 PPRERM=$(patsubst plugins/%/NAME,debian/$(PACKAGE)-plugin-%.prerm,$(wildcard plugins/*/NAME))
23 CRONDFILES=$(patsubst packaging/cron.d/%,debian/$(OLDPACKAGE)-%.cron.d,$(wildcard packaging/cron.d/[a-z]*))
24 PCRONDFILES=$(patsubst %,debian/$(PACKAGE)-%.cron.d,$(shell ls plugins/*/packaging/cron.d/[a-z]* | sed 's:.*/\(.[^/]*\):\1:'))
26 DIRSFILES=$(patsubst packaging/dirs/%,debian/$(OLDPACKAGE)-%.dirs,$(wildcard packaging/dirs/[a-z]*))
27 PDIRSFILES=$(patsubst %,debian/$(PACKAGE)-%.dirs,$(shell ls plugins/*/packaging/dirs/[a-z]* | sed 's:.*/\(.[^/]*\):\1:'))
29 LINKSFILES=$(patsubst packaging/links/%,debian/$(OLDPACKAGE)-%.links,$(wildcard packaging/links/[a-z]*))
30 PLINKSFILES=$(patsubst %,debian/$(PACKAGE)-%.links,$(shell ls plugins/*/packaging/links/[a-z]* | sed 's:.*/\(.[^/]*\):\1:'))
32 INSTALLFILES=$(patsubst packaging/install/%,debian/$(OLDPACKAGE)-%.install,$(wildcard packaging/install/[a-z]*))
33 PINSTALLFILES=$(patsubst %,debian/$(PACKAGE)-%.install,$(shell ls plugins/*/packaging/install/[a-z]* | sed 's:.*/\(.[^/]*\):\1:'))
35 DOCSFILES=$(patsubst packaging/docs/%,debian/$(OLDPACKAGE)-%.docs,$(wildcard packaging/docs/[a-z]*)) \
36 $(patsubst packaging/docs/%,debian/$(PACKAGE)-%.docs,$(wildcard packaging/docs/[a-z]*))
37 PDOCSFILES=$(patsubst %,debian/$(PACKAGE)-%.docs,$(shell ls plugins/*/packaging/docs/[a-z]* | sed 's:.*/\(.[^/]*\):\1:'))
39 POFILES=$(patsubst debian/dsf-po/%,debian/po/%,$(wildcard debian/dsf-po/*) debian/po/POTFILES.in)
42 @echo "PPOSTINST=$(PPOSTINST)"
43 @echo "PPRERM=$(PPRERM)"
45 @echo "CRONDFILES=$(CRONDFILES)"
46 @echo "DIRSFILES=$(DIRSFILES)"
47 @echo "LINKSFILES=$(LINKSFILES)"
48 @echo "INSTALLFILES=$(INSTALLFILES)"
49 @echo "DOCSFILES=$(DOCSFILES)"
51 @echo "PCRONDFILES=$(PCRONDFILES)"
52 @echo "PDIRSFILES=$(PDIRSFILES)"
53 @echo "PLINKSFILES=$(PLINKSFILES)"
54 @echo "PINSTALLFILES=$(PINSTALLFILES)"
55 @echo "PDOCSFILES=$(PDOCSFILES)"
58 sh $(CURDIR)/deb-specific/manage-uufiles.sh clean
61 conffiles: $(PPOSTINST) $(PPRERM) $(CRONDFILES) $(DIRSFILES) $(LINKSFILES) $(INSTALLFILES) $(DOCSFILES) $(PCRONDFILES) $(PDIRSFILES) $(PLINKSFILES) $(PINSTALLFILES) $(PDOCSFILES) debian/control
63 debian/$(PACKAGE)-plugin-%.postinst:
64 PLUGLONGNAME="`cat plugins/$*/NAME`" $(SED_REPLACE) -e 's/@PLUGSHORTNAME@/$*/g' -e "s/@PLUGLONGNAME@/$$PLUGLONGNAME/g" $(CURDIR)/debian/dsf-in/plugin.postinst > $@
66 debian/$(PACKAGE)-plugin-%.prerm:
67 PLUGLONGNAME="`cat plugins/$*/NAME`" $(SED_REPLACE) -e 's/@PLUGSHORTNAME@/$*/g' -e "s/@PLUGLONGNAME@/$$PLUGLONGNAME/g" $(CURDIR)/debian/dsf-in/plugin.prerm > $@
69 debian/$(PACKAGE)-plugin-%.cron.d:
70 sed -e 's/\$$FFUSER/$(OLDPACKAGE)/g' $(CURDIR)/plugins/$*/packaging/cron.d/plugin-$* > $@
72 debian/$(OLDPACKAGE)-%.cron.d:
73 (cat $(CURDIR)/packaging/cron.d/00phpcron ; sed -e 's/\$$FFUSER/$(OLDPACKAGE)/g' $(CURDIR)/packaging/cron.d/$*) | $(SED_REPLACE) > $@
75 debian/$(PACKAGE)-plugin-%.dirs:
76 $(SED_REPLACE) $(CURDIR)/plugins/$*/packaging/dirs/plugin-$* > $@
78 debian/$(OLDPACKAGE)-%.dirs:
79 $(SED_REPLACE) $(CURDIR)/packaging/dirs/$* > $@
81 debian/$(PACKAGE)-plugin-%.links:
82 $(SED_REPLACE) $(CURDIR)/plugins/$*/packaging/links/plugin-$* > $@
84 debian/$(OLDPACKAGE)-%.links:
85 $(SED_REPLACE) $(CURDIR)/packaging/links/$* > $@
87 debian/$(PACKAGE)-plugin-%.install:
88 $(SED_REPLACE) $(CURDIR)/plugins/$*/packaging/install/plugin-$* > $@
90 debian/$(OLDPACKAGE)-%.install:
91 $(SED_REPLACE) $(CURDIR)/packaging/install/$* > $@
93 debian/$(PACKAGE)-plugin-%.docs:
94 $(SED_REPLACE) $(CURDIR)/plugins/$*/packaging/docs/plugin-$* > $@
96 debian/$(OLDPACKAGE)-%.docs:
97 $(SED_REPLACE) $(CURDIR)/packaging/docs/$* > $@
98 debian/$(PACKAGE)-%.docs:
99 $(SED_REPLACE) $(CURDIR)/packaging/docs/$* > $@
101 debian/control: $(wildcard packaging/control/*) $(wildcard plugins/*/packaging/control/[0-9][0-9][0-9]*)
102 ls $(CURDIR)/packaging/control/[0-9][0-9][0-9]* $(CURDIR)/plugins/*/packaging/control/[0-9][0-9][0-9]* | grep -v shortdesc | grep -v scmcpold | while read file ; do cat $${file}; if [ -f $${file}.shortdesc ] ; then cat $(CURDIR)/packaging/control/AAAdesc; echo ' .'; cat $${file}.shortdesc; fi; echo ''; done | $(SED_REPLACE) > $@
104 debian/po/templates.pot: $(wildcard debian/dsf-in/*.templates.dsfh-in) $(wildcard debian/dsf-helper/*.templates)
105 @debconf-updatepo --podir=debian/dsf-po
108 cat $(patsubst debian/po/%,debian/dsf-po/%,$@) | $(SED_REPLACE) > $@
112 build: patch remove-binary-files debian/po/templates.pot conffiles
115 # Build man pages from Docbook sources
116 cat debian/dsf-in/config.sgml | $(SED_REPLACE) > debian/$(PACKAGE)-config.sgml
117 cat debian/dsf-in/common.manpages | $(SED_REPLACE) > debian/$(OLDPACKAGE)-common.manpages
118 /usr/bin/docbook-to-man debian/cvssh.sgml > cvssh.1
119 /usr/bin/docbook-to-man debian/$(PACKAGE)-config.sgml > $(PACKAGE)-config.1
121 # Build README.Debian from template
122 cat debian/README.Debian.tmpl | $(SED_REPLACE) > debian/README.Debian
124 # Uudecode binary files
125 sh $(CURDIR)/deb-specific/manage-uufiles.sh decode
127 # Build gettext *.mo files
128 utils/manage-translations.sh build
130 # Build FHS-compatible Apache config files
131 utils/manage-apache-config.sh build
133 # Preprocess files with DSF-Helper
134 perl $(CURDIR)/deb-specific/dsf-helper.pl
136 clean: remove-binary-files unpatch
139 rm -f $(CURDIR)/debian/*.cron.d
140 rm -f $(CURDIR)/debian/*.dirs
141 rm -f $(CURDIR)/debian/*.links
142 rm -f $(CURDIR)/debian/*.install
143 rm -f $(CURDIR)/debian/*.docs
144 rm -f $(CURDIR)/debian/$(PACKAGE)-config.sgml
145 rm -f $(CURDIR)/debian/$(OLDPACKAGE)-common.manpages
146 rm -f cvssh.1 $(PACKAGE)-config.1
147 rm -f $(CURDIR)/debian/README.Debian
152 perl $(CURDIR)/deb-specific/dsf-helper.pl --clean
158 chmod 755 $(CURDIR)/debian/*/*/*/*/bin/* $(CURDIR)/debian/*/*/*/*/cronjobs/* \
159 $(CURDIR)/debian/*/bin/* $(CURDIR)/debian/*/usr/share/*/plugins/*/bin/* \
160 $(CURDIR)/debian/*/usr/share/*/plugins/*/cronjobs/*
161 chmod 644 $(CURDIR)/debian/$(OLDPACKAGE)-db-postgresql/usr/share/$(OLDPACKAGE)/cronjobs/*.inc
163 chmod 755 $(CURDIR)/debian/$(OLDPACKAGE)-db-postgresql/usr/share/*/db/*.php
165 rm $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/usr/share/*/www/scm/viewvc/bin/cgi/viewvc-strace.sh
167 find $(CURDIR)/debian/$(OLDPACKAGE)-common/usr/share/*/common/docman/engine/ -type f -name \*.php -not -name \*.inc.php -exec chmod 0755 {} \;
168 find $(CURDIR)/debian/$(OLDPACKAGE)-common/usr/share/*/common/docman/engine/ -type f -name \*.sh -exec chmod 0755 {} \;
170 rm -f $(CURDIR)/debian/$(PACKAGE)-plugin-scm*/usr/share/*/plugins/scm*/*/README
171 chmod 755 $(CURDIR)/debian/$(PACKAGE)-plugin-scmcvs/usr/share/*/plugins/scmcvs/sbin/*
173 # Rename config files
174 mv $(CURDIR)/debian/$(OLDPACKAGE)-common/etc/$(PACKAGE)/config.ini-fhs $(CURDIR)/debian/$(OLDPACKAGE)-common/etc/$(PACKAGE)/config.ini
175 cp -r $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/usr/share/$(OLDPACKAGE)/etc/httpd.conf.d-fhs $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/etc/$(OLDPACKAGE)/httpd.conf.d
176 cp $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/usr/share/$(OLDPACKAGE)/etc/httpd.conf-fhs $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/etc/$(OLDPACKAGE)/httpd.conf
178 # Remove those that need to be generated at install time
179 rm $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/etc/$(OLDPACKAGE)/httpd.conf.d/secrets.inc
180 rm $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/etc/$(OLDPACKAGE)/httpd.conf.d/vhost-list.inc
181 rm $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/etc/$(OLDPACKAGE)/httpd.conf.d/vhost-main.inc
182 rm $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/etc/$(OLDPACKAGE)/httpd.conf.d/vhost-projects.inc
184 # Remove Windows files
185 rm -rf $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/usr/share/*/www/scm/viewvc/windows
187 rm -f $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/usr/share/*/www/themes/$(OLDPACKAGE)/COPYING
189 # Remove Snoopy class from binary packages (provided by libphp-snoopy)
190 find $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) -name Snoopy.class.php | xargs -r rm
192 # Remove NuSOAP class from binary packages (provided by libnusoap-php)
193 find $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) -name nusoap.php | xargs -r rm
195 # Remove potential SCM artefacts from binary packages
196 find $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) -name .svn -or -name {arch} -or -name .arch-ids -or -name .bzr -or -name .cvsignore | xargs -r rm -rf
198 # Also remove uuencoded files
199 find $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) -name \*.uu | xargs -r rm