]> git.donarmstrong.com Git - debhelper.git/blob - debian/rules
r441: * Added dh_installman, a new program that replaces dh_installmanpages.
[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         # Turn all executables and .pod files into man pages.
29         find . \( \( -type f -perm +1 -maxdepth 1 \) -or \
30                   \( -type f -name '*.pod' \) \) \
31                 -exec pod2man -c Debhelper -r "$(VERSION)" {} {}.1 \;
32         mv -f debhelper.pod.1 debhelper.1
33         # Fix up the debhelper.1 man page, substituting in a list of all
34         # debhelper commands. Eek!
35         perl -e ' \
36                 undef $$/; \
37                 foreach (@ARGV) { \
38                         open (IN, $$_) or die "$$_: $$!"; \
39                         $$file=<IN>; \
40                         close IN; \
41                         if ($$file=~m/=head1 NAME\n\n(.*?) - (.*?)\n/m) { \
42                                 $$collect.=".IP $$1(1)\n$$2\n"; \
43                         } \
44                 } \
45                 END { \
46                         open(IN,"debhelper.1") or die "debhelper.1: $$!"; \
47                         $$file=<IN>; \
48                         open(OUT,">debhelper.1") or die "debhelper.1: $$!";; \
49                         $$file=~s/#LIST#/$$collect/; \
50                         print OUT $$file; \
51                         close OUT; \
52                 }' dh_*
53         touch build-stamp
54
55 clean:
56         ./dh_testdir
57         ./dh_testroot
58         -./dh_clean *.1 *-stamp
59
60 test: test-stamp
61 test-stamp:
62         ./dh_clean
63         DH_VERSION=10 perl -MTest::Harness -e 'runtests grep { ! /CVS/ } @ARGV' t/*
64         ./dh_clean
65         touch test-stamp
66
67 # Build architecture-dependent files here.
68 binary-arch: build
69 # Nothing to do.
70
71 # Build architecture-independent files here.
72 binary-indep: build
73         ./dh_testdir
74         ./dh_testroot
75         ./dh_clean -k
76         ./dh_installdirs usr/bin usr/share/debhelper \
77                 usr/lib/perl5/Debian/Debhelper
78
79         echo -e "package Debian::Debhelper::Dh_Version;\n\$$version='$(VERSION)';" > \
80                 debian/debhelper/usr/lib/perl5/Debian/Debhelper/Dh_Version.pm
81         find . -perm +111 -maxdepth 1 -type f -not -name "*.pl" \
82                 -exec install -p {} debian/debhelper/usr/bin \;
83         cp -a Debian/Debhelper/*.pm \
84                 debian/debhelper/usr/lib/perl5/Debian/Debhelper/
85         cp -a autoscripts debian/debhelper/usr/share/debhelper
86         rm -rf debian/debhelper/usr/share/debhelper/autoscripts/CVS
87
88         ./dh_installdocs `find doc -type f | grep -v CVS`
89         ./dh_installexamples `find examples -type f | grep -v CVS`
90         ./dh_installmenu
91         ./dh_installman *.1
92         ./dh_installinfo
93         ./dh_installchangelogs
94         ./dh_link
95         ./dh_compress
96         ./dh_fixperms
97         ./dh_installdeb
98         ./dh_gencontrol
99         ./dh_md5sums
100         ./dh_builddeb
101
102 # Update the debhelper web page. Not intended for use by anyone except the
103 # author.
104 installhook:
105         cp debian/changelog /home/pub/programs/debhelper/CHANGES
106         echo -n $(VERSION) > /home/pub/programs/debhelper/LATEST-VERSION-IS
107
108 binary: binary-indep binary-arch
109 .PHONY: build clean binary-indep binary-arch binary dist
110