]> git.donarmstrong.com Git - debhelper.git/blob - debian/rules
r1763: releasing version 4.9.0
[debhelper.git] / debian / rules
1 #!/usr/bin/make -f
2 # This is _not_ a good example of a debhelper rules file.
3 # See examples/ for some good examples.
4
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 MAKEMANLIST=perl -e ' \
10                 undef $$/; \
11                 foreach (@ARGV) { \
12                         open (IN, $$_) or die "$$_: $$!"; \
13                         $$file=<IN>; \
14                         close IN; \
15                         if ($$file=~m/=head1 .*\n\n(.*?) - (.*?)\n/m) { \
16                                 $$collect.=".IP $$1(1)\n$$2\n"; \
17                         } \
18                 } \
19                 END { \
20                         while (<STDIN>) { \
21                                 s/\#LIST\#/$$collect/; \
22                                 print; \
23                         }; \
24                 }'
25
26 # Figure out the `current debhelper version.
27 VERSION=$(shell expr "`dpkg-parsechangelog 2>/dev/null |grep Version:`" : '.*Version: \(.*\)')
28
29 PERLLIBDIR=$(shell perl -MConfig -e 'print $$Config{vendorlib}')
30
31 POD2MAN=pod2man -c Debhelper -r "$(VERSION)"
32
33 build: test build-stamp
34 build-stamp:
35         # Build all the man pages.
36         find . -type f -perm +100 -maxdepth 1 -name "dh_*" \
37                 -exec $(POD2MAN) {} {}.1 \;
38         $(POD2MAN) --section=7 debhelper.pod | \
39                 $(MAKEMANLIST) `find . -type f -perm +100 -maxdepth 1 -name "dh_*" | sort` > debhelper.7
40         # Translated pages.
41         set -e; \
42         for dir in man/*; do \
43                 lang=`basename $$dir`; \
44                 for file in $$dir/dh_*.pod; do \
45                         prog=`basename $$file | sed 's/.pod//'`; \
46                         $(POD2MAN) $$file $$prog.$$lang.1; \
47                 done; \
48                 $(POD2MAN) --section=7 $$dir/debhelper.pod | \
49                         $(MAKEMANLIST) `find $$dir -type f -maxdepth 1 -name "dh_*.pod" | sort` > debhelper.$$lang.7; \
50         done
51         
52         printf "package Debian::Debhelper::Dh_Version;\n\$$version='$(VERSION)';" > \
53                 Debian/Debhelper/Dh_Version.pm
54         touch build-stamp
55
56 clean:
57         ./run dh_testdir
58         ./run dh_testroot
59         ./run dh_clean *.1 *.7 *-stamp Debian/Debhelper/Dh_Version.pm
60
61 test: test-stamp
62 test-stamp:
63         ./run dh_clean
64         ./run perl -MTest::Harness -e 'runtests grep { ! /CVS/ && ! /\.svn/ } @ARGV' t/*
65         ./run dh_clean
66         touch test-stamp
67
68 binary-indep: build
69         ./run dh_testdir
70         ./run dh_testroot
71         ./run dh_clean -k
72         ./run dh_install -X .1 dh_* usr/bin
73         ./run dh_install Debian/Debhelper/*.pm $(PERLLIBDIR)/Debian/Debhelper/
74         ./run dh_install autoscripts usr/share/debhelper
75         ./run dh_installdocs doc/*
76         ./run dh_installexamples examples/*
77         ./run dh_installman *.1 *.7
78         ./run dh_installchangelogs
79         ./run dh_shlibdeps
80         ./run dh_link
81         ./run dh_compress
82         ./run dh_fixperms
83         ./run dh_perl
84         ./run dh_installdeb
85         ./run dh_gencontrol
86         ./run dh_md5sums
87         ./run dh_builddeb
88
89 # Update the debhelper web page. Not intended for use by anyone except the
90 # author.
91 DIR=/home/web/kitenet.net/programs/debhelper
92 installhook:
93         cp debian/changelog $(DIR)/CHANGES
94         echo -n $(VERSION) > $(DIR)/LATEST-VERSION-IS
95
96 binary-arch:
97 binary: binary-indep binary-arch
98 .PHONY: build clean binary-indep binary-arch binary