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