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, but I didn't need
7 # to tell you that; just see the 25 lines of inlined perl below.. See
8 # examples/ for some good examples.
10 # If any automatic script generation is done in building this package,
11 # be sure to use the new templates from this package.
12 export DH_AUTOSCRIPTDIR=autoscripts
14 # Living dangerously :-)
17 # Figure out the current debhelper version.
18 VERSION=$(shell expr "`dpkg-parsechangelog 2>/dev/null |grep Version:`" : '.*Version: \(.*\)')
23 # Run regression tests.
33 DH_VERSION=10 perl -MTest::Harness -e 'runtests grep { ! /CVS/ } @ARGV' t/*
36 # Build architecture-dependent files here.
37 binary-arch: link-stamp build
40 # Build architecture-independent files here.
41 binary-indep: link-stamp build
45 ./dh_installdirs usr/bin usr/share/debhelper
47 echo -e "package Dh_Version;\n\$$version='$(VERSION)';" > debian/debhelper/usr/share/debhelper/Dh_Version.pm
48 find . -perm +111 -maxdepth 1 -type f -not -name "*.pl" \
49 -exec install -p {} debian/debhelper/usr/bin \;
50 cp -a Dh_*.pm debian/debhelper/usr/share/debhelper
51 cp -a autoscripts debian/debhelper/usr/share/debhelper
52 rm -rf debian/debhelper/usr/share/debhelper/autoscripts/CVS
54 ./dh_installdocs `find doc/ -type f | grep -v CVS`
55 ./dh_installexamples `find doc -type f | grep -v CVS`
59 # Fix up all man pages, filling in the modification time for them.
60 # Note this runs beofre the command below so debhelper.1 gets the right
63 foreach $$f (@ARGV) { \
65 $$date=POSIX::strftime("%d %B %Y",localtime($$data[9])); \
69 $$lines[0]=~s/1 ""/1 "$$date"/; \
73 }' debian/debhelper/usr/man/man1/*.1
74 # Fix up the debhelper.1 man page, substituting in a list of all
75 # debhelper commands. eek!
78 $$collect.=".TP\n.BR $$_" if $$. eq 3 && /^dh_/; \
81 open(I,"debian/debhelper/usr/man/man1/debhelper.1"); \
84 open(O,">debian/debhelper/usr/man/man1/debhelper.1"); \
86 s/#LIST#/$$collect/; \
91 ./dh_installchangelogs
102 # Install in the proper location on my ftp server and web server. Not intended
103 # for use by anyone except the author.
104 OLD_VER=$(shell perl -e '<>;<>;while(<>){last if /^ --/};<>;$$_=<>;print m/\((.*?)\)/'<debian/changelog)
105 dist: commit link-stamp
106 dpkg-buildpackage -rfakeroot -tc
107 if [ `hostname` = 'kite' ] ; then \
108 cp ../debhelper_$(VERSION).tar.gz ../../public; \
109 rm /home/ftp/pub/code/debhelper/* || true; \
110 cp debian/changelog /home/pub/programs/debhelper/CHANGES; \
111 echo $(VERSION) > /home/pub/programs/debhelper/LATEST-VERSION-IS; \
112 cd ..; rm -rf debhelper-$(OLD_VER); \
113 [ -f ../public/debhelper_$(OLD_VER).tar.gz ] && \
114 tar zxf ../public/debhelper_$(OLD_VER).tar.gz || \
115 tar zxf ../outdated/debhelper_$(OLD_VER).tar.gz; \
116 diff -r -u --new-file debhelper-$(OLD_VER) debhelper-$(VERSION) > \
117 /home/ftp/pub/code/debhelper/diffs/debhelper-$(VERSION).diff; \
118 gzip -9f /home/ftp/pub/code/debhelper/diffs/debhelper-$(VERSION).diff; \
119 cd /tmp; rm -f debhelper-$(OLD-VER); \
123 sh -e debian/fixlinks
126 # This is for local use - it tags the current code with the debian version
127 # number, then commits the current code using the contents of the changelog
128 # as the cvs changelog, then increments the version number
130 cvs -Q commit -m "`dpkg-parsechangelog | grep '^ '`"
131 cvs -Q tag rel-$(shell dpkg-parsechangelog | grep ^Version: \
132 |cut -d " " -f 2 |tr '.' '-')
135 # Update w/o editing.
136 EDITOR=true dch -i 2>/dev/null
137 # Dch has to change the bloody directory name. Feh.
140 binary: binary-indep binary-arch
141 .PHONY: build clean binary-indep binary-arch binary dist