]> git.donarmstrong.com Git - debhelper.git/blob - debian/rules
r1600: spanish tranalstion of man pages
[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.
6 # See examples/ for some good examples.
7
8 # Ensure that builds are self-hosting, which means I have to use the .pm
9 # files in this package, not any that may be on the system.
10 export PERL5LIB=.
11
12 # If any automatic script generation is done in building this package, 
13 # be sure to use the new templates from this package.
14 export DH_AUTOSCRIPTDIR=autoscripts
15
16 # This generates a list of synopses of debhelper commands, and substitutes
17 # it in to the #LIST# line on the man page fed to it on stdin. Must be passes
18 # parameters of all the executables or pod files to get the synopses from.
19 # (Like I said, this is not a good example of a debhelper rules file..)
20 MAKEMANLIST=perl -e ' \
21                 undef $$/; \
22                 foreach (@ARGV) { \
23                         open (IN, $$_) or die "$$_: $$!"; \
24                         $$file=<IN>; \
25                         close IN; \
26                         if ($$file=~m/=head1 .*\n\n(.*?) - (.*?)\n/m) { \
27                                 $$collect.=".IP $$1(1)\n$$2\n"; \
28                         } \
29                 } \
30                 END { \
31                         while (<STDIN>) { \
32                                 s/\#LIST\#/$$collect/; \
33                                 print; \
34                         }; \
35                 }'
36
37 # Figure out the `current debhelper version.
38 VERSION=$(shell expr "`dpkg-parsechangelog 2>/dev/null |grep Version:`" : '.*Version: \(.*\)')
39
40 PERLLIBDIR=$(shell perl -MConfig -e 'print $$Config{vendorlib}')
41
42 POD2MAN=pod2man -c Debhelper -r "$(VERSION)"
43
44 build: test build-stamp
45 build-stamp:
46         # Build all the man pages.
47         find . -type f -perm +100 -maxdepth 1 -name "dh_*" \
48                 -exec $(POD2MAN) {} {}.1 \;
49         $(POD2MAN) --section=7 debhelper.pod | \
50                 $(MAKEMANLIST) `find . -type f -perm +100 -maxdepth 1 -name "dh_*" | sort` > debhelper.7
51         # Translated pages.
52         set -e; \
53         for dir in man/*; do \
54                 lang=`basename $$dir`; \
55                 for file in $$dir/dh_*.pod; do \
56                         prog=`basename $$file | sed 's/.pod//'`; \
57                         $(POD2MAN) $$file $$prog.$$lang.1; \
58                 done; \
59                 $(POD2MAN) --section=7 $$dir/debhelper.pod | \
60                         $(MAKEMANLIST) `find $$dir -type f -maxdepth 1 -name "dh_*.pod" | sort` > debhelper.$$lang.7; \
61         done
62         
63         printf "package Debian::Debhelper::Dh_Version;\n\$$version='$(VERSION)';" > \
64                 Debian/Debhelper/Dh_Version.pm
65         touch build-stamp
66
67 clean:
68         ./dh_testdir
69         ./dh_testroot
70         ./dh_clean *.1 *.7 *-stamp Debian/Debhelper/Dh_Version.pm
71
72 test: test-stamp
73 test-stamp:
74         ./dh_clean
75         DH_VERSION=10 perl -MTest::Harness -e 'runtests grep { ! /CVS/ && ! /\.svn/ } @ARGV' t/*
76         ./dh_clean
77         touch test-stamp
78
79 binary-indep: build
80         ./dh_testdir
81         ./dh_testroot
82         ./dh_clean -k
83         ./dh_install -X .1 dh_* usr/bin
84         ./dh_install Debian/Debhelper/*.pm $(PERLLIBDIR)/Debian/Debhelper/
85         ./dh_install autoscripts usr/share/debhelper
86         ./dh_installdocs doc/*
87         ./dh_installexamples examples/*
88         ./dh_installman *.1 *.7
89         ./dh_installchangelogs
90         ./dh_shlibdeps
91         ./dh_link
92         ./dh_compress
93         ./dh_fixperms
94         ./dh_perl
95         ./dh_installdeb
96         ./dh_gencontrol
97         ./dh_md5sums
98         ./dh_builddeb
99
100 # Update the debhelper web page. Not intended for use by anyone except the
101 # author.
102 DIR=/home/web/kitenet.net/programs/debhelper
103 installhook:
104         cp debian/changelog $(DIR)/CHANGES
105         echo -n $(VERSION) > $(DIR)/LATEST-VERSION-IS
106
107 binary-arch:
108 binary: binary-indep binary-arch
109 .PHONY: build clean binary-indep binary-arch binary