2 # Note that I have to refer to debhelper programs with ./, to make sure
3 # I run the most current ones.
5 # This is _not_ a good example of a debhelper rules file, but I didn't need
6 # to tell you that; just see the 25 lines of inlined perl below..
7 # See examples/ for some good examples.
9 # Ensure that builds are self-hosting, which means I have to use the .pm
10 # files in this package, not any that may be on the system.
13 # If any automatic script generation is done in building this package,
14 # be sure to use the new templates from this package.
15 export DH_AUTOSCRIPTDIR=autoscripts
17 # Figure out the `current debhelper version.
18 VERSION=$(shell expr "`dpkg-parsechangelog 2>/dev/null |grep Version:`" : '.*Version: \(.*\)')
20 PERLLIBDIR=$(shell perl -MConfig -e 'print $$Config{vendorlib}')
25 build: test build-stamp
27 # Generate the main man page. All the perl cruft is to get a list
28 # of debhelper commands with short descriptions into the man page.
29 pod2man -c Debhelper -r "$(VERSION)" debhelper.pod | \
33 open (IN, $$_) or die "$$_: $$!"; \
36 if ($$file=~m/=head1 NAME\n\n(.*?) - (.*?)\n/m) { \
37 $$collect.=".IP $$1(1)\n$$2\n"; \
42 s/#LIST#/$$collect/; \
45 }' `find . -type f -perm +1 -maxdepth 1 -name "dh_*" | sort` > debhelper.1
46 # Turn all executables into man pages.
47 find . -type f -perm +1 -maxdepth 1 -name "dh_*" \
48 -exec pod2man -c Debhelper -r "$(VERSION)" {} {}.1 \;
54 -./dh_clean *.1 *-stamp
59 DH_VERSION=10 perl -MTest::Harness -e 'runtests grep { ! /CVS/ } @ARGV' t/*
63 # Build architecture-dependent files here.
67 # Build architecture-independent files here.
72 ./dh_installdirs usr/bin usr/share/debhelper \
73 $(PERLLIBDIR)/Debian/Debhelper
75 printf "package Debian::Debhelper::Dh_Version;\n\$$version='$(VERSION)';" > \
76 debian/debhelper/$(PERLLIBDIR)/Debian/Debhelper/Dh_Version.pm
78 find . -perm +111 -maxdepth 1 -type f -not -name "*.pl" \
79 -exec install -p {} debian/debhelper/usr/bin \;
80 cp -a Debian/Debhelper/*.pm \
81 debian/debhelper/$(PERLLIBDIR)/Debian/Debhelper/
82 cp -a autoscripts debian/debhelper/usr/share/debhelper
83 rm -rf debian/debhelper/usr/share/debhelper/autoscripts/CVS
85 ./dh_installdocs `find doc -type f | grep -v CVS`
86 ./dh_installexamples `find examples -type f | grep -v CVS`
90 ./dh_installchangelogs
101 # Update the debhelper web page. Not intended for use by anyone except the
104 cp debian/changelog /home/pub/programs/debhelper/CHANGES
105 echo -n $(VERSION) > /home/pub/programs/debhelper/LATEST-VERSION-IS
107 binary: binary-indep binary-arch
108 .PHONY: build clean binary-indep binary-arch binary dist