/[ddp]/manuals/branches/release-notes/lenny/Makefile
ViewVC logotype

Contents of /manuals/branches/release-notes/lenny/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5399 - (show annotations) (download)
Mon Oct 6 22:35:52 2008 UTC (4 years, 7 months ago) by debacle
File size: 6543 byte(s)
Fixed typos in Makefile & TODO in "what's new" section.
1 #
2 # Makefile for the release notes, top-level
3 #
4
5 # TODO: Once #477458 is fixed in stable remove all committed sgml files
6 # which are generated from a PO file (was a workaround for old po4a).
7
8 manual := release-notes
9
10 arches := $(shell grep '<phrase arch=' $(CURDIR)/$(manual).ent \
11 | sed 's/.* arch=.\([a-z0-9]*\).*/\1/' | sort -u)
12
13 ifeq "$(OFFICIALWEBBUILD)" "true"
14 install_file := install -m 2664 -p
15 makedir := mkdir -p -m 2775
16 else
17 install_file := install -m 644 -p
18 makedir := mkdir -p -m 0755
19 endif
20
21 LANGUAGES := en ca cs de es fi fr it ja pl pt_BR pt ro ru sv zh_TW
22 XMLROFF_LANGS=cs ja pl ro ru vi zh_CN
23
24 LANGUAGES-publish := $(addsuffix -publish,$(LANGUAGES))
25 LANGUAGES-clean := $(addsuffix -clean,$(LANGUAGES))
26
27 SOURCES := $(wildcard en/*.dbk)
28
29 # DocBook stuff
30 XP=xsltproc --nonet --novalid --xinclude
31 XL=xmllint --nonet --noout --postvalid --xinclude
32 # XSL files and parameters
33 # note: the URL is used as identifier, no HTTP is used!
34 DOCBOOK_XSL=http://docbook.sourceforge.net/release/xsl/current
35 # for HTML output
36 DBK2HTML=$(CURDIR)/html.xsl
37 # all in one file for text output
38 DBK2HTML1=$(CURDIR)/txt.xsl
39 DBLATEX=dblatex --style=db2latex
40 PROFILE=$(DOCBOOK_XSL)/profiling/profile.xsl
41 XMLROFF=xmlroff --backend cairo
42
43 ifeq "$(DRAFT)" "1"
44 draftmode := yes
45 else
46 draftmode := maybe
47 endif
48
49 # po4a stuff
50 UPDATEPO=po4a-updatepo --format docbook
51 PO_FILES=$(wildcard de/*.po es/*.po)
52 # The "--keep 0" should be removed as soon as the translations are ready
53 TRANSLATE=po4a-translate --format docbook --keep 0
54
55 .SUFFIXES:
56 .PHONY: publish all clean $(LANGUAGES) $(LANGUAGES-publish)
57
58 all: $(LANGUAGES)
59
60 $(LANGUAGES):
61 ifeq "$(architecture)" ""
62 @echo "architecture variable must be set, try one of: $(arches)"
63 exit 1
64 else
65 -$(MAKE) LINGUA=$@ html txt pdf ps
66 endif
67
68 publish: clean
69 set -ex; \
70 for arch in $(arches); do \
71 $(MAKE) architecture=$$arch; \
72 $(makedir) $(PUBLISHDIR)/$$arch/$(manual); \
73 $(makedir) $(manual)-$$arch; \
74 for lang in $(LANGUAGES); do \
75 $(makedir) $(manual)-$$arch/$$lang; \
76 $(install_file) $$lang/$(manual).$$lang.$$arch.html/* \
77 $(PUBLISHDIR)/$$arch/$(manual)/; \
78 $(install_file) $$lang/$(manual).$$arch.txt \
79 $(PUBLISHDIR)/$$arch/$(manual).$$lang.txt; \
80 $(install_file) $$lang/$(manual).$$lang.$$arch.pdf \
81 $(PUBLISHDIR)/$$arch/$(manual).$$lang.pdf; \
82 $(install_file) $$lang/$(manual).$$lang.$$arch.ps \
83 $(PUBLISHDIR)/$$arch/$(manual).$$lang.ps; \
84 $(install_file) $$lang/$(manual).$$lang.$$arch.html/* \
85 $(manual)-$$arch/$$lang/; \
86 $(install_file) $$lang/$(manual).$$arch.txt \
87 $(manual)-$$arch/$$lang/$(manual).$$lang.txt; \
88 $(install_file) $$lang/$(manual).$$lang.$$arch.pdf \
89 $(manual)-$$arch/$$lang/$(manual).$$lang.pdf ; \
90 $(install_file) $$lang/$(manual).$$lang.$$arch.ps \
91 $(manual)-$$arch/$$lang/$(manual).$$lang.ps ; \
92 done; \
93 for i in $(PUBLISHDIR)/$$arch/$(manual)/*.en.html; do \
94 ln -sf `basename $$i` $${i%.en.html}.html; \
95 done; \
96 if [ -n "$(PUBLISHTARBALL)" ]; then (cd $(manual)-$$arch \
97 && tar czf $(PUBLISHDIR)/$(manual)-$$arch.tar.gz *); fi \
98 done
99
100 ifdef LINGUA
101 html: $(LINGUA)/$(manual).$(architecture).html/index.html
102 $(LINGUA)/$(manual).$(architecture).html/index.html: \
103 $(LINGUA)/$(manual).$(architecture).xml html.xsl
104 mkdir -p $(LINGUA)/$(manual).$(architecture).html
105 cd $(LINGUA) && $(XP) -o $(manual).$(architecture).html/ \
106 --stringparam html.ext .$(LINGUA).html \
107 --stringparam draft.mode $(draftmode) \
108 $(DBK2HTML) $(manual).$(architecture).xml
109
110 pdf: $(LINGUA)/$(manual).$(architecture).pdf
111 ps: $(LINGUA)/$(manual).$(architecture).ps
112 ifneq "$(filter $(XMLROFF_LANGS),$(LINGUA))" ""
113 $(LINGUA)/$(manual).$(architecture).pdf: \
114 $(LINGUA)/$(manual).$(architecture).fo
115 $(LINGUA)/$(manual).$(architecture).ps: \
116 $(LINGUA)/$(manual).$(architecture).fo
117 $(LINGUA)/$(manual).$(architecture).fo: \
118 $(LINGUA)/$(manual).$(architecture).xml fo.xsl
119 else
120 $(LINGUA)/$(manual).$(architecture).pdf: \
121 $(LINGUA)/$(manual).$(architecture).xml
122 $(LINGUA)/$(manual).$(architecture).ps: \
123 $(LINGUA)/$(manual).$(architecture).xml
124 endif
125
126 %.fo: %.xml
127 $(XP) -o $@ --stringparam draft.mode $(draftmode) fo.xsl $<
128
129 %.pdf: %.fo
130 $(XMLROFF) -o $@ $<
131
132 %.pdf: %.xml
133 $(DBLATEX) --output=$@ --param=draft.mode=$(draftmode) $<
134
135 # Can't we just drop PS in favour of PDF?
136 %.ps: %.fo
137 $(XMLROFF) --format postscript -o $@ $<
138
139 %.ps: %.xml
140 $(DBLATEX) --output=$@ --ps --param=draft.mode=$(draftmode) $<
141
142 txt: $(LINGUA)/$(manual).$(architecture).txt
143 $(LINGUA)/$(manual).$(architecture).txt: \
144 $(LINGUA)/$(manual).$(architecture).xml txt.xsl
145 $(XP) --stringparam draft.mode $(draftmode) $(DBK2HTML1) $< \
146 | w3m -cols 70 -dump -no-graph -T text/html > $@
147
148 # profiling for architecture, needed by all output formats
149 condition := ;
150 ifeq "$(DRAFT)" "1"
151 condition := fixme
152 endif
153 space := $(undef) $(undef)
154 semic := $(undef);$(undef)
155 otherarchs := $(subst $(space),$(semic), \
156 $(addprefix not-,$(filter-out $(architecture),$(arches))))
157 ifneq "$(filter $(architecture),i386 amd64 powerpc)" ""
158 condition := $(condition);g-i
159 endif
160
161 ifneq "$(filter $(architecture),mips mipsel)" ""
162 initrd := $(condition);no-initrd
163 else
164 initrd := $(condition);uses-initrd
165 endif
166
167 $(LINGUA)/$(manual).$(architecture).xml: \
168 $(patsubst en/%,$(LINGUA)/%,$(SOURCES))
169 $(XP) --stringparam profile.arch "$(architecture)$(otherarchs)" \
170 --stringparam profile.condition "$(condition)" \
171 $(PROFILE) $(@D)/$(manual).dbk > $@
172 endif
173
174 # There must be an easier way than recursive make!
175 .PRECIOUS: %.dbk %.ent
176 ifndef LINGUA
177 %.dbk %.ent: FORCE
178 $(MAKE) $@ LINGUA=`basename $(@D)`
179
180 FORCE:
181 else
182 ifneq "$(LINGUA)" "en"
183 $(LINGUA)/%.dbk: en/%.dbk $(LINGUA)/%.po
184 $(TRANSLATE) --master $< --po $(@:.dbk=.po) --localized $@
185 endif
186 endif
187
188 ifdef LINGUA
189 .PHONY: updatepo
190 updatepo: $(patsubst en/%.dbk,$(LINGUA)/%.po,$(wildcard en/*.dbk))
191 $(LINGUA)/%.po: en/%.dbk
192 [ "$(LINGUA)" = "en" ] || $(UPDATEPO) --master $< --po $@
193
194 validate: $(patsubst en/%,$(LINGUA)/%,$(SOURCES))
195 $(XL) $(LINGUA)/$(manual).dbk
196 endif
197
198 tidypo:
199 for po in $(wildcard */*.po); do \
200 msgcat $$po > $$po.tmp && mv $$po.tmp $$po; \
201 done
202
203 ifndef LINGUA
204 %:
205 for l in $(LANGUAGES); do \
206 $(MAKE) $@ LINGUA=$$l; \
207 done
208 endif
209
210 clean::
211 rm -f relnotes.tar.bz2
212 find -maxdepth 1 -name '$(manual)-*' -type d -exec rm -fr {} \;
213 clean:: $(LANGUAGES-clean)
214
215 $(LANGUAGES-clean):
216 cd $(subst -clean,,$@); \
217 rm -rf *~ .*~ $(manual).*.html $(manual).*.txt $(manual).*.pdf \
218 $(manual).*.ps $(manual).*.xml
219
220 printarches:
221 @echo $(arches)

  ViewVC Help
Powered by ViewVC 1.1.5