/[ddp]/manuals/trunk/release-notes/Makefile
ViewVC logotype

Contents of /manuals/trunk/release-notes/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6240 - (hide annotations) (download)
Fri Feb 6 09:20:21 2009 UTC (4 years, 3 months ago) by debacle
File size: 9269 byte(s)
Run po4a-update with or without --previous, depending on the version.
1 joy 2049 #
2     # Makefile for the release notes, top-level
3     #
4    
5 debacle 5536 # comment out this line when the release notes should go into
6     # production mode
7     DRAFT := 1
8    
9 debacle 6069 ifeq "$(DRAFT)" "1"
10     draftmode := yes
11     else
12     draftmode := maybe
13     endif
14    
15 jseidel-guest 5257 # TODO: Once #477458 is fixed in stable remove all committed sgml files
16     # which are generated from a PO file (was a workaround for old po4a).
17    
18 debacle 5323 manual := release-notes
19 joy 2049
20 debacle 5398 arches := $(shell grep '<phrase arch=' $(CURDIR)/$(manual).ent \
21 debacle 5357 | sed 's/.* arch=.\([a-z0-9]*\).*/\1/' | sort -u)
22 debacle 5323
23 joy 2049 ifeq "$(OFFICIALWEBBUILD)" "true"
24 debacle 5328 install_file := install -m 2664 -p
25 joy 2049 makedir := mkdir -p -m 2775
26     else
27 spaillar-guest 5679 install_file := cp -r
28 joy 2049 makedir := mkdir -p -m 0755
29     endif
30    
31 kebil-guest 6236 LANGUAGES := en ca cs da de es fi fr it ja ko lt ml nl pl pt_BR pt ro ru sk sv vi zh_CN zh_TW
32 jseidel-guest 5685 # languages without .po files
33 debacle 5419 # (either original English or translators don't like .po)
34 debacle 5539 DBK_LANGUAGES := en ca cs pt_BR
35 jseidel-guest 5703 PO_LANGUAGES := $(filter-out $(DBK_LANGUAGES), $(LANGUAGES))
36 debacle 6065 XMLROFF_LANGS=cs ja ml pl ro ru vi zh_CN zh_TW
37 debacle 6064 DISABLED_PDF=
38 debacle 5482 # cairo backend of xmlroff 0.6.0 crashes on some languages (#492597)
39 debacle 6064 GPLIST=
40 joy 2049
41     LANGUAGES-publish := $(addsuffix -publish,$(LANGUAGES))
42     LANGUAGES-clean := $(addsuffix -clean,$(LANGUAGES))
43    
44 debacle 5324 SOURCES := $(wildcard en/*.dbk)
45    
46     # DocBook stuff
47 debacle 6069 XP=xsltproc --nonet --novalid --xinclude \
48     --stringparam draft.mode $(draftmode)
49 debacle 5324 XL=xmllint --nonet --noout --postvalid --xinclude
50     # XSL files and parameters
51     # note: the URL is used as identifier, no HTTP is used!
52     DOCBOOK_XSL=http://docbook.sourceforge.net/release/xsl/current
53     # for HTML output
54     DBK2HTML=$(CURDIR)/html.xsl
55     # all in one file for text output
56     DBK2HTML1=$(CURDIR)/txt.xsl
57 debacle 6069 DBLATEX=dblatex --style=db2latex \
58 debacle 6078 --xsl-user=hyphenation.xsl --param=lingua=$(LINGUA) \
59 debacle 6069 --param=draft.mode=$(draftmode)
60 debacle 5324 PROFILE=$(DOCBOOK_XSL)/profiling/profile.xsl
61 debacle 5837 PREPROC=$(CURDIR)/preproc.xsl
62 debacle 6069 DBLATEXXSL=$(CURDIR)/dblatex.xsl
63 debacle 5326 XMLROFF=xmlroff --backend cairo
64 debacle 5482 XMLROFF_GP=xmlroff --backend gp
65 debacle 5324
66 debacle 5578 FORMATS=html txt pdf ps
67    
68 debacle 5324 # po4a stuff
69 debacle 6240 # The etch version of po4a, 0.29, does not have the --previous option
70     # while the lenny version, 0.34, has.
71     PO4A_VERSION=$(shell LANG=C po4a --version | head -1 \
72     | sed 's/.*version \([0-9].*[0-9a-z]\)\.*/\1/')
73     PREVIOUS=$(shell LANG=C dpkg --compare-versions "$(PO4A_VERSION)" ge 0.34 && echo --previous)
74     UPDATEPO=PERLLIB=lib/ po4a-updatepo $(PREVIOUS) --format docbook
75 debacle 5324 # The "--keep 0" should be removed as soon as the translations are ready
76 debacle 5430 TRANSLATE=PERLLIB=lib/ po4a-translate --format docbook --keep 0
77 debacle 5324
78 joy 2049 .SUFFIXES:
79 jseidel-guest 5688 .PHONY: publish all clean $(LANGUAGES-publish)
80 joy 2049
81 debacle 5406 all:
82     for l in $(LANGUAGES); do \
83     for a in $(arches); do \
84 debacle 5578 $(MAKE) LINGUA=$$l architecture=$$a $(FORMATS); \
85 debacle 5406 done; \
86     done
87 joy 2049
88 spaillar-guest 5679 publish:
89 joy 2049 set -ex; \
90     for arch in $(arches); do \
91     $(MAKE) architecture=$$arch; \
92 debacle 5328 $(makedir) $(PUBLISHDIR)/$$arch/$(manual); \
93     $(makedir) $(manual)-$$arch; \
94 joy 2049 for lang in $(LANGUAGES); do \
95 debacle 5328 $(makedir) $(manual)-$$arch/$$lang; \
96 spaillar-guest 5684 $(install_file) $$lang/$(manual).$$arch.html/* \
97 debacle 5328 $(PUBLISHDIR)/$$arch/$(manual)/; \
98     $(install_file) $$lang/$(manual).$$arch.txt \
99     $(PUBLISHDIR)/$$arch/$(manual).$$lang.txt; \
100 spaillar-guest 5676 $(install_file) $$lang/$(manual).$$arch.pdf \
101 debacle 5328 $(PUBLISHDIR)/$$arch/$(manual).$$lang.pdf; \
102 spaillar-guest 5676 $(install_file) $$lang/$(manual).$$arch.ps \
103 debacle 5328 $(PUBLISHDIR)/$$arch/$(manual).$$lang.ps; \
104 spaillar-guest 5684 $(install_file) $$lang/$(manual).$$arch.html/* \
105 debacle 5328 $(manual)-$$arch/$$lang/; \
106     $(install_file) $$lang/$(manual).$$arch.txt \
107     $(manual)-$$arch/$$lang/$(manual).$$lang.txt; \
108 spaillar-guest 5676 $(install_file) $$lang/$(manual).$$arch.pdf \
109 debacle 5328 $(manual)-$$arch/$$lang/$(manual).$$lang.pdf ; \
110 spaillar-guest 5676 $(install_file) $$lang/$(manual).$$arch.ps \
111 debacle 5328 $(manual)-$$arch/$$lang/$(manual).$$lang.ps ; \
112 joy 2049 done; \
113 debacle 5328 for i in $(PUBLISHDIR)/$$arch/$(manual)/*.en.html; do \
114     ln -sf `basename $$i` $${i%.en.html}.html; \
115 joy 2049 done; \
116 debacle 5328 if [ -n "$(PUBLISHTARBALL)" ]; then (cd $(manual)-$$arch \
117     && tar czf $(PUBLISHDIR)/$(manual)-$$arch.tar.gz *); fi \
118 joy 2049 done
119    
120 debacle 5578 ifeq "$(architecture)" ""
121     $(FORMATS)::
122     @echo "architecture variable must be set, try one of: $(arches)"
123     exit 1
124     endif
125    
126 debacle 5324 ifdef LINGUA
127 jseidel-guest 5687 html:: $(LINGUA)/$(manual).$(architecture).html/index.$(LINGUA).html
128     $(LINGUA)/$(manual).$(architecture).html/index.$(LINGUA).html: \
129 debacle 5327 $(LINGUA)/$(manual).$(architecture).xml html.xsl
130 debacle 5423 mkdir -p $(LINGUA)/$(manual).$(architecture).html/images
131     cp debian.css $(LINGUA)/$(manual).$(architecture).html
132 debacle 5473 cp /usr/share/xml/docbook/stylesheet/nwalsh/images/*.png \
133 debacle 5423 $(LINGUA)/$(manual).$(architecture).html/images
134 debacle 5328 cd $(LINGUA) && $(XP) -o $(manual).$(architecture).html/ \
135 debacle 5399 --stringparam html.ext .$(LINGUA).html \
136 debacle 5397 $(DBK2HTML) $(manual).$(architecture).xml
137 debacle 5324
138 debacle 5578 pdf:: $(LINGUA)/$(manual).$(architecture).pdf
139     ps:: $(LINGUA)/$(manual).$(architecture).ps
140 debacle 5338 ifneq "$(filter $(XMLROFF_LANGS),$(LINGUA))" ""
141 debacle 5328 $(LINGUA)/$(manual).$(architecture).pdf: \
142 debacle 5338 $(LINGUA)/$(manual).$(architecture).fo
143     $(LINGUA)/$(manual).$(architecture).ps: \
144     $(LINGUA)/$(manual).$(architecture).fo
145     $(LINGUA)/$(manual).$(architecture).fo: \
146 debacle 5328 $(LINGUA)/$(manual).$(architecture).xml fo.xsl
147 debacle 5338 else
148     $(LINGUA)/$(manual).$(architecture).pdf: \
149     $(LINGUA)/$(manual).$(architecture).xml
150     $(LINGUA)/$(manual).$(architecture).ps: \
151     $(LINGUA)/$(manual).$(architecture).xml
152     endif
153 debacle 5325
154 debacle 5656 ifneq "$(filter $(DISABLED_PDF),$(LINGUA))" ""
155     %.pdf: %.xml
156     echo "PDF for $$LINGUA currently disabled." > $@
157     else
158 debacle 5578 ifneq "$(filter $(XMLROFF_LANGS),$(LINGUA))" ""
159 debacle 5338 %.fo: %.xml
160 debacle 6069 $(XP) -o $@ fo.xsl $<
161 debacle 5338
162     %.pdf: %.fo
163 debacle 5482 USE_GP=`echo " $(GPLIST) " | grep " $$LINGUA "`; \
164     if [ -n "$$USE_GP" ]; then \
165     $(XMLROFF_GP) -o $@ $<; \
166     else \
167     $(XMLROFF) -o $@ $<; \
168     fi
169 debacle 5578 else
170 debacle 5338 %.pdf: %.xml
171 debacle 5569 [ -f $(@D)/ifxetex.sty ] || cp ifxetex.sty $(@D)/
172 debacle 6069 $(XP) $(DBLATEXXSL) $< | $(DBLATEX) --output=$@ -
173 debacle 5578 endif
174 debacle 5656 endif
175 debacle 5338
176 debacle 5578 ifneq "$(filter $(XMLROFF_LANGS),$(LINGUA))" ""
177 debacle 5328 # Can't we just drop PS in favour of PDF?
178 debacle 5338 %.ps: %.fo
179 debacle 5482 USE_GP=`echo " $(GPLIST) " | grep " $$LINGUA "`; \
180     if [ -n "$$USE_GP" ]; then \
181     $(XMLROFF_GP) --format postscript -o $@ $<; \
182     else \
183     $(XMLROFF) --format postscript -o $@ $<; \
184     fi
185 debacle 5578 else
186 debacle 5338 %.ps: %.xml
187 debacle 5569 [ -f $(@D)/ifxetex.sty ] || cp ifxetex.sty $(@D)/
188 debacle 6069 $(XP) $(DBLATEXXSL) $< | $(DBLATEX) --output=$@ --ps -
189 debacle 5578 endif
190 debacle 5338
191 debacle 5578 txt:: $(LINGUA)/$(manual).$(architecture).txt
192 debacle 5328 $(LINGUA)/$(manual).$(architecture).txt: \
193     $(LINGUA)/$(manual).$(architecture).xml txt.xsl
194 debacle 6069 $(XP) $(DBK2HTML1) $< \
195 jseidel-guest 5698 | w3m -o display_charset=UTF-8 -cols 70 -dump -no-graph -T text/html > $@
196 debacle 5324
197 debacle 5337 # profiling for architecture, needed by all output formats
198 debacle 5338 condition := ;
199     ifeq "$(DRAFT)" "1"
200     condition := fixme
201     endif
202 debacle 5331 space := $(undef) $(undef)
203     semic := $(undef);$(undef)
204     otherarchs := $(subst $(space),$(semic), \
205 debacle 5337 $(addprefix not-,$(filter-out $(architecture),$(arches))))
206     ifneq "$(filter $(architecture),i386 amd64 powerpc)" ""
207 debacle 5338 condition := $(condition);g-i
208 debacle 5337 endif
209 debacle 5331
210 debacle 5337 ifneq "$(filter $(architecture),mips mipsel)" ""
211 debacle 5338 initrd := $(condition);no-initrd
212 debacle 5337 else
213 debacle 5338 initrd := $(condition);uses-initrd
214 debacle 5337 endif
215 debacle 5947 # pseudo-arch "all" to include all text, e.g. for proof-reading
216     ifeq "$(architecture)" "all"
217     otherarchs := ;$(subst $(space),$(semic),$(arches))$(otherarchs)
218     condition := $(condition);g-i;no-initrd;
219     endif
220 debacle 5337
221 debacle 5324 $(LINGUA)/$(manual).$(architecture).xml: \
222 jseidel-guest 5695 $(patsubst en/%,$(LINGUA)/%,$(SOURCES)) $(manual).ent
223 debacle 5331 $(XP) --stringparam profile.arch "$(architecture)$(otherarchs)" \
224 debacle 5338 --stringparam profile.condition "$(condition)" \
225 debacle 5837 $(PROFILE) $(@D)/$(manual).dbk | $(XP) $(PREPROC) - > $@
226 debacle 5324 endif
227    
228 jseidel-guest 5703 FORCE:
229    
230 debacle 5324 # There must be an easier way than recursive make!
231 jseidel-guest 5695 .PRECIOUS: %.dbk
232 debacle 5324 ifndef LINGUA
233 jseidel-guest 5695 %.dbk: FORCE
234 debacle 5324 $(MAKE) $@ LINGUA=`basename $(@D)`
235    
236     else
237 jseidel-guest 6101 ifeq "$(findstring $(LINGUA) , $(DBK_LANGUAGES) )" ""
238 debacle 5328 $(LINGUA)/%.dbk: en/%.dbk $(LINGUA)/%.po
239 debacle 5324 $(TRANSLATE) --master $< --po $(@:.dbk=.po) --localized $@
240     endif
241 debacle 5328 endif
242 debacle 5324
243     ifdef LINGUA
244 debacle 5328 .PHONY: updatepo
245 jfs 5863 update-po: updatepo
246 jseidel-guest 5703 updatepo: $(patsubst en/%.dbk,$(LINGUA)/%.po-force,$(wildcard en/*.dbk))
247     # The next is just a PHONY target and forcible updates the PO files
248     $(LINGUA)/%.po-force: FORCE
249     $(UPDATEPO) --master en/$*.dbk --po $(LINGUA)/$*.po
250 debacle 5328
251     validate: $(patsubst en/%,$(LINGUA)/%,$(SOURCES))
252     $(XL) $(LINGUA)/$(manual).dbk
253 debacle 5324 endif
254    
255 debacle 5327 tidypo:
256 debacle 5492 ifdef LINGUA
257     for po in $(wildcard $(LINGUA)/*.po); do \
258     msgcat $$po > $$po.tmp && mv $$po.tmp $$po; \
259     done
260     else
261 debacle 5327 for po in $(wildcard */*.po); do \
262     msgcat $$po > $$po.tmp && mv $$po.tmp $$po; \
263     done
264 debacle 5492 endif
265 debacle 5327
266 debacle 5324 ifndef LINGUA
267 jseidel-guest 5703
268     # Iterate over all PO based languages only
269     updatepo:
270     for l in $(PO_LANGUAGES); do \
271     $(MAKE) $@ LINGUA=$$l; \
272     done
273    
274 debacle 5324 %:
275     for l in $(LANGUAGES); do \
276     $(MAKE) $@ LINGUA=$$l; \
277     done
278     endif
279    
280 joy 2049 clean::
281 debacle 5997 rm -f relnotes.tar.bz2 statistics.txt messages.mo
282 debacle 5328 find -maxdepth 1 -name '$(manual)-*' -type d -exec rm -fr {} \;
283 joy 2049 clean:: $(LANGUAGES-clean)
284    
285     $(LANGUAGES-clean):
286 debacle 5702 LINGUA=$(subst -clean,,$@); \
287     cd $$LINGUA; \
288 jseidel-guest 6101 echo " $(DBK_LANGUAGES) " | grep -q " $$LINGUA " || rm -f *.dbk; \
289 debacle 5399 rm -rf *~ .*~ $(manual).*.html $(manual).*.txt $(manual).*.pdf \
290 debacle 5664 $(manual).*.ps $(manual).*.xml ifxetex.sty body.tmp head.tmp \
291 debacle 5944 release-notes.*.tpt release-notes.*.fo
292 debacle 5337
293     printarches:
294 debacle 5341 @echo $(arches)
295 debacle 5716
296     .PHONY: statistics.txt
297     statistics.txt:
298     ( \
299     LANG=C; export LANG; \
300     for l in $(PO_LANGUAGES); do \
301     echo -n "$$l: "; \
302     msgcat $$l/*.po | msgfmt --statistics - 2>&1 ; \
303     done; \
304     ) > $@
305 debacle 5938 ./transcount $(DBK_LANGUAGES) >> $@

  ViewVC Help
Powered by ViewVC 1.1.5