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.
6 # See examples/ for some good examples.
8 # Ensure that builds are self-hosting, which means I have to use the .pm
9 # files in this package, not any that may be on the system.
12 # If any automatic script generation is done in building this package,
13 # be sure to use the new templates from this package.
14 export DH_AUTOSCRIPTDIR=autoscripts
16 # This generates a list of synopses of debhelper commands, and substitutes
17 # it in to the #LIST# line on the man page fed to it on stdin. Must be passes
18 # parameters of all the executables or pod files to get the synopses from.
19 # (Like I said, this is not a good example of a debhelper rules file..)
20 MAKEMANLIST=perl -e ' \
23 open (IN, $$_) or die "$$_: $$!"; \
26 if ($$file=~m/=head1 .*\n\n(.*?) - (.*?)\n/m) { \
27 $$collect.=".IP $$1(1)\n$$2\n"; \
32 s/\#LIST\#/$$collect/; \
37 # Figure out the `current debhelper version.
38 VERSION=$(shell expr "`dpkg-parsechangelog 2>/dev/null |grep Version:`" : '.*Version: \(.*\)')
40 PERLLIBDIR=$(shell perl -MConfig -e 'print $$Config{vendorlib}')
42 POD2MAN=pod2man -c Debhelper -r "$(VERSION)"
44 build: test build-stamp
46 # Build all the man pages.
47 find . -type f -perm +100 -maxdepth 1 -name "dh_*" \
48 -exec $(POD2MAN) {} {}.1 \;
49 $(POD2MAN) --section=7 debhelper.pod | \
50 $(MAKEMANLIST) `find . -type f -perm +100 -maxdepth 1 -name "dh_*" | sort` > debhelper.7
53 for dir in man/*; do \
54 lang=`basename $$dir`; \
55 for file in $$dir/dh_*.pod; do \
56 prog=`basename $$file | sed 's/.pod//'`; \
57 $(POD2MAN) $$file $$prog.$$lang.1; \
59 $(POD2MAN) --section=7 $$dir/debhelper.pod | \
60 $(MAKEMANLIST) `find $$dir -type f -maxdepth 1 -name "dh_*.pod" | sort` > debhelper.$$lang.7; \
63 printf "package Debian::Debhelper::Dh_Version;\n\$$version='$(VERSION)';" > \
64 Debian/Debhelper/Dh_Version.pm
70 ./dh_clean *.1 *.7 *-stamp Debian/Debhelper/Dh_Version.pm
75 DH_VERSION=10 perl -MTest::Harness -e 'runtests grep { ! /CVS/ && ! /\.svn/ } @ARGV' t/*
83 ./dh_install -X .1 dh_* usr/bin
84 ./dh_install Debian/Debhelper/*.pm $(PERLLIBDIR)/Debian/Debhelper/
85 ./dh_install autoscripts usr/share/debhelper
86 ./dh_installdocs doc/*
87 ./dh_installexamples examples/*
88 ./dh_installman *.1 *.7
89 ./dh_installchangelogs
100 # Update the debhelper web page. Not intended for use by anyone except the
102 DIR=/home/web/kitenet.net/programs/debhelper
104 cp debian/changelog $(DIR)/CHANGES
105 echo -n $(VERSION) > $(DIR)/LATEST-VERSION-IS
108 binary: binary-indep binary-arch
109 .PHONY: build clean binary-indep binary-arch binary