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)
26 DSFINFILES=$(patsubst debian/dsf-in/%,debian/$(PACKAGE)-%,$(wildcard debian/dsf-in/[a-z]*))
29 conffiles: $(CRONDFILES) $(DIRSFILES) $(LINKSFILES) $(INSTALLFILES) $(DOCSFILES) $(DSFINFILES) debian/control
31 debian/$(PACKAGE)-%.cron.d:
32 (cat $(CURDIR)/packaging/cron.d/00phpcron ; sed -e 's/\$$FFUSER/$(PACKAGE)/g' $(CURDIR)/packaging/cron.d/$*) > $@
34 debian/$(PACKAGE)-%.dirs:
35 cp $(CURDIR)/packaging/dirs/$* $@
37 debian/$(PACKAGE)-%.links:
38 cp $(CURDIR)/packaging/links/$* $@
40 debian/$(PACKAGE)-%.install:
41 cp $(CURDIR)/packaging/install/$* $@
43 debian/$(PACKAGE)-%.docs:
44 cp $(CURDIR)/packaging/docs/$* $@
46 debian/control: $(wildcard packaging/control/*)
47 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) > $@
49 debian/po/templates.pot: $(wildcard debian/dsf-in/*.templates.dsfh-in) $(wildcard debian/dsf-helper/*.templates)
50 @debconf-updatepo --podir=debian/dsf-po
53 cat $(patsubst debian/po/%,debian/dsf-po/%,$@) | $(SED_REPLACE) > $@
55 # postinst and prerm files
57 cat $(patsubst debian/$(PACKAGE)-%,debian/dsf-in/%,$@) | $(SED_REPLACE) > $@
59 build: debian/po/templates.pot conffiles
61 # Build gettext *.mo files
62 utils/manage-translations.sh build
66 rm -f $(CURDIR)/debian/*.cron.d
67 rm -f $(CURDIR)/debian/*.dirs
68 rm -f $(CURDIR)/debian/*.links
69 rm -f $(CURDIR)/debian/*.install
70 rm -f $(CURDIR)/debian/*.docs
71 rm -f $(CURDIR)/debian/*.postinst
72 rm -f $(CURDIR)/debian/*.prerm
77 find $(PKGDIR) -type f -or -type l | grep -v '/CVS/' | \
78 grep -v '/.svn/' | grep -v '/.testbox/' | \
79 grep -v rpm-specific | grep -v docs/phpdoc/docs | \
80 grep -v ^./debian/ | grep -v \\.jar$$ | \
81 grep -v \\.pdf$$ | grep -v plugins/fckeditor/www/_samples | \
82 cpio -o -H ustar | gzip > ../$(ORIGFILE)