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
15 include /usr/share/dpatch/dpatch.make
17 CRONDFILES=$(patsubst packaging/cron.d/%,debian/$(PACKAGE)-%.cron.d,$(wildcard packaging/cron.d/[a-z]*))
18 DIRSFILES=$(patsubst packaging/dirs/%,debian/$(PACKAGE)-%.dirs,$(wildcard packaging/dirs/[a-z]*))
19 INSTALLFILES=$(patsubst packaging/install/%,debian/$(PACKAGE)-%.install,$(wildcard packaging/install/[a-z]*))
20 DOCSFILES=$(patsubst packaging/docs/pkgname%,debian/$(PACKAGE)%.docs,$(wildcard packaging/docs/pkgname*))
21 POFILES=$(patsubst debian/dsf-po/%,debian/po/%,$(wildcard debian/dsf-po/*) debian/po/POTFILES.in)
24 sh $(CURDIR)/deb-specific/manage-uufiles.sh clean
27 conffiles: $(CRONDFILES) $(DIRSFILES) $(INSTALLFILES) $(DOCSFILES) debian/control
29 debian/$(PACKAGE)-%.cron.d:
30 (cat $(CURDIR)/packaging/cron.d/00phpcron ; sed -e 's/\$$FFUSER/$(PACKAGE)/g' $(CURDIR)/packaging/cron.d/$*) > $@
32 debian/$(PACKAGE)-%.dirs:
33 cp $(CURDIR)/packaging/dirs/$* $@
35 debian/$(PACKAGE)-%.install:
36 cp $(CURDIR)/packaging/install/$* $@
39 cp $(CURDIR)/packaging/docs/$(patsubst $(PACKAGE)%,pkgname%,$*) $@
41 debian/control: $(wildcard packaging/control/*)
42 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 -e 's/@PACKAGE@/$(PACKAGE)/g' -e 's/@SRCPACKAGE@/$(SRCPACKAGE)/g' > $@
44 debian/po/templates.pot: $(wildcard debian/dsf-in/*.templates.dsfh-in) $(wildcard debian/dsf-helper/*.templates)
45 @debconf-updatepo --podir=debian/dsf-po
48 cat $(patsubst debian/po/%,debian/dsf-po/%,$@) | sed 's/@PACKAGE@/$(PACKAGE)/g' | sed 's/@FORGENAME@/$(FORGENAME)/g' > $@
52 build: patch remove-binary-files debian/po/templates.pot conffiles
55 # Build man pages from Docbook sources
56 cat debian/dsf-in/config.sgml | sed 's/@PACKAGE@/$(PACKAGE)/g' | sed 's/@FORGENAME@/$(FORGENAME)/g' > debian/$(PACKAGE)-config.sgml
57 cat debian/dsf-in/common.manpages | sed 's/@PACKAGE@/$(PACKAGE)/g' | sed 's/@FORGENAME@/$(FORGENAME)/g' > debian/$(PACKAGE)-common.manpages
58 /usr/bin/docbook-to-man debian/cvssh.sgml > cvssh.1
59 /usr/bin/docbook-to-man debian/$(PACKAGE)-config.sgml > $(PACKAGE)-config.1
61 # Build README.Debian from template
62 cat debian/README.Debian.tmpl | sed 's/@PACKAGE@/$(PACKAGE)/g' | sed 's/@FORGENAME@/$(FORGENAME)/g' > debian/README.Debian
64 # Uudecode binary files
65 sh $(CURDIR)/deb-specific/manage-uufiles.sh decode
67 # Build gettext *.mo files
68 utils/manage-translations.sh build
70 # Preprocess files with DSF-Helper
71 perl $(CURDIR)/deb-specific/dsf-helper.pl
73 clean: remove-binary-files unpatch
76 rm -f $(CURDIR)/debian/*.cron.d
77 rm -f $(CURDIR)/debian/*.dirs
78 rm -f $(CURDIR)/debian/*.install
79 rm -f $(CURDIR)/debian/*.docs
80 rm -f $(CURDIR)/debian/$(PACKAGE)-config.sgml
81 rm -f $(CURDIR)/debian/$(PACKAGE)-common.manpages
82 rm -f cvssh.1 $(PACKAGE)-config.1
83 rm -f $(CURDIR)/debian/README.Debian
88 perl $(CURDIR)/deb-specific/dsf-helper.pl --clean
94 chmod 755 $(CURDIR)/debian/*/*/*/*/bin/* $(CURDIR)/debian/*/*/*/*/cronjobs/* \
95 $(CURDIR)/debian/*/bin/* $(CURDIR)/debian/*/usr/share/*/plugins/*/bin/* \
96 $(CURDIR)/debian/*/usr/share/*/plugins/*/cronjobs/*
97 chmod 644 $(CURDIR)/debian/$(PACKAGE)-db-postgresql/usr/share/$(PACKAGE)/cronjobs/*.inc
99 chmod 755 $(CURDIR)/debian/$(PACKAGE)-db-postgresql/usr/share/*/db/*.php
101 rm $(CURDIR)/debian/$(PACKAGE)-web-apache2/usr/share/*/www/scm/viewvc/bin/cgi/viewvc-strace.sh
103 find $(CURDIR)/debian/$(PACKAGE)-common/usr/share/*/common/docman/engine/ -type f -name \*.php -not -name \*.inc.php -exec chmod 0755 {} \;
104 find $(CURDIR)/debian/$(PACKAGE)-common/usr/share/*/common/docman/engine/ -type f -name \*.sh -exec chmod 0755 {} \;
106 rm -f $(CURDIR)/debian/$(PACKAGE)-plugin-scm*/usr/share/*/plugins/scm*/*/README
107 chmod 755 $(CURDIR)/debian/$(PACKAGE)-plugin-scmcvs/usr/share/*/plugins/scmcvs/sbin/*
109 # Remove Windows files
110 rm -rf $(CURDIR)/debian/$(PACKAGE)-web-apache2/usr/share/*/www/scm/viewvc/windows
112 rm -f $(CURDIR)/debian/$(PACKAGE)-web-apache2/usr/share/*/www/themes/$(PACKAGE)/COPYING
114 # Remove Snoopy class from binary packages (provided by libphp-snoopy)
115 find $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) -name Snoopy.class.php | xargs -r rm
117 # Remove NuSOAP class from binary packages (provided by libnusoap-php)
118 find $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) -name nusoap.php | xargs -r rm
120 # Remove potential SCM artefacts from binary packages
121 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
123 # Also remove uuencoded files
124 find $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) -name \*.uu | xargs -r rm