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 CRONDFILES=$(patsubst packaging/cron.d/%,debian/$(OLDPACKAGE)-%.cron.d,$(wildcard packaging/cron.d/[a-z]*))
21 PCRONDFILES=$(patsubst %,debian/$(OLDPACKAGE)-%.cron.d,$(shell ls plugins/*/packaging/cron.d/[a-z]* | sed 's:.*/\(.[^/]*\):\1:'))
23 DIRSFILES=$(patsubst packaging/dirs/%,debian/$(OLDPACKAGE)-%.dirs,$(wildcard packaging/dirs/[a-z]*))
24 PDIRSFILES=$(patsubst %,debian/$(OLDPACKAGE)-%.dirs,$(shell ls plugins/*/packaging/dirs/[a-z]* | sed 's:.*/\(.[^/]*\):\1:'))
26 LINKSFILES=$(patsubst packaging/links/%,debian/$(OLDPACKAGE)-%.links,$(wildcard packaging/links/[a-z]*))
27 PLINKSFILES=$(patsubst %,debian/$(OLDPACKAGE)-%.links,$(shell ls plugins/*/packaging/links/[a-z]* | sed 's:.*/\(.[^/]*\):\1:'))
29 INSTALLFILES=$(patsubst packaging/install/%,debian/$(OLDPACKAGE)-%.install,$(wildcard packaging/install/[a-z]*))
30 PINSTALLFILES=$(patsubst %,debian/$(OLDPACKAGE)-%.install,$(shell ls plugins/*/packaging/install/[a-z]* | sed 's:.*/\(.[^/]*\):\1:'))
32 DOCSFILES=$(patsubst packaging/docs/%,debian/$(OLDPACKAGE)-%.docs,$(wildcard packaging/docs/[a-z]*)) \
33 $(patsubst packaging/docs/%,debian/$(PACKAGE)-%.docs,$(wildcard packaging/docs/[a-z]*))
34 PDOCSFILES=$(patsubst %,debian/$(OLDPACKAGE)-%.docs,$(shell ls plugins/*/packaging/docs/[a-z]* | sed 's:.*/\(.[^/]*\):\1:'))
36 POFILES=$(patsubst debian/dsf-po/%,debian/po/%,$(wildcard debian/dsf-po/*) debian/po/POTFILES.in)
39 @echo "CRONDFILES=$(CRONDFILES)"
40 @echo "DIRSFILES=$(DIRSFILES)"
41 @echo "LINKSFILES=$(LINKSFILES)"
42 @echo "INSTALLFILES=$(INSTALLFILES)"
43 @echo "DOCSFILES=$(DOCSFILES)"
45 @echo "PCRONDFILES=$(PCRONDFILES)"
46 @echo "PDIRSFILES=$(PDIRSFILES)"
47 @echo "PLINKSFILES=$(PLINKSFILES)"
48 @echo "PINSTALLFILES=$(PINSTALLFILES)"
49 @echo "PDOCSFILES=$(PDOCSFILES)"
52 sh $(CURDIR)/deb-specific/manage-uufiles.sh clean
55 conffiles: $(CRONDFILES) $(DIRSFILES) $(LINKSFILES) $(INSTALLFILES) $(DOCSFILES) $(PCRONDFILES) $(PDIRSFILES) $(PLINKSFILES) $(PINSTALLFILES) $(PDOCSFILES) debian/control
57 debian/$(OLDPACKAGE)-plugin-%.cron.d:
58 sed -e 's/\$$FFUSER/$(OLDPACKAGE)/g' $(CURDIR)/plugins/$*/packaging/cron.d/plugin-$* > $@
60 debian/$(OLDPACKAGE)-%.cron.d:
61 (cat $(CURDIR)/packaging/cron.d/00phpcron ; sed -e 's/\$$FFUSER/$(OLDPACKAGE)/g' $(CURDIR)/packaging/cron.d/$*) | $(SED_REPLACE) > $@
63 debian/$(OLDPACKAGE)-plugin-%.dirs:
64 $(SED_REPLACE) $(CURDIR)/plugins/$*/packaging/dirs/plugin-$* > $@
66 debian/$(OLDPACKAGE)-%.dirs:
67 $(SED_REPLACE) $(CURDIR)/packaging/dirs/$* > $@
69 debian/$(OLDPACKAGE)-plugin-%.links:
70 $(SED_REPLACE) $(CURDIR)/plugins/$*/packaging/links/plugin-$* > $@
72 debian/$(OLDPACKAGE)-%.links:
73 $(SED_REPLACE) $(CURDIR)/packaging/links/$* > $@
75 debian/$(OLDPACKAGE)-plugin-%.install:
76 $(SED_REPLACE) $(CURDIR)/plugins/$*/packaging/install/plugin-$* > $@
78 debian/$(OLDPACKAGE)-%.install:
79 $(SED_REPLACE) $(CURDIR)/packaging/install/$* > $@
81 debian/$(OLDPACKAGE)-plugin-%.docs:
82 $(SED_REPLACE) $(CURDIR)/plugins/$*/packaging/docs/plugin-$* > $@
84 debian/$(OLDPACKAGE)-%.docs:
85 $(SED_REPLACE) $(CURDIR)/packaging/docs/$* > $@
86 debian/$(PACKAGE)-%.docs:
87 $(SED_REPLACE) $(CURDIR)/packaging/docs/$* > $@
89 debian/control: $(wildcard packaging/control/*) $(wildcard plugins/*/packaging/control/[0-9][0-9][0-9]*)
90 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) > $@
92 debian/po/templates.pot: $(wildcard debian/dsf-in/*.templates.dsfh-in) $(wildcard debian/dsf-helper/*.templates)
93 @debconf-updatepo --podir=debian/dsf-po
96 cat $(patsubst debian/po/%,debian/dsf-po/%,$@) | $(SED_REPLACE) > $@
100 build: patch remove-binary-files debian/po/templates.pot conffiles
103 # Build man pages from Docbook sources
104 cat debian/dsf-in/config.sgml | $(SED_REPLACE) > debian/$(OLDPACKAGE)-config.sgml
105 cat debian/dsf-in/common.manpages | $(SED_REPLACE) > debian/$(OLDPACKAGE)-common.manpages
106 /usr/bin/docbook-to-man debian/cvssh.sgml > cvssh.1
107 /usr/bin/docbook-to-man debian/$(OLDPACKAGE)-config.sgml > $(OLDPACKAGE)-config.1
109 # Build README.Debian from template
110 cat debian/README.Debian.tmpl | $(SED_REPLACE) > debian/README.Debian
112 # Uudecode binary files
113 sh $(CURDIR)/deb-specific/manage-uufiles.sh decode
115 # Build gettext *.mo files
116 utils/manage-translations.sh build
118 # Build FHS-compatible Apache config files
119 utils/manage-apache-config.sh build
121 # Preprocess files with DSF-Helper
122 perl $(CURDIR)/deb-specific/dsf-helper.pl
124 clean: remove-binary-files unpatch
127 rm -f $(CURDIR)/debian/*.cron.d
128 rm -f $(CURDIR)/debian/*.dirs
129 rm -f $(CURDIR)/debian/*.links
130 rm -f $(CURDIR)/debian/*.install
131 rm -f $(CURDIR)/debian/*.docs
132 rm -f $(CURDIR)/debian/$(OLDPACKAGE)-config.sgml
133 rm -f $(CURDIR)/debian/$(OLDPACKAGE)-common.manpages
134 rm -f cvssh.1 $(OLDPACKAGE)-config.1
135 rm -f $(CURDIR)/debian/README.Debian
140 perl $(CURDIR)/deb-specific/dsf-helper.pl --clean
146 chmod 755 $(CURDIR)/debian/*/*/*/*/bin/* $(CURDIR)/debian/*/*/*/*/cronjobs/* \
147 $(CURDIR)/debian/*/bin/* $(CURDIR)/debian/*/usr/share/*/plugins/*/bin/* \
148 $(CURDIR)/debian/*/usr/share/*/plugins/*/cronjobs/*
149 chmod 644 $(CURDIR)/debian/$(OLDPACKAGE)-db-postgresql/usr/share/$(OLDPACKAGE)/cronjobs/*.inc
151 chmod 755 $(CURDIR)/debian/$(OLDPACKAGE)-db-postgresql/usr/share/*/db/*.php
153 rm $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/usr/share/*/www/scm/viewvc/bin/cgi/viewvc-strace.sh
155 find $(CURDIR)/debian/$(OLDPACKAGE)-common/usr/share/*/common/docman/engine/ -type f -name \*.php -not -name \*.inc.php -exec chmod 0755 {} \;
156 find $(CURDIR)/debian/$(OLDPACKAGE)-common/usr/share/*/common/docman/engine/ -type f -name \*.sh -exec chmod 0755 {} \;
158 rm -f $(CURDIR)/debian/$(OLDPACKAGE)-plugin-scm*/usr/share/*/plugins/scm*/*/README
159 chmod 755 $(CURDIR)/debian/$(OLDPACKAGE)-plugin-scmcvs/usr/share/*/plugins/scmcvs/sbin/*
161 # Rename config files
162 mv $(CURDIR)/debian/$(OLDPACKAGE)-common/etc/$(PACKAGE)/config.ini-fhs $(CURDIR)/debian/$(OLDPACKAGE)-common/etc/$(PACKAGE)/config.ini
163 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
164 cp $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/usr/share/$(OLDPACKAGE)/etc/httpd.conf-fhs $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/etc/$(OLDPACKAGE)/httpd.conf
166 # Remove those that need to be generated at install time
167 rm $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/etc/$(OLDPACKAGE)/httpd.conf.d/secrets.inc
168 rm $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/etc/$(OLDPACKAGE)/httpd.conf.d/vhost-list.inc
169 rm $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/etc/$(OLDPACKAGE)/httpd.conf.d/vhost-main.inc
170 rm $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/etc/$(OLDPACKAGE)/httpd.conf.d/vhost-projects.inc
172 # Remove Windows files
173 rm -rf $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/usr/share/*/www/scm/viewvc/windows
175 rm -f $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/usr/share/*/www/themes/$(OLDPACKAGE)/COPYING
177 # Remove Snoopy class from binary packages (provided by libphp-snoopy)
178 find $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) -name Snoopy.class.php | xargs -r rm
180 # Remove NuSOAP class from binary packages (provided by libnusoap-php)
181 find $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) -name nusoap.php | xargs -r rm
183 # Remove potential SCM artefacts from binary packages
184 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
186 # Also remove uuencoded files
187 find $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) -name \*.uu | xargs -r rm