]> git.donarmstrong.com Git - debhelper.git/blob - debian/rules
r443: * Build-depends on perl-5.6, since it uses 2 argument pod2man.
[debhelper.git] / debian / rules
1 #!/usr/bin/make -f
2 # Note that I have to refer to debhelper programs with ./, to make sure
3 # I run the most current ones.
4 #
5 # This is _not_ a good example of a debhelper rules file, but I didn't need
6 # to tell you that; just see the 25 lines of inlined perl below.. 
7 # See examples/ for some good examples.
8
9 # Ensure that builds are self-hosting, which means I have to use the .pm
10 # files in this package, not any that may be on the system.
11 export PERL5LIB=.
12
13 # If any automatic script generation is done in building this package, 
14 # be sure to use the new templates from this package.
15 export DH_AUTOSCRIPTDIR=autoscripts
16
17 # Use most recent compatability level.
18 export DH_COMPAT=3
19
20 # Figure out the current debhelper version.
21 VERSION=$(shell expr "`dpkg-parsechangelog 2>/dev/null |grep Version:`" : '.*Version: \(.*\)')
22
23 # Debug
24 #export DH_VERBOSE=1
25
26 build: test build-stamp
27 build-stamp:
28         # Generate the main man page. All the perl cruft is to get a list
29         # of debhelper commands with short descriptions into the man page.
30         pod2man -c Debhelper -r "$(VERSION)" debhelper.pod | \
31         perl -e ' \
32                 undef $$/; \
33                 foreach (@ARGV) { \
34                         open (IN, $$_) or die "$$_: $$!"; \
35                         $$file=<IN>; \
36                         close IN; \
37                         if ($$file=~m/=head1 NAME\n\n(.*?) - (.*?)\n/m) { \
38                                 $$collect.=".IP $$1(1)\n$$2\n"; \
39                         } \
40                 } \
41                 END { \
42                         while (<STDIN>) { \
43                                 s/#LIST#/$$collect/; \
44                                 print; \
45                         }; \
46                 }' `find . -type f -perm +1 -maxdepth 1 -name "dh_*"` > debhelper.1
47         # Turn all executables into man pages.
48         find . -type f -perm +1 -maxdepth 1 -name "dh_*" \
49                 -exec pod2man -c Debhelper -r "$(VERSION)" {} {}.1 \;
50         touch build-stamp
51
52 clean:
53         ./dh_testdir
54         ./dh_testroot
55         -./dh_clean *.1 *-stamp
56
57 test: test-stamp
58 test-stamp:
59         ./dh_clean
60         DH_VERSION=10 perl -MTest::Harness -e 'runtests grep { ! /CVS/ } @ARGV' t/*
61         ./dh_clean
62         touch test-stamp
63
64 # Build architecture-dependent files here.
65 binary-arch: build
66 # Nothing to do.
67
68 # Build architecture-independent files here.
69 binary-indep: build
70         ./dh_testdir
71         ./dh_testroot
72         ./dh_clean -k
73         ./dh_installdirs usr/bin usr/share/debhelper \
74                 usr/lib/perl5/Debian/Debhelper
75
76         echo -e "package Debian::Debhelper::Dh_Version;\n\$$version='$(VERSION)';" > \
77                 debian/debhelper/usr/lib/perl5/Debian/Debhelper/Dh_Version.pm
78         find . -perm +111 -maxdepth 1 -type f -not -name "*.pl" \
79                 -exec install -p {} debian/debhelper/usr/bin \;
80         cp -a Debian/Debhelper/*.pm \
81                 debian/debhelper/usr/lib/perl5/Debian/Debhelper/
82         cp -a autoscripts debian/debhelper/usr/share/debhelper
83         rm -rf debian/debhelper/usr/share/debhelper/autoscripts/CVS
84
85         ./dh_installdocs `find doc -type f | grep -v CVS`
86         ./dh_installexamples `find examples -type f | grep -v CVS`
87         ./dh_installmenu
88         ./dh_installman *.1
89         ./dh_installinfo
90         ./dh_installchangelogs
91         ./dh_link
92         ./dh_compress
93         ./dh_fixperms
94         ./dh_installdeb
95         ./dh_gencontrol
96         ./dh_md5sums
97         ./dh_builddeb
98
99 # Update the debhelper web page. Not intended for use by anyone except the
100 # author.
101 installhook:
102         cp debian/changelog /home/pub/programs/debhelper/CHANGES
103         echo -n $(VERSION) > /home/pub/programs/debhelper/LATEST-VERSION-IS
104
105 binary: binary-indep binary-arch
106 .PHONY: build clean binary-indep binary-arch binary dist
107