chiark / gitweb /
[maint-guide] (fr) Proofread [ St├ęphane Blondon ] <CAOy+up4xiaThPj-+G-YwW3b6=gMC1V...
[developers-reference.git] / debian / rules
1 #!/usr/bin/make -f
2 # rules file for developers-reference
3
4 package         := developers-reference
5
6 # directory abstraction
7 prefix          := debian/$(package)
8 docdir          := $(prefix)/usr/share/doc/$(package)
9 docbaserel      := /usr/share/doc-base
10 docbasedir      := $(prefix)$(docbaserel)
11
12 # list of language packages, in the form pkg-LANG; must jibe
13 # with debian/control
14 langs           := de fr ja
15 langs_nopdf     := 
16
17 # tool abstraction
18 install_file    := install -o root -g root -m 644 -p
19 install_script  := install -o root -g root -m 755 -p
20 make_directory  := install -d -o root -g root -m 755
21
22 # version abstraction
23 DEB_VERSION     := $(shell awk -F '[()]' '/^$(package)/{ print $$2; exit }' debian/changelog)
24 DEB_DATE        := $(shell dpkg-parsechangelog 2>/dev/null | sed -n 's/^Date: *//p')
25 # pretty-print the date; I wish this was dynamic like the top-level makefile but oh well
26 PUBDATE         := $(shell LC_ALL=C date --date="$(DEB_DATE)" -I)
27
28 # debhelper verbose mode
29 #export DH_VERBOSE=1
30
31 build: build-arch build-indep
32
33 build-arch:
34 #       nothing arch dependant
35
36 build-indep:
37         $(checkdir)
38         rm -f version.ent
39         $(MAKE) VERSION=$(DEB_VERSION) PUBDATE=$(PUBDATE) LANGS="$(langs) $(langs_nopdf)"
40         touch build
41
42 .PHONY: clean
43 clean:
44         $(checkdir)
45         $(MAKE) clean
46         rm -f build
47         dh_clean
48
49 .PHONY: test
50 test:
51 #        nothing to test ATM
52
53 .PHONY: install
54 install:        build
55         $(checkdir)
56         $(checkroot)
57         dh_clean -k
58
59         dh_installdocs -p$(package) README-contrib \
60             *.html \
61             developers-reference.txt \
62             developers-reference.pdf
63
64         set -e; for lang in $(langs); do \
65             dh_installdocs -p$(package)-$$lang README-contrib \
66                 $$lang/*.html \
67                 $$lang/developers-reference.txt \
68                 $$lang/developers-reference.pdf; \
69         done
70
71         set -e; for lang in $(langs_nopdf); do \
72             dh_installdocs -p$(package)-$$lang README-contrib \
73                     $$lang/*.html \
74                     $$lang/developers-reference.txt; \
75         done
76
77 .PHONY: binary-indep
78 binary-indep:   test install
79         $(checkdir)
80         $(checkroot)
81         dh_installdirs -i
82         dh_installchangelogs -i
83         dh_compress -i -X.pdf
84         dh_fixperms -i
85         debian/tocsubstvars -i
86         dh_installdeb -i
87         dh_gencontrol -i
88         dh_md5sums -i
89         dh_builddeb -i
90
91
92 .PHONY: binary-arch
93 binary-arch:    build install
94 #        There are no architecture-dependent files to be uploaded
95 #        generated by this package.
96
97 define checkdir
98         test -f debian/rules
99         test -f index.dbk
100 endef
101
102 # Below here is fairly generic really
103
104 define checkroot
105         test `id -u` = 0
106 endef
107
108 .PHONY: binary
109 binary:         binary-indep binary-arch