]> git.donarmstrong.com Git - debhelper.git/blob - debian/rules
r354: * Killed the fixlinks stuff, since there are no longer any symlinks in
[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: test
22 # Nothing to do.        
23
24 clean:
25         ./dh_testdir
26         ./dh_testroot
27         ./dh_clean
28
29 test:
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: build
36 # Nothing to do.
37
38 # Build architecture-independent files here.
39 binary-indep: 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 Debian::Debhelper::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 before 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_link
94         ./dh_compress
95         ./dh_fixperms
96         ./dh_suidregister
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 $(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