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