]> git.donarmstrong.com Git - debhelper.git/blob - debian/rules
r338: * Patch from Jorgen `forcer' Schaefer <forcer at mindless.com> (much
[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 # If any automatic script generation is done in building this package, 
10 # be sure to use the new templates from this package.
11 export DH_AUTOSCRIPTDIR=autoscripts
12
13 # Living dangerously :-)
14 export DH_COMPAT=2
15
16 # Figure out the current debhelper version.
17 VERSION=$(shell expr "`dpkg-parsechangelog 2>/dev/null |grep Version:`" : '.*Version: \(.*\)')
18
19 export DH_VERBOSE=1
20
21 build: link-stamp test
22 # Nothing to do.        
23
24 clean: link-stamp
25         ./dh_testdir
26         ./dh_testroot
27         ./dh_clean link-stamp
28
29 test: link-stamp
30         ./dh_clean
31         DH_VERSION=10 perl -MTest::Harness -e 'runtests grep { ! /CVS/ } @ARGV' t/*
32         ./dh_clean
33
34 # Build architecture-dependent files here.
35 binary-arch: link-stamp build
36 # Nothing to do.
37
38 # Build architecture-independent files here.
39 binary-indep: link-stamp build
40         ./dh_testdir
41         ./dh_testroot
42         ./dh_clean -k
43         ./dh_installdirs usr/bin usr/share/debhelper \
44                 usr/lib/perl5/Debian/Debhelper
45
46         echo -e "package Dh_Version;\n\$$version='$(VERSION)';" > \
47                 debian/debhelper/usr/lib/perl5/Debian/Debhelper/Dh_Version.pm
48         find . -perm +111 -maxdepth 1 -type f -not -name "*.pl" \
49                 -exec install -p {} debian/debhelper/usr/bin \;
50         cp -a Debian/Debhelper/*.pm \
51                 debian/debhelper/usr/lib/perl5/Debian/Debhelper/
52         cp -a autoscripts debian/debhelper/usr/share/debhelper
53         rm -rf debian/debhelper/usr/share/debhelper/autoscripts/CVS
54
55         ./dh_installdocs `find doc -type f | grep -v CVS`
56         ./dh_installexamples `find examples -type f | grep -v CVS`
57         ./dh_installmenu
58         ./dh_installmanpages
59         ./dh_installinfo
60         # Fix up all man pages, filling in the modification time for them.
61         # Note this runs beofre the command below so debhelper.1 gets the right
62         # date on it.
63         perl -mPOSIX -e ' \
64                 foreach $$f (@ARGV) { \
65                 @data=stat($$f); \
66                 $$date=POSIX::strftime("%d %B %Y",localtime($$data[9])); \
67                 open (IN,$$f); \
68                 @lines=<IN>; \
69                 close IN; \
70                 $$lines[0]=~s/1 ""/1 "$$date"/; \
71                 open (OUT,">$$f"); \
72                 print OUT @lines; \
73                 close OUT; \
74         }' debian/debhelper/usr/share/man/man1/*.1
75         # Fix up the debhelper.1 man page, substituting in a list of all
76         # debhelper commands. eek!
77         perl -ne ' \
78                 s/\\- /(1)\n/; \
79                 $$collect.=".TP\n.BR $$_" if $$. eq 3 && /^dh_/; \
80                 close(ARGV) if eof; \
81                 END { \
82                         open(I,"debian/debhelper/usr/share/man/man1/debhelper.1"); \
83                         @lines=<I>; \
84                         close I; \
85                         open(O,">debian/debhelper/usr/share/man/man1/debhelper.1"); \
86                         foreach (@lines) { \
87                                 s/#LIST#/$$collect/; \
88                                 print O; \
89                         } \
90                         close O; \
91                 }' *.1
92         ./dh_installchangelogs
93 #       ./dh_movefiles
94         ./dh_link
95         ./dh_compress
96         ./dh_fixperms
97         ./dh_suidregister
98         ./dh_installdeb
99         ./dh_gencontrol
100         ./dh_md5sums
101         ./dh_builddeb
102
103 # Fix links when checking out of cvs by calling this target.
104 link-stamp:
105         sh -e debian/fixlinks
106         touch link-stamp
107
108 # Update the debhelper web page. Not intended for use by anyone except the
109 # author.
110 installhook:
111         cp debian/changelog /home/pub/programs/debhelper/CHANGES
112         echo $(VERSION) > /home/pub/programs/debhelper/LATEST-VERSION-IS
113
114 binary: binary-indep binary-arch
115 .PHONY: build clean binary-indep binary-arch binary dist
116