2 # Note that I have to refer to debhelper programs with ./, to make sure
3 # I run the most current ones. That's also why there is a symlink to the
4 # current Dh_lib.pm and the current Dh_getopt.pm in this debian/ directory.
6 # This is _not_ a good example of a debhelper rules file.
8 # If any automatic script generation is done in building this package,
9 # be sure to use the new templates from this package.
10 export DH_AUTOSCRIPTDIR=autoscripts
12 # Living dangerously :-)
15 # Figure out the current debhelper version.
16 VERSION=$(shell expr "`dpkg-parsechangelog 2>/dev/null |grep Version:`" : '.*Version: \(.*\)')
21 # Run regression tests.
31 DH_VERSION=10 perl -MTest::Harness -e 'runtests grep { ! /CVS/ } @ARGV' t/*
34 # Build architecture-dependent files here.
35 binary-arch: link-stamp build
38 # Build architecture-independent files here.
39 binary-indep: link-stamp build
43 ./dh_installdirs usr/bin usr/share/debhelper
45 echo -e "package Dh_Version;\n\$$version='$(VERSION)';" > debian/debhelper/usr/share/debhelper/Dh_Version.pm
46 find . -perm +111 -maxdepth 1 -type f -not -name "*.pl" \
47 -exec install -p {} debian/debhelper/usr/bin \;
48 cp -a Dh_*.pm debian/debhelper/usr/share/debhelper
49 cp -a autoscripts debian/debhelper/usr/share/debhelper
50 rm -rf debian/debhelper/usr/share/debhelper/autoscripts/CVS
52 ./dh_installdocs `echo doc/* | grep -v CVS`
53 ./dh_installexamples `echo examples/* | grep -v CVS`
57 # Fix up all man pages, filling in the modification time for them.
58 # Note this runs beofre the command below so debhelper.1 gets the right
61 foreach $$f (@ARGV) { \
63 $$date=POSIX::strftime("%d %B %Y",localtime($$data[9])); \
67 $$lines[0]=~s/1 ""/1 "$$date"/; \
71 }' debian/debhelper/usr/man/man1/*.1
72 # Fix up the debhelper.1 man page, substituting in a list of all
73 # debhelper commands. eek!
76 $$collect.=".TP\n.BR $$_" if $$. eq 3 && /^dh_/; \
79 open(I,"debian/debhelper/usr/man/man1/debhelper.1"); \
82 open(O,">debian/debhelper/usr/man/man1/debhelper.1"); \
84 s/#LIST#/$$collect/; \
89 ./dh_installchangelogs
100 # Install in the proper location on my ftp server and web server. Not intended
101 # for use by anyone except the author.
102 OLD_VER=$(shell perl -e '<>;<>;while(<>){last if /^ --/};<>;$$_=<>;print m/\((.*?)\)/'<debian/changelog)
103 dist: commit link-stamp
104 dpkg-buildpackage -rfakeroot -tc
105 if [ `hostname` = 'kite' ] ; then \
106 cp ../debhelper_$(VERSION).tar.gz ../../public; \
107 rm /home/ftp/pub/code/debhelper/* || true; \
108 cp debian/changelog /home/pub/programs/debhelper/CHANGES; \
109 echo $(VERSION) > /home/pub/programs/debhelper/LATEST-VERSION-IS; \
110 cd ..; rm -rf debhelper-$(OLD_VER); \
111 [ -f ../public/debhelper_$(OLD_VER).tar.gz ] && \
112 tar zxf ../public/debhelper_$(OLD_VER).tar.gz || \
113 tar zxf ../outdated/debhelper_$(OLD_VER).tar.gz; \
114 diff -r -u --new-file debhelper-$(OLD_VER) debhelper-$(VERSION) > \
115 /home/ftp/pub/code/debhelper/diffs/debhelper-$(VERSION).diff; \
116 gzip -9f /home/ftp/pub/code/debhelper/diffs/debhelper-$(VERSION).diff; \
117 cd /tmp; rm -f debhelper-$(OLD-VER); \
121 sh -e debian/fixlinks
124 # This is for local use - it tags the current code with the debian version
125 # number, then commits the current code using the contents of the changelog
126 # as the cvs changelog, then increments the version number
128 cvs -Q commit -m "`dpkg-parsechangelog | grep '^ '`"
129 cvs -Q tag rel-$(shell dpkg-parsechangelog | grep ^Version: \
130 |cut -d " " -f 2 |tr '.' '-')
133 # Update w/o editing.
134 EDITOR=true dch -i 2>/dev/null
135 # Dch has to change the bloody directory name. Feh.
138 binary: binary-indep binary-arch
139 .PHONY: build clean binary-indep binary-arch binary dist