#!/usr/bin/make -f # debian/rules that uses debhelper. # GNU copyright 1997 to 1999 by Joey Hess (sample file) # Copyright 2000 to 2002 by Roland Mas and Christian Bayle for the Sourceforge package # Copyright 2002 to 2003 by Roland Mas and Christian Bayle for the Gforge package # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 PACKAGE=gforge include /usr/share/dpatch/dpatch.make # This one should be declared like other when it will be unified with rpm CRONFILESLIST=debian/$(PACKAGE)-lists-mailman.cron.d debian/$(PACKAGE)-web-apache2.cron.d debian/$(PACKAGE)-db-postgresql.cron.d debian/$(PACKAGE)-dns-bind9.cron.d debian/$(PACKAGE)-plugin-scmcvs.cron.d debian/$(PACKAGE)-ftp-proftpd.cron.d debian/$(PACKAGE)-shell-postgresql.cron.d debian/$(PACKAGE)-plugin-scmsvn.cron.d DIRSFILESLIST=$(patsubst dirs/%,debian/$(PACKAGE)-%.dirs,$(wildcard dirs/[a-z]*)) INSTALLFILESLIST=$(patsubst install/%,debian/$(PACKAGE)-%.install,$(wildcard install/[a-z]*)) listecho: @echo $(CRONFILESLIST) @echo $(DIRSFILESLIST) @echo $(INSTALLFILESLIST) remove-binary-files: # Remove files in contrib, especially binaries that break dpkg-source # find contrib/ -name CVS -prune -not -name CVS -or -type f | xargs rm -f # Also a few images # rm -f www/themes/gforge/images/es_* sh $(CURDIR)/deb-specific/manage-uufiles.sh clean cronfiles: $(CRONFILESLIST) dirsfiles: $(DIRSFILESLIST) installfiles: $(INSTALLFILESLIST) conffiles: cronfiles dirsfiles installfiles debian/$(PACKAGE)-%.cron.d: @echo "Creating $@" @if [ "$@" = "debian/$(PACKAGE)-db-postgresql.cron.d" ] ; then \ cat $(CURDIR)/cron.d/00phpcron > $@ ; \ cat $(CURDIR)/cron.d/db-postgresql >> $@ ; \ cat $(CURDIR)/cron.d/db-postgresql-2 >> $@ ; \ else \ echo "copy $(CURDIR)/cron.d/$* to $@" ; \ cp $(CURDIR)/cron.d/$* $@ ; \ fi debian/$(PACKAGE)-%.dirs: @echo "Creating $@" cp $(CURDIR)/dirs/$* $@ debian/$(PACKAGE)-%.install: @echo "Creating $@" cp $(CURDIR)/install/$* $@ configure: configure-stamp debian/po/templates.pot configure-stamp: remove-binary-files dh_testdir touch configure-stamp debian/po/templates.pot: $(wildcard debian/*.templates) $(wildcard debian/*.templates.dsfh-in) $(wildcard debian/dsf-helper/*.templates) @debconf-updatepo build: configure-stamp build-stamp build-stamp: patch dh_testdir # Build man pages from Docbook sources /usr/bin/docbook-to-man debian/cvssh.sgml > cvssh.1 /usr/bin/docbook-to-man debian/gforge-config.sgml > gforge-config.1 # Uudecode binary files sh $(CURDIR)/deb-specific/manage-uufiles.sh decode # Build gettext *.mo files for l in eu bg ca zh_TW nl en eo fr de el he id it ja ko la nb pl pt_BR pt ru zh_CN es sv th ; do mkdir -p locales/$$l/LC_MESSAGES && msgfmt -o locales/$$l/LC_MESSAGES/gforge.mo translations/$$l.po ; done touch build-stamp clean: remove-binary-files unpatch dh_testdir dh_testroot rm -f build-stamp configure-stamp rm -f $(CURDIR)/debian/*.cron.d rm -f $(CURDIR)/debian/*.dirs rm -f $(CURDIR)/debian/*.install rm -f cvssh.1 gforge-config.1 rm -rf locales/* perl $(CURDIR)/deb-specific/dsf-helper.pl --clean dh_clean install: build dh_testdir dh_testroot dh_clean -k # Generate conffiles *.cron.d *.dirs *.install $(CURDIR)/debian/rules conffiles dh_installdirs # Preprocess files with DSF-Helper perl $(CURDIR)/deb-specific/dsf-helper.pl # Install files #dh_install --fail-missing -X.svn -X.arch-ids -X.bzr -X.cvsignore --sourcedir=$(CURDIR) dh_install -X.svn -X.arch-ids -X.bzr -X.cvsignore --sourcedir=$(CURDIR) # Install few links ln -s database-pgsql.php $(CURDIR)/debian/$(PACKAGE)-common/usr/share/$(PACKAGE)/common/include/database.php ln -s /usr/share/mediawiki/skins/$(PACKAGE)/loader.php $(CURDIR)/debian/$(PACKAGE)-plugin-mediawiki/etc/mediawiki-extensions/extensions-available/GforgeAuth.php # Fix permissions for i in $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) ; do find $$i -type f -exec chmod 644 {} \; ; done -chmod 755 $(CURDIR)/debian/*/*/*/*/bin/* $(CURDIR)/debian/*/*/*/*/cronjobs/* \ $(CURDIR)/debian/*/bin/* $(CURDIR)/debian/*/usr/share/*/plugins/*/bin/* \ $(CURDIR)/debian/*/usr/share/*/plugins/*/cronjobs/* # chmod 755 $(CURDIR)/debian/$(PACKAGE)-db-postgresql/usr/share/*/db/*.php chmod 644 $(CURDIR)/debian/$(PACKAGE)-db-postgresql/usr/share/gforge/cronjobs/*.inc # viewvc rights find $(CURDIR)/debian/$(PACKAGE)-web-apache2/usr/share/*/www/scm/viewvc -type f -exec chmod 0644 {} \; grep -ril '^#!' $(CURDIR)/debian/$(PACKAGE)-web-apache2/usr/share/*/www/scm/viewvc | xargs chmod 0755 # find $(CURDIR)/debian/$(PACKAGE)-common/usr/share/*/common/docman/engine/ -type f -name \*.php -not -name \*.inc.php -exec chmod 0755 {} \; find $(CURDIR)/debian/$(PACKAGE)-common/usr/share/*/common/docman/engine/ -type f -name \*.sh -exec chmod 0755 {} \; # rm -f $(CURDIR)/debian/$(PACKAGE)-plugin-scm*/usr/share/*/plugins/scm*/*/README chmod 755 $(CURDIR)/debian/$(PACKAGE)-plugin-scmcvs/usr/share/*/plugins/scmcvs/sbin/* # remove windows files rm -rf $(CURDIR)/debian/$(PACKAGE)-web-apache2/usr/share/*/www/scm/viewvc/windows # rm -f $(CURDIR)/debian/$(PACKAGE)-web-apache2/usr/share/*/www/themes/gforge/COPYING # Remove Snoopy class from binary packages (provided by libphp-snoopy) for i in $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) ; do find $$i -name Snoopy.class.php | xargs rm -rf ; done # Remove potential SCM artefacts from binary packages for i in $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) ; do find $$i -name .svn -or -name {arch} -or -name .arch-ids -or -name .bzr -or -name .cvsignore | xargs rm -rf ; done # Also remove uuencoded files for i in $(addprefix $(CURDIR)/debian/,$(shell dh_listpackages)) ; do find $$i -name \*.uu | xargs echo rm ; done binary-indep: build install dh_testdir dh_testroot dh_installdebconf dh_installdocs #dh_installexamples #dh_installmenu #dh_installemacsen #dh_installpam #dh_installinit dh_installcron dh_installman #dh_installinfo #dh_undocumented dh_installchangelogs ChangeLog #dh_link dh_strip dh_compress dh_fixperms #dh_makeshlibs dh_installdeb #dh_perl #dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary-arch: build install # (No architecture-dependent files for Gforge, doing nothing here) binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install configure remove-binary-files patch unpatch