1 # This generates a list of synopses of debhelper commands, and substitutes
2 # it in to the #LIST# line on the man page fed to it on stdin. Must be passed
3 # parameters of all the executables or pod files to get the synopses from.
4 # For correct conversion of pod tags (like S< >) #LIST# must be substituted in
5 # the pod file and not in the troff file.
6 MAKEMANLIST=perl -e ' \
9 open (IN, $$_) or die "$$_: $$!"; \
12 if ($$file=~m/=head1 .*?\n\n(.*?) - (.*?)\n\n/s) { \
13 $$collect.="=item $$1(1)\n\n$$2\n\n"; \
18 s/\#LIST\#/$$collect/; \
23 # Figure out the `current debhelper version.
24 VERSION=$(shell expr "`dpkg-parsechangelog |grep Version:`" : '.*Version: \(.*\)')
26 PERLLIBDIR=$(shell perl -MConfig -e 'print $$Config{vendorlib}')/Debian/Debhelper
28 POD2MAN=pod2man -c Debhelper -r "$(VERSION)"
30 DH_AUTO_POD=man/dh_auto_pod
32 # l10n to be built is determined from .po files
33 LANGS=$(notdir $(basename $(wildcard man/po4a/po/*.po)))
36 find . -maxdepth 1 -type f -perm +100 -name "dh*" -a ! -name "dh_auto*" \
37 -exec $(POD2MAN) {} {}.1 \;
39 $(MAKEMANLIST) `find . -maxdepth 1 -type f -perm +100 -name "dh_*" | sort` | \
40 $(POD2MAN) --name="debhelper" --section=7 > debhelper.7
41 # Generate dh_auto program PODs and manual pages
42 ./run find . -maxdepth 1 -type f -perm +100 -name "dh_auto_*" \
43 -exec $(DH_AUTO_POD) {} -oman/{}.pod \;
44 cd man; for pod in dh_auto_*.pod; do $(POD2MAN) --section=1 $$pod "../$${pod%.pod}.1"; done
45 # Generate dh_auto POD and manual page
46 ./run $(DH_AUTO_POD) -oman/dh_auto.pod
47 $(POD2MAN) --section=7 man/dh_auto.pod dh_auto.7
48 # Generate dh_auto build system manual pages
49 find Debian/Debhelper/Buildsystem -maxdepth 1 -type f -name "*.pm" \
50 -exec sh -c 'n=`basename {}`;n=$${n%.pm}; $(POD2MAN) --section=7 --name dh_auto_$$n {} dh_auto_$$n.7' \;
52 po4a -L UTF-8 man/po4a/po4a.cfg
54 for lang in $(LANGS); do \
56 for file in $$dir/dh*.pod; do \
57 prog=`basename $$file | sed 's/.pod//'`; \
58 $(POD2MAN) $$file $$prog.$$lang.1; \
60 cat $$dir/debhelper.pod | \
61 $(MAKEMANLIST) `find $$dir -type f -maxdepth 1 -name "dh_*.pod" | sort` | \
62 $(POD2MAN) --name="debhelper" --section=7 > debhelper.$$lang.7; \
66 printf "package Debian::Debhelper::Dh_Version;\n\$$version='$(VERSION)';\n1" > \
67 Debian/Debhelper/Dh_Version.pm
70 rm -f *.1 *.7 man/dh_auto*.pod Debian/Debhelper/Dh_Version.pm
71 po4a --rm-translations --rm-backups man/po4a/po4a.cfg
72 for lang in $(LANGS); do \
73 if [ -e man/$$lang ]; then rmdir man/$$lang; fi; \
77 install -d $(DESTDIR)/usr/bin \
78 $(DESTDIR)/usr/share/debhelper/autoscripts \
79 $(DESTDIR)$(PERLLIBDIR)/Sequence \
80 $(DESTDIR)$(PERLLIBDIR)/Buildsystem
81 install $(shell find -maxdepth 1 -mindepth 1 -name dh\* -executable |grep -v \.1\$$) $(DESTDIR)/usr/bin
82 install -m 0644 autoscripts/* $(DESTDIR)/usr/share/debhelper/autoscripts
83 install -m 0644 Debian/Debhelper/*.pm $(DESTDIR)$(PERLLIBDIR)
84 install -m 0644 Debian/Debhelper/Sequence/*.pm $(DESTDIR)$(PERLLIBDIR)/Sequence
85 install -m 0644 Debian/Debhelper/Buildsystem/*.pm $(DESTDIR)$(PERLLIBDIR)/Buildsystem
88 ./run perl -MTest::Harness -e 'runtests grep { ! /CVS/ && ! /\.svn/ && -f && -x } @ARGV' t/* t/buildsystems/*