#!/usr/bin/make -f # This is _not_ a good example of a debhelper rules file. # See examples/ for some good examples. # This generates a list of synopses of debhelper commands, and substitutes # it in to the #LIST# line on the man page fed to it on stdin. Must be passed # parameters of all the executables or pod files to get the synopses from. # (Like I said, this is not a good example of a debhelper rules file..) # For correct conversion of pod tag (like S< >) #LIST# must be substituted in # pod file and not in the troff file MAKEMANLIST=perl -e ' \ undef $$/; \ foreach (@ARGV) { \ open (IN, $$_) or die "$$_: $$!"; \ $$file=; \ close IN; \ if ($$file=~m/=head1 .*?\n\n(.*?) - (.*?)\n\n/s) { \ $$collect.="=item $$1(1)\n\n$$2\n\n"; \ } \ } \ END { \ while () { \ s/\#LIST\#/$$collect/; \ print; \ }; \ }' # Figure out the `current debhelper version. VERSION=$(shell expr "`dpkg-parsechangelog 2>/dev/null |grep Version:`" : '.*Version: \(.*\)') PERLLIBDIR=$(shell perl -MConfig -e 'print $$Config{vendorlib}') POD2MAN=pod2man -c Debhelper -r "$(VERSION)" build: test build-stamp build-stamp: # Build all the man pages then generate LIST before convert to man find . -maxdepth 1 -type f -perm +100 -name "dh_*" \ -exec $(POD2MAN) {} {}.1 \; cat debhelper.pod | \ $(MAKEMANLIST) `find . -maxdepth 1 -type f -perm +100 -name "dh_*" | sort` | \ $(POD2MAN) --section=7 > debhelper.7 # Translated pages. # Generate translated files .pod from .po and put them in man/ directories po4a po/po4a.cfg # Generate dh_*.pod then generate LIST before convert to man set -e; \ for dir in man/*; do \ lang=`basename $$dir`; \ for file in $$dir/dh_*.pod; do \ prog=`basename $$file | sed 's/.pod//'`; \ $(POD2MAN) $$file $$prog.$$lang.1; \ done; \ cat $$dir/debhelper.pod | \ $(MAKEMANLIST) `find $$dir -type f -maxdepth 1 -name "dh_*.pod" | sort` | \ $(POD2MAN) --section=7 > debhelper.$$lang.7; \ done printf "package Debian::Debhelper::Dh_Version;\n\$$version='$(VERSION)';" > \ Debian/Debhelper/Dh_Version.pm touch build-stamp clean: ./run dh_testdir ./run dh_testroot ./run dh_clean *.1 *.7 *-stamp Debian/Debhelper/Dh_Version.pm test: test-stamp test-stamp: ./run dh_clean ./run perl -MTest::Harness -e 'runtests grep { ! /CVS/ && ! /\.svn/ } @ARGV' t/* ./run dh_clean touch test-stamp binary-indep: build ./run dh_testdir ./run dh_testroot ./run dh_clean -k ./run dh_install -X .1 dh_* usr/bin ./run dh_install Debian/Debhelper/*.pm $(PERLLIBDIR)/Debian/Debhelper/ ./run dh_install autoscripts usr/share/debhelper ./run dh_installdocs doc/* ./run dh_installexamples examples/* ./run dh_installman *.1 *.7 ./run dh_installchangelogs ./run dh_shlibdeps ./run dh_link ./run dh_compress ./run dh_fixperms ./run dh_perl ./run dh_installdeb ./run dh_gencontrol ./run dh_md5sums ./run dh_builddeb # Update the debhelper web page. Not intended for use by anyone except the # author. DIR=/home/web/kitenet.net/programs/debhelper installhook: cp debian/changelog $(DIR)/CHANGES echo -n $(VERSION) > $(DIR)/LATEST-VERSION-IS binary-arch: binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary