3 # Sample debian/rules that uses debhelper.
4 # This file was originally written by Joey Hess and Craig Small.
5 # As a special exception, when this file is copied by dh-make into a
6 # dh-make output file, you may use that output file without restriction.
7 # This special exception was added by Craig Small in version 0.37 of dh-make.
9 # Uncomment this to turn on verbose mode.
11 SRCPACKAGE=$(shell head -1 $(CURDIR)/debian/changelog | sed 's/\(.[^ ]*\) .*/\1/')
12 MAJOR=$(shell head -1 $(CURDIR)/debian/changelog | sed 's/.*(\(.*\)-[^-]*).*/\1/')
13 ORIGFILE=$(SRCPACKAGE)_$(MAJOR).orig.tar.gz
18 SED_REPLACE=sed -e 's/@PACKAGE@/$(PACKAGE)/g' -e 's/@SRCPACKAGE@/$(SRCPACKAGE)/g' -e 's/@FORGENAME@/$(FORGENAME)/g' -e 's/@OLDPACKAGE@/$(OLDPACKAGE)/g'
20 CRONDFILES=$(patsubst packaging/cron.d/%,debian/$(PACKAGE)-%.cron.d,$(wildcard packaging/cron.d/[a-z]*))
21 DIRSFILES=$(patsubst packaging/dirs/%,debian/$(PACKAGE)-%.dirs,$(wildcard packaging/dirs/[a-z]*))
22 LINKSFILES=$(patsubst packaging/links/%,debian/$(PACKAGE)-%.links,$(wildcard packaging/links/[a-z]*))
23 INSTALLFILES=$(patsubst packaging/install/%,debian/$(PACKAGE)-%.install,$(wildcard packaging/install/[a-z]*))
24 DOCSFILES=$(patsubst packaging/docs/%,debian/$(PACKAGE)-%.docs,$(wildcard packaging/docs/[a-z]*))
25 POFILES=$(patsubst debian/dsf-po/%,debian/po/%,$(wildcard debian/dsf-po/*) debian/po/POTFILES.in)
28 conffiles: $(CRONDFILES) $(DIRSFILES) $(LINKSFILES) $(INSTALLFILES) $(DOCSFILES) debian/control
30 debian/$(PACKAGE)-%.cron.d:
31 (cat $(CURDIR)/packaging/cron.d/00phpcron ; sed -e 's/\$$FFUSER/$(PACKAGE)/g' $(CURDIR)/packaging/cron.d/$*) > $@
33 debian/$(PACKAGE)-%.dirs:
34 cp $(CURDIR)/packaging/dirs/$* $@
36 debian/$(PACKAGE)-%.links:
37 cp $(CURDIR)/packaging/links/$* $@
39 debian/$(PACKAGE)-%.install:
40 cp $(CURDIR)/packaging/install/$* $@
42 debian/$(PACKAGE)-%.docs:
43 cp $(CURDIR)/packaging/docs/$* $@
45 debian/control: $(wildcard packaging/control/*)
46 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) > $@
48 debian/po/templates.pot: $(wildcard debian/dsf-in/*.templates.dsfh-in) $(wildcard debian/dsf-helper/*.templates)
49 @debconf-updatepo --podir=debian/dsf-po
52 cat $(patsubst debian/po/%,debian/dsf-po/%,$@) | $(SED_REPLACE) > $@
54 build: debian/po/templates.pot conffiles
56 # Build gettext *.mo files
57 utils/manage-translations.sh build
61 rm -f $(CURDIR)/debian/*.cron.d
62 rm -f $(CURDIR)/debian/*.dirs
63 rm -f $(CURDIR)/debian/*.links
64 rm -f $(CURDIR)/debian/*.install
65 rm -f $(CURDIR)/debian/*.docs
70 find $(PKGDIR) -type f -or -type l | grep -v '/CVS/' | \
71 grep -v '/.svn/' | grep -v '/.testbox/' | \
72 grep -v rpm-specific | grep -v docs/phpdoc/docs | \
73 grep -v ^./debian/ | grep -v \\.jar$$ | \
74 grep -v \\.pdf$$ | grep -v plugins/fckeditor/www/_samples | \
75 cpio -o -H ustar | gzip > ../$(ORIGFILE)