2 # This is _not_ a good example of a debhelper rules file.
3 # See examples/ for some good examples.
5 # This generates a list of synopses of debhelper commands, and substitutes
6 # it in to the #LIST# line on the man page fed to it on stdin. Must be passed
7 # parameters of all the executables or pod files to get the synopses from.
8 # (Like I said, this is not a good example of a debhelper rules file..)
9 # For correct conversion of pod tag (like S< >) #LIST# must be substituted in
10 # pod file and not in the troff file
11 MAKEMANLIST=perl -e ' \
14 open (IN, $$_) or die "$$_: $$!"; \
17 if ($$file=~m/=head1 .*?\n\n(.*?) - (.*?)\n\n/s) { \
18 $$collect.="=item $$1(1)\n\n$$2\n\n"; \
23 s/\#LIST\#/$$collect/; \
28 # Figure out the `current debhelper version.
29 VERSION=$(shell expr "`dpkg-parsechangelog 2>/dev/null |grep Version:`" : '.*Version: \(.*\)')
31 PERLLIBDIR=$(shell perl -MConfig -e 'print $$Config{vendorlib}')
33 POD2MAN=pod2man -c Debhelper -r "$(VERSION)"
35 build: test build-stamp
37 # Build all the man pages then generate LIST before convert to man
38 find . -maxdepth 1 -type f -perm +100 -name "dh_*" \
39 -exec $(POD2MAN) {} {}.1 \;
41 $(MAKEMANLIST) `find . -maxdepth 1 -type f -perm +100 -name "dh_*" | sort` | \
42 $(POD2MAN) --section=7 > debhelper.7
44 # Generate translated files .pod from <ll>.po and put them in man/<ll> directories
46 # Generate dh_*.pod then generate LIST before convert to man
48 for dir in man/*; do \
49 lang=`basename $$dir`; \
50 for file in $$dir/dh_*.pod; do \
51 prog=`basename $$file | sed 's/.pod//'`; \
52 $(POD2MAN) $$file $$prog.$$lang.1; \
54 cat $$dir/debhelper.pod | \
55 $(MAKEMANLIST) `find $$dir -type f -maxdepth 1 -name "dh_*.pod" | sort` | \
56 $(POD2MAN) --section=7 > debhelper.$$lang.7; \
59 printf "package Debian::Debhelper::Dh_Version;\n\$$version='$(VERSION)';" > \
60 Debian/Debhelper/Dh_Version.pm
66 ./run dh_clean *.1 *.7 *-stamp Debian/Debhelper/Dh_Version.pm
71 ./run perl -MTest::Harness -e 'runtests grep { ! /CVS/ && ! /\.svn/ } @ARGV' t/*
79 ./run dh_install -X .1 dh_* usr/bin
80 ./run dh_install Debian/Debhelper/*.pm $(PERLLIBDIR)/Debian/Debhelper/
81 ./run dh_install autoscripts usr/share/debhelper
82 ./run dh_installdocs doc/*
83 ./run dh_installexamples examples/*
84 ./run dh_installman *.1 *.7
85 ./run dh_installchangelogs
96 # Update the debhelper web page. Not intended for use by anyone except the
98 DIR=/home/web/kitenet.net/programs/debhelper
100 cp debian/changelog $(DIR)/CHANGES
101 echo -n $(VERSION) > $(DIR)/LATEST-VERSION-IS
104 binary: binary-indep binary-arch
105 .PHONY: build clean binary-indep binary-arch binary