1 # List of files of dh_* commands. Sorted for debhelper man page.
2 COMMANDS=$(shell find . -maxdepth 1 -type f -perm +100 -name "dh_*" -printf "%f\n" | sort)
4 # Find deprecated commands by looking at their synopsis.
5 DEPRECATED=$(shell egrep -l '^dh_.* - .*deprecated' $(COMMANDS))
7 # This generates a list of synopses of debhelper commands, and substitutes
8 # it in to the #LIST# line on the man page fed to it on stdin. Must be passed
9 # parameters of all the executables or pod files to get the synopses from.
10 # For correct conversion of pod tags (like S< >) #LIST# must be substituted in
11 # the pod file and not in the troff file.
12 MAKEMANLIST=perl -e ' \
15 open (IN, $$_) or die "$$_: $$!"; \
18 if ($$file=~m/=head1 .*?\n\n(.*?) - (.*?)\n\n/s) { \
19 my $$item="=item $$1(1)\n\n$$2\n\n"; \
20 if (" $(DEPRECATED) " !~ / $$1 /) { \
24 $$list_deprecated.=$$item; \
31 s/\#LIST_DEPRECATED\#/$$list_deprecated/; \
36 # Figure out the `current debhelper version.
37 VERSION=$(shell expr "`dpkg-parsechangelog |grep Version:`" : '.*Version: \(.*\)')
39 PERLLIBDIR=$(shell perl -MConfig -e 'print $$Config{vendorlib}')/Debian/Debhelper
41 POD2MAN=pod2man --utf8 -c Debhelper -r "$(VERSION)"
43 # l10n to be built is determined from .po files
44 LANGS=$(notdir $(basename $(wildcard man/po4a/po/*.po)))
46 build: version debhelper.7
47 find . -maxdepth 1 -type f -perm +100 -name "dh*" \
48 -exec $(POD2MAN) {} {}.1 \;
49 po4a --previous -L UTF-8 man/po4a/po4a.cfg
51 for lang in $(LANGS); do \
53 for file in $$dir/dh*.pod; do \
54 prog=`basename $$file | sed 's/.pod//'`; \
55 $(POD2MAN) $$file $$prog.$$lang.1; \
57 if [ -e $$dir/debhelper.pod ]; then \
58 cat $$dir/debhelper.pod | \
59 $(MAKEMANLIST) `find $$dir -type f -maxdepth 1 -name "dh_*.pod" | sort` | \
60 $(POD2MAN) --name="debhelper" --section=7 > debhelper.$$lang.7; \
65 printf "package Debian::Debhelper::Dh_Version;\n\$$version='$(VERSION)';\n1" > \
66 Debian/Debhelper/Dh_Version.pm
68 debhelper.7: debhelper.pod
70 $(MAKEMANLIST) $(COMMANDS) | \
71 $(POD2MAN) --name="debhelper" --section=7 > debhelper.7
74 rm -f *.1 *.7 Debian/Debhelper/Dh_Version.pm
75 po4a --previous --rm-translations --rm-backups man/po4a/po4a.cfg
76 for lang in $(LANGS); do \
77 if [ -e man/$$lang ]; then rmdir man/$$lang; fi; \
81 install -d $(DESTDIR)/usr/bin \
82 $(DESTDIR)/usr/share/debhelper/autoscripts \
83 $(DESTDIR)$(PERLLIBDIR)/Sequence \
84 $(DESTDIR)$(PERLLIBDIR)/Buildsystem
85 install dh $(COMMANDS) $(DESTDIR)/usr/bin
86 install -m 0644 autoscripts/* $(DESTDIR)/usr/share/debhelper/autoscripts
87 install -m 0644 Debian/Debhelper/*.pm $(DESTDIR)$(PERLLIBDIR)
88 install -m 0644 Debian/Debhelper/Sequence/*.pm $(DESTDIR)$(PERLLIBDIR)/Sequence
89 install -m 0644 Debian/Debhelper/Buildsystem/*.pm $(DESTDIR)$(PERLLIBDIR)/Buildsystem
92 ./run perl -MTest::Harness -e 'runtests grep { ! /CVS/ && ! /\.svn/ && -f && -x } @ARGV' t/* t/buildsystems/*