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 # If any automatic script generation is done in building this package,
7 # be sure to use the new templates from this package.
8 export DH_AUTOSCRIPTDIR=autoscripts
10 # Figure out the current debhelper version.
11 VERSION=$(shell expr "`dpkg-parsechangelog 2>/dev/null |grep Version:`" : '.*Version: \(.*\)')
16 # Run regression tests.
26 perl -MTest::Harness -e 'runtests @ARGV' t/*
29 # Build architecture-dependent files here.
33 # Build architecture-independent files here.
38 ./dh_installdirs usr/bin usr/lib/debhelper
40 echo -e "package Dh_Version;\n\$$version='$(VERSION)';" > debian/tmp/usr/lib/debhelper/Dh_Version.pm
41 find . -perm +111 -maxdepth 1 -type f -not -name "*.pl" \
42 -exec install -p {} debian/tmp/usr/bin \;
43 cp -a Dh_*.pm debian/tmp/usr/lib/debhelper
44 cp -a autoscripts debian/tmp/usr/lib/debhelper
46 ./dh_installdocs doc/TODO doc/README doc/PROGRAMMING doc/from-debstd
47 ./dh_installexamples examples/*
50 # Fix up all man pages, filling in the modification time for them.
51 # Note this runs beofre the command below so debhelper.1 gets the right
54 foreach $$f (@ARGV) { \
56 $$date=POSIX::strftime("%d %B %Y",localtime($$data[9])); \
60 $$lines[0]=~s/1 ""/1 "$$date"/; \
64 }' debian/tmp/usr/man/man1/*.1
65 # Fix up the debhelper.1 man page, substituting in a list of all
66 # debhelper commands. eek!
69 $$collect.=".TP\n.BR $$_" if $$. eq 3 && /^dh_/; \
72 open(I,"debian/tmp/usr/man/man1/debhelper.1"); \
75 open(O,">debian/tmp/usr/man/man1/debhelper.1"); \
77 s/#LIST#/$$collect/; \
82 ./dh_installchangelogs
93 # Install in the proper location on my ftp server and web server. Not intended
94 # for use by anyone except the author.
95 OLD_VER=$(shell perl -e '<>;<>;while(<>){last if /^ --/};<>;$$_=<>;print m/\((.*?)\)/'<debian/changelog)
97 dpkg-buildpackage -rfakeroot -tc
98 if [ `hostname` = 'kite' ] ; then \
99 cp ../debhelper_$(VERSION).tar.gz ../../public; \
100 rm /home/ftp/pub/code/debhelper/* || true; \
101 cp debian/changelog /home/pub/programs/debhelper/CHANGES; \
102 echo $(VERSION) > /home/pub/programs/debhelper/LATEST-VERSION-IS; \
103 cd ..; rm -rf debhelper-$(OLD_VER); \
104 [ -f ../public/debhelper_$(OLD_VER).tar.gz ] && \
105 tar zxf ../public/debhelper_$(OLD_VER).tar.gz || \
106 tar zxf ../outdated/debhelper_$(OLD_VER).tar.gz; \
107 diff -r -u --new-file debhelper-$(OLD_VER) debhelper-$(VERSION) > \
108 /home/ftp/pub/code/debhelper/diffs/debhelper-$(VERSION).diff; \
109 gzip -9f /home/ftp/pub/code/debhelper/diffs/debhelper-$(VERSION).diff; \
110 cd /tmp; rm -f debhelper-$(OLD-VER); \
113 binary: binary-indep binary-arch
114 .PHONY: build clean binary-indep binary-arch binary dist