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.
38 # Build architecture-independent files here.
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
51 ./dh_installdocs doc/*
52 ./dh_installexamples examples/*
56 # Fix up all man pages, filling in the modification time for them.
57 # Note this runs beofre the command below so debhelper.1 gets the right
60 foreach $$f (@ARGV) { \
62 $$date=POSIX::strftime("%d %B %Y",localtime($$data[9])); \
66 $$lines[0]=~s/1 ""/1 "$$date"/; \
70 }' debian/debhelper/usr/man/man1/*.1
71 # Fix up the debhelper.1 man page, substituting in a list of all
72 # debhelper commands. eek!
75 $$collect.=".TP\n.BR $$_" if $$. eq 3 && /^dh_/; \
78 open(I,"debian/debhelper/usr/man/man1/debhelper.1"); \
81 open(O,">debian/debhelper/usr/man/man1/debhelper.1"); \
83 s/#LIST#/$$collect/; \
88 ./dh_installchangelogs
99 # Install in the proper location on my ftp server and web server. Not intended
100 # for use by anyone except the author.
101 OLD_VER=$(shell perl -e '<>;<>;while(<>){last if /^ --/};<>;$$_=<>;print m/\((.*?)\)/'<debian/changelog)
103 dpkg-buildpackage -rfakeroot -tc
104 if [ `hostname` = 'kite' ] ; then \
105 cp ../debhelper_$(VERSION).tar.gz ../../public; \
106 rm /home/ftp/pub/code/debhelper/* || true; \
107 cp debian/changelog /home/pub/programs/debhelper/CHANGES; \
108 echo $(VERSION) > /home/pub/programs/debhelper/LATEST-VERSION-IS; \
109 cd ..; rm -rf debhelper-$(OLD_VER); \
110 [ -f ../public/debhelper_$(OLD_VER).tar.gz ] && \
111 tar zxf ../public/debhelper_$(OLD_VER).tar.gz || \
112 tar zxf ../outdated/debhelper_$(OLD_VER).tar.gz; \
113 diff -r -u --new-file debhelper-$(OLD_VER) debhelper-$(VERSION) > \
114 /home/ftp/pub/code/debhelper/diffs/debhelper-$(VERSION).diff; \
115 gzip -9f /home/ftp/pub/code/debhelper/diffs/debhelper-$(VERSION).diff; \
116 cd /tmp; rm -f debhelper-$(OLD-VER); \
119 binary: binary-indep binary-arch
120 .PHONY: build clean binary-indep binary-arch binary dist