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/oldpkgname%,debian/$(OLDPACKAGE)%.docs,$(wildcard packaging/docs/oldpkgname*)) $(patsubst packaging/docs/pkgname%,debian/$(PACKAGE)%.docs,$(wildcard packaging/docs/pkgname*))
33 PDOCSFILES=$(patsubst %,debian/$(OLDPACKAGE)-%.docs,$(shell ls plugins/*/packaging/docs/[a-z]* | sed 's:.*/\(.[^/]*\):\1:'))
35 POFILES=$(patsubst debian/dsf-po/%,debian/po/%,$(wildcard debian/dsf-po/*) debian/po/POTFILES.in)
38 @echo "CRONDFILES=$(CRONDFILES)"
39 @echo "DIRSFILES=$(DIRSFILES)"
40 @echo "LINKSFILES=$(LINKSFILES)"
41 @echo "INSTALLFILES=$(INSTALLFILES)"
42 @echo "DOCSFILES=$(DOCSFILES)"
44 @echo "PCRONDFILES=$(PCRONDFILES)"
45 @echo "PDIRSFILES=$(PDIRSFILES)"
46 @echo "PLINKSFILES=$(PLINKSFILES)"
47 @echo "PINSTALLFILES=$(PINSTALLFILES)"
48 @echo "PDOCSFILES=$(PDOCSFILES)"
51 sh $(CURDIR)/deb-specific/manage-uufiles.sh clean
54 conffiles: $(CRONDFILES) $(DIRSFILES) $(LINKSFILES) $(INSTALLFILES) $(DOCSFILES) $(PCRONDFILES) $(PDIRSFILES) $(PLINKSFILES) $(PINSTALLFILES) $(PDOCSFILES) debian/control
56 debian/$(OLDPACKAGE)-plugin-%.cron.d:
57 sed -e 's/\$$FFUSER/$(OLDPACKAGE)/g' $(CURDIR)/plugins/$*/packaging/cron.d/plugin-$* > $@
59 debian/$(OLDPACKAGE)-%.cron.d:
60 (cat $(CURDIR)/packaging/cron.d/00phpcron ; sed -e 's/\$$FFUSER/$(OLDPACKAGE)/g' $(CURDIR)/packaging/cron.d/$*) | $(SED_REPLACE) > $@
62 debian/$(OLDPACKAGE)-plugin-%.dirs:
63 $(SED_REPLACE) $(CURDIR)/plugins/$*/packaging/dirs/plugin-$* > $@
65 debian/$(OLDPACKAGE)-%.dirs:
66 $(SED_REPLACE) $(CURDIR)/packaging/dirs/$* > $@
68 debian/$(OLDPACKAGE)-plugin-%.links:
69 $(SED_REPLACE) $(CURDIR)/plugins/$*/packaging/links/plugin-$* > $@
71 debian/$(OLDPACKAGE)-%.links:
72 $(SED_REPLACE) $(CURDIR)/packaging/links/$* > $@
74 debian/$(OLDPACKAGE)-plugin-%.install:
75 $(SED_REPLACE) $(CURDIR)/plugins/$*/packaging/install/plugin-$* > $@
77 debian/$(OLDPACKAGE)-%.install:
78 $(SED_REPLACE) $(CURDIR)/packaging/install/$* > $@
80 debian/$(OLDPACKAGE)-plugin-%.docs:
81 $(SED_REPLACE) $(CURDIR)/plugins/$*/packaging/docs/plugin-$* > $@
83 debian/$(OLDPACKAGE)-%.docs:
84 $(SED_REPLACE) $(CURDIR)/packaging/docs/oldpkgname-$* > $@
85 debian/$(PACKAGE)-%.docs:
86 $(SED_REPLACE) $(CURDIR)/packaging/docs/pkgname-$* > $@
88 debian/control: $(wildcard packaging/control/*) $(wildcard plugins/*/packaging/control/[0-9][0-9][0-9]*)
89 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) > $@
91 debian/po/templates.pot: $(wildcard debian/dsf-in/*.templates.dsfh-in) $(wildcard debian/dsf-helper/*.templates)
92 @debconf-updatepo --podir=debian/dsf-po
95 cat $(patsubst debian/po/%,debian/dsf-po/%,$@) | $(SED_REPLACE) > $@
99 build: patch remove-binary-files debian/po/templates.pot conffiles
102 # Build man pages from Docbook sources
103 cat debian/dsf-in/config.sgml | $(SED_REPLACE) > debian/$(OLDPACKAGE)-config.sgml
104 cat debian/dsf-in/common.manpages | $(SED_REPLACE) > debian/$(OLDPACKAGE)-common.manpages
105 /usr/bin/docbook-to-man debian/cvssh.sgml > cvssh.1
106 /usr/bin/docbook-to-man debian/$(OLDPACKAGE)-config.sgml > $(OLDPACKAGE)-config.1
108 # Build README.Debian from template
109 cat debian/README.Debian.tmpl | $(SED_REPLACE) > debian/README.Debian
111 # Uudecode binary files
112 sh $(CURDIR)/deb-specific/manage-uufiles.sh decode
114 # Build gettext *.mo files
115 utils/manage-translations.sh build
117 # Build FHS-compatible Apache config files
118 utils/manage-apache-config.sh build
120 # Preprocess files with DSF-Helper
121 perl $(CURDIR)/deb-specific/dsf-helper.pl
123 clean: remove-binary-files unpatch
126 rm -f $(CURDIR)/debian/*.cron.d
127 rm -f $(CURDIR)/debian/*.dirs
128 rm -f $(CURDIR)/debian/*.links
129 rm -f $(CURDIR)/debian/*.install
130 rm -f $(CURDIR)/debian/*.docs
131 rm -f $(CURDIR)/debian/$(OLDPACKAGE)-config.sgml
132 rm -f $(CURDIR)/debian/$(OLDPACKAGE)-common.manpages
133 rm -f cvssh.1 $(OLDPACKAGE)-config.1
134 rm -f $(CURDIR)/debian/README.Debian
139 perl $(CURDIR)/deb-specific/dsf-helper.pl --clean
145 chmod 755 $(CURDIR)/debian/*/*/*/*/bin/* $(CURDIR)/debian/*/*/*/*/cronjobs/* \
146 $(CURDIR)/debian/*/bin/* $(CURDIR)/debian/*/usr/share/*/plugins/*/bin/* \
147 $(CURDIR)/debian/*/usr/share/*/plugins/*/cronjobs/*
148 chmod 644 $(CURDIR)/debian/$(OLDPACKAGE)-db-postgresql/usr/share/$(OLDPACKAGE)/cronjobs/*.inc
150 chmod 755 $(CURDIR)/debian/$(OLDPACKAGE)-db-postgresql/usr/share/*/db/*.php
152 rm $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/usr/share/*/www/scm/viewvc/bin/cgi/viewvc-strace.sh
154 find $(CURDIR)/debian/$(OLDPACKAGE)-common/usr/share/*/common/docman/engine/ -type f -name \*.php -not -name \*.inc.php -exec chmod 0755 {} \;
155 find $(CURDIR)/debian/$(OLDPACKAGE)-common/usr/share/*/common/docman/engine/ -type f -name \*.sh -exec chmod 0755 {} \;
157 rm -f $(CURDIR)/debian/$(OLDPACKAGE)-plugin-scm*/usr/share/*/plugins/scm*/*/README
158 chmod 755 $(CURDIR)/debian/$(OLDPACKAGE)-plugin-scmcvs/usr/share/*/plugins/scmcvs/sbin/*
160 # Rename config files
161 mv $(CURDIR)/debian/$(OLDPACKAGE)-common/etc/fusionforge/config.ini-fhs $(CURDIR)/debian/$(OLDPACKAGE)-common/etc/fusionforge/config.ini
162 cp -r $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/usr/share/gforge/etc/httpd.conf.d-fhs $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/etc/gforge/httpd.conf.d
163 cp $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/usr/share/gforge/etc/httpd.conf-fhs $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/etc/gforge/httpd.conf
165 # Remove those that need to be generated at install time
166 rm $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/etc/gforge/httpd.conf.d/secrets.inc
167 rm $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/etc/gforge/httpd.conf.d/vhost-list.inc
168 rm $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/etc/gforge/httpd.conf.d/vhost-main.inc
169 rm $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/etc/gforge/httpd.conf.d/vhost-projects.inc
171 # Remove Windows files
172 rm -rf $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/usr/share/*/www/scm/viewvc/windows
174 rm -f $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/usr/share/*/www/themes/$(OLDPACKAGE)/COPYING
176 # Remove Snoopy class from binary packages (provided by libphp-snoopy)
177 find $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) -name Snoopy.class.php | xargs -r rm
179 # Remove NuSOAP class from binary packages (provided by libnusoap-php)
180 find $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) -name nusoap.php | xargs -r rm
182 # Remove potential SCM artefacts from binary packages
183 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
185 # Also remove uuencoded files
186 find $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) -name \*.uu | xargs -r rm