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 DIRSFILES=$(patsubst packaging/dirs/%,debian/$(OLDPACKAGE)-%.dirs,$(wildcard packaging/dirs/[a-z]*))
22 LINKSFILES=$(patsubst packaging/links/%,debian/$(OLDPACKAGE)-%.links,$(wildcard packaging/links/[a-z]*))
23 INSTALLFILES=$(patsubst packaging/install/%,debian/$(OLDPACKAGE)-%.install,$(wildcard packaging/install/[a-z]*))
24 DOCSFILES=$(patsubst packaging/docs/oldpkgname%,debian/$(OLDPACKAGE)%.docs,$(wildcard packaging/docs/oldpkgname*)) $(patsubst packaging/docs/pkgname%,debian/$(PACKAGE)%.docs,$(wildcard packaging/docs/pkgname*))
25 POFILES=$(patsubst debian/dsf-po/%,debian/po/%,$(wildcard debian/dsf-po/*) debian/po/POTFILES.in)
28 sh $(CURDIR)/deb-specific/manage-uufiles.sh clean
31 conffiles: $(CRONDFILES) $(DIRSFILES) $(LINKSFILES) $(INSTALLFILES) $(DOCSFILES) debian/control
33 debian/$(OLDPACKAGE)-%.cron.d:
34 (cat $(CURDIR)/packaging/cron.d/00phpcron ; sed -e 's/\$$FFUSER/$(OLDPACKAGE)/g' $(CURDIR)/packaging/cron.d/$*) > $@
36 debian/$(OLDPACKAGE)-%.dirs:
37 cp $(CURDIR)/packaging/dirs/$* $@
39 debian/$(OLDPACKAGE)-%.links:
40 cp $(CURDIR)/packaging/links/$* $@
42 debian/$(OLDPACKAGE)-%.install:
43 cp $(CURDIR)/packaging/install/$* $@
45 debian/$(OLDPACKAGE)-%.docs:
46 cp $(CURDIR)/packaging/docs/oldpkgname-$* $@
47 debian/$(PACKAGE)-%.docs:
48 cp $(CURDIR)/packaging/docs/pkgname-$* $@
50 debian/control: $(wildcard packaging/control/*)
51 ls $(CURDIR)/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) > $@
53 debian/po/templates.pot: $(wildcard debian/dsf-in/*.templates.dsfh-in) $(wildcard debian/dsf-helper/*.templates)
54 @debconf-updatepo --podir=debian/dsf-po
57 cat $(patsubst debian/po/%,debian/dsf-po/%,$@) | $(SED_REPLACE) > $@
61 build: patch remove-binary-files debian/po/templates.pot conffiles
64 # Build man pages from Docbook sources
65 cat debian/dsf-in/config.sgml | $(SED_REPLACE) > debian/$(OLDPACKAGE)-config.sgml
66 cat debian/dsf-in/common.manpages | $(SED_REPLACE) > debian/$(OLDPACKAGE)-common.manpages
67 /usr/bin/docbook-to-man debian/cvssh.sgml > cvssh.1
68 /usr/bin/docbook-to-man debian/$(OLDPACKAGE)-config.sgml > $(OLDPACKAGE)-config.1
70 # Build README.Debian from template
71 cat debian/README.Debian.tmpl | $(SED_REPLACE) > debian/README.Debian
73 # Uudecode binary files
74 sh $(CURDIR)/deb-specific/manage-uufiles.sh decode
76 # Build gettext *.mo files
77 utils/manage-translations.sh build
79 # Preprocess files with DSF-Helper
80 perl $(CURDIR)/deb-specific/dsf-helper.pl
82 clean: remove-binary-files unpatch
85 rm -f $(CURDIR)/debian/*.cron.d
86 rm -f $(CURDIR)/debian/*.dirs
87 rm -f $(CURDIR)/debian/*.links
88 rm -f $(CURDIR)/debian/*.install
89 rm -f $(CURDIR)/debian/*.docs
90 rm -f $(CURDIR)/debian/$(OLDPACKAGE)-config.sgml
91 rm -f $(CURDIR)/debian/$(OLDPACKAGE)-common.manpages
92 rm -f cvssh.1 $(OLDPACKAGE)-config.1
93 rm -f $(CURDIR)/debian/README.Debian
98 perl $(CURDIR)/deb-specific/dsf-helper.pl --clean
104 chmod 755 $(CURDIR)/debian/*/*/*/*/bin/* $(CURDIR)/debian/*/*/*/*/cronjobs/* \
105 $(CURDIR)/debian/*/bin/* $(CURDIR)/debian/*/usr/share/*/plugins/*/bin/* \
106 $(CURDIR)/debian/*/usr/share/*/plugins/*/cronjobs/*
107 chmod 644 $(CURDIR)/debian/$(OLDPACKAGE)-db-postgresql/usr/share/$(OLDPACKAGE)/cronjobs/*.inc
109 chmod 755 $(CURDIR)/debian/$(OLDPACKAGE)-db-postgresql/usr/share/*/db/*.php
111 rm $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/usr/share/*/www/scm/viewvc/bin/cgi/viewvc-strace.sh
113 find $(CURDIR)/debian/$(OLDPACKAGE)-common/usr/share/*/common/docman/engine/ -type f -name \*.php -not -name \*.inc.php -exec chmod 0755 {} \;
114 find $(CURDIR)/debian/$(OLDPACKAGE)-common/usr/share/*/common/docman/engine/ -type f -name \*.sh -exec chmod 0755 {} \;
116 rm -f $(CURDIR)/debian/$(OLDPACKAGE)-plugin-scm*/usr/share/*/plugins/scm*/*/README
117 chmod 755 $(CURDIR)/debian/$(OLDPACKAGE)-plugin-scmcvs/usr/share/*/plugins/scmcvs/sbin/*
119 # Remove Windows files
120 rm -rf $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/usr/share/*/www/scm/viewvc/windows
122 rm -f $(CURDIR)/debian/$(OLDPACKAGE)-web-apache2/usr/share/*/www/themes/$(OLDPACKAGE)/COPYING
124 # Remove Snoopy class from binary packages (provided by libphp-snoopy)
125 find $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) -name Snoopy.class.php | xargs -r rm
127 # Remove NuSOAP class from binary packages (provided by libnusoap-php)
128 find $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) -name nusoap.php | xargs -r rm
130 # Remove potential SCM artefacts from binary packages
131 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
133 # Also remove uuencoded files
134 find $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) -name \*.uu | xargs -r rm