| 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 |
|
|
release := sarge
|
| 10 |
joy |
2049 |
|
| 11 |
debacle |
5324 |
arches := $(shell grep '\[ <!ENTITY arch-title' release-notes.ent | awk '{print $$2}' | sed s/%//)
|
| 12 |
debacle |
5323 |
|
| 13 |
joy |
2049 |
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 |
debacle |
5324 |
#LANGUAGES := en ca cs de es fi fr it ja pl pt_BR pt_PT ro ru sv zh_TW
|
| 22 |
|
|
LANGUAGES := en de es
|
| 23 |
joy |
2049 |
|
| 24 |
|
|
LANGUAGES-publish := $(addsuffix -publish,$(LANGUAGES))
|
| 25 |
|
|
LANGUAGES-clean := $(addsuffix -clean,$(LANGUAGES))
|
| 26 |
|
|
|
| 27 |
debacle |
5324 |
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 |
|
|
|
| 42 |
|
|
# po4a stuff
|
| 43 |
|
|
UPDATEPO=po4a-updatepo --format docbook
|
| 44 |
|
|
PO_FILES=$(wildcard de/*.po es/*.po)
|
| 45 |
|
|
# The "--keep 0" should be removed as soon as the translations are ready
|
| 46 |
|
|
TRANSLATE=po4a-translate --format docbook --keep 0
|
| 47 |
|
|
|
| 48 |
joy |
2049 |
.SUFFIXES:
|
| 49 |
|
|
.PHONY: publish all clean $(LANGUAGES) $(LANGUAGES-publish)
|
| 50 |
|
|
|
| 51 |
|
|
all: $(LANGUAGES)
|
| 52 |
|
|
|
| 53 |
|
|
$(LANGUAGES):
|
| 54 |
jseidel |
3333 |
-$(MAKE) -C $@
|
| 55 |
joy |
2049 |
|
| 56 |
robster |
2640 |
publish: clean
|
| 57 |
joy |
2049 |
ifneq "$(PUBLISHDIR)" ""
|
| 58 |
fjp |
4452 |
# This branch is used for official website builds
|
| 59 |
joy |
2049 |
set -ex; \
|
| 60 |
|
|
for arch in $(arches); do \
|
| 61 |
|
|
$(MAKE) architecture=$$arch; \
|
| 62 |
robster |
2640 |
$(makedir) $(PUBLISHDIR)/$$arch/release-notes; \
|
| 63 |
djpig |
3361 |
$(makedir) release-notes-$$arch; \
|
| 64 |
joy |
2049 |
for lang in $(LANGUAGES); do \
|
| 65 |
djpig |
3361 |
$(makedir) release-notes-$$arch/$$lang; \
|
| 66 |
robster |
2640 |
$(install_file) $$lang/release-notes.$$lang.html/* $(PUBLISHDIR)/$$arch/release-notes/; \
|
| 67 |
|
|
$(install_file) $$lang/release-notes.$$lang.txt $(PUBLISHDIR)/$$arch/; \
|
| 68 |
robster |
2755 |
$(install_file) $$lang/release-notes.$$lang.pdf $(PUBLISHDIR)/$$arch/; \
|
| 69 |
|
|
$(install_file) $$lang/release-notes.$$lang.ps $(PUBLISHDIR)/$$arch/; \
|
| 70 |
djpig |
3361 |
$(install_file) $$lang/release-notes.$$lang.html/* release-notes-$$arch/$$lang; \
|
| 71 |
|
|
$(install_file) $$lang/release-notes.$$lang.txt release-notes-$$arch/$$lang; \
|
| 72 |
|
|
$(install_file) $$lang/release-notes.$$lang.pdf release-notes-$$arch/$$lang; \
|
| 73 |
joy |
2049 |
done; \
|
| 74 |
robster |
2640 |
for i in $(PUBLISHDIR)/$$arch/release-notes/*.en.html; do \
|
| 75 |
djpig |
3395 |
ln -sf `basename $$i` $${i%.en.html}.html; \
|
| 76 |
joy |
2049 |
done; \
|
| 77 |
djpig |
3386 |
if [ -n "$(PUBLISHTARBALL)" ]; then (cd release-notes-$$arch && tar czf $(PUBLISHDIR)/release-notes-$$arch.tar.gz *); fi \
|
| 78 |
joy |
2049 |
done
|
| 79 |
|
|
else
|
| 80 |
fjp |
4452 |
# This branch is probably no longer used (FJP 20060406)
|
| 81 |
joy |
2049 |
set -e; \
|
| 82 |
|
|
for arch in $(arches); do \
|
| 83 |
|
|
$(MAKE) architecture=$$arch; \
|
| 84 |
|
|
$(makedir) upgrade-$$arch; \
|
| 85 |
|
|
for lang in $(LANGUAGES); do \
|
| 86 |
|
|
$(install_file) $$lang/release-notes.$$lang.html/* upgrade-$$arch; \
|
| 87 |
|
|
$(install_file) $$lang/release-notes.$$lang.txt upgrade-$$arch; \
|
| 88 |
jseidel |
2857 |
$(install_file) $$lang/release-notes.$$lang.pdf upgrade-$$arch; \
|
| 89 |
joy |
2049 |
done; \
|
| 90 |
|
|
ln -sf index.en.html upgrade-$$arch/index.html; \
|
| 91 |
|
|
ln -sf release-notes.en.txt upgrade-$$arch/Release-Notes; \
|
| 92 |
|
|
done
|
| 93 |
jseidel |
2857 |
tar cjf relnotes.tar.bz2 upgrade-*
|
| 94 |
jseidel |
4475 |
rm -rf upgrade-*
|
| 95 |
joy |
2049 |
endif
|
| 96 |
|
|
|
| 97 |
debacle |
5324 |
ifdef LINGUA
|
| 98 |
|
|
html: $(LINGUA)/$(manual).$(LINGUA).html/index.html
|
| 99 |
|
|
$(LINGUA)/$(manual).$(LINGUA).html/index.html: \
|
| 100 |
|
|
$(LINGUA)/$(manual).$(architecture).xml
|
| 101 |
|
|
mkdir -p $(LINGUA)/$(manual).$(LINGUA).html
|
| 102 |
|
|
cd $(LINGUA) && $(XP) -o $(manual).$(LINGUA).html/ \
|
| 103 |
|
|
$(DBK2HTML) $(manual).$(architecture).xml
|
| 104 |
|
|
|
| 105 |
debacle |
5325 |
# TODO: add xmlroff for the languages which dblatex cannot yet handle
|
| 106 |
|
|
pdf: $(LINGUA)/release-notes.pdf
|
| 107 |
|
|
$(LINGUA)/release-notes.pdf: $(LINGUA)/$(manual).$(architecture).xml
|
| 108 |
|
|
TOP=`pwd` && cd $(@D) && $(DBLATEX) --output=$(@F) $(<F)
|
| 109 |
|
|
|
| 110 |
debacle |
5324 |
txt: $(LINGUA)/release-notes.txt
|
| 111 |
|
|
$(LINGUA)/release-notes.txt: $(LINGUA)/$(manual).$(architecture).xml
|
| 112 |
|
|
$(XP) $(DBK2HTML1) $< \
|
| 113 |
|
|
| w3m -cols 70 -dump -no-graph -T text/html > $@
|
| 114 |
|
|
|
| 115 |
|
|
# profiling for architecture, needed by all output formats
|
| 116 |
|
|
$(LINGUA)/$(manual).$(architecture).xml: \
|
| 117 |
|
|
$(patsubst en/%,$(LINGUA)/%,$(SOURCES)) \
|
| 118 |
|
|
$(LINGUA)/dynamic.ent $(LINGUA)/release-notes.ent txt.xsl
|
| 119 |
|
|
$(XP) --stringparam profile.arch $(architecture) $(PROFILE) \
|
| 120 |
|
|
$(@D)/$(manual).dbk > $@
|
| 121 |
|
|
endif
|
| 122 |
|
|
|
| 123 |
|
|
# There must be an easier way than recursive make!
|
| 124 |
|
|
.PRECIOUS: %.dbk %.ent
|
| 125 |
|
|
ifndef LINGUA
|
| 126 |
|
|
%.dbk %.ent: FORCE
|
| 127 |
|
|
$(MAKE) $@ LINGUA=`basename $(@D)`
|
| 128 |
|
|
|
| 129 |
|
|
FORCE:
|
| 130 |
|
|
else
|
| 131 |
|
|
$(LINGUA)/%.dbk: en/%.dbk
|
| 132 |
|
|
$(TRANSLATE) --master $< --po $(@:.dbk=.po) --localized $@
|
| 133 |
|
|
|
| 134 |
|
|
$(LINGUA)/%.ent: %.ent
|
| 135 |
|
|
cd $(@D) && ln -sf ../$(@F) .
|
| 136 |
|
|
endif
|
| 137 |
|
|
|
| 138 |
|
|
ifdef LINGUA
|
| 139 |
|
|
.PHONY: updatepo
|
| 140 |
|
|
updatepo: $(patsubst en/%.dbk,$(LINGUA)/%.po,$(wildcard en/*.dbk))
|
| 141 |
|
|
$(LINGUA)/%.po: en/%.dbk
|
| 142 |
|
|
echo $(UPDATEPO) --master $< --po $@
|
| 143 |
|
|
endif
|
| 144 |
|
|
|
| 145 |
|
|
ifndef LINGUA
|
| 146 |
|
|
%:
|
| 147 |
|
|
for l in $(LANGUAGES); do \
|
| 148 |
|
|
$(MAKE) $@ LINGUA=$$l; \
|
| 149 |
|
|
done
|
| 150 |
|
|
endif
|
| 151 |
|
|
|
| 152 |
|
|
dynamic_$(architecture).ent:
|
| 153 |
|
|
ifeq "$(architecture)" ""
|
| 154 |
|
|
@echo architecture variable must be set
|
| 155 |
|
|
exit 1
|
| 156 |
|
|
endif
|
| 157 |
|
|
: > $@ # clear the file
|
| 158 |
|
|
echo "<!ENTITY architecture \"$(architecture)\">" >> $@
|
| 159 |
|
|
echo "<!ENTITY % $(architecture) \"INCLUDE\">" >> $@
|
| 160 |
|
|
|
| 161 |
|
|
.PHONY: dynamic.ent
|
| 162 |
|
|
dynamic.ent: dynamic_$(architecture).ent
|
| 163 |
|
|
ln -sf $< $@
|
| 164 |
|
|
|
| 165 |
joy |
2049 |
clean::
|
| 166 |
|
|
rm -f dynamic*.ent relnotes.tar.bz2
|
| 167 |
jseidel |
3930 |
find -maxdepth 1 -name 'release-notes-*' -type d -exec rm -fr {} \;
|
| 168 |
joy |
2049 |
clean:: $(LANGUAGES-clean)
|
| 169 |
|
|
|
| 170 |
|
|
$(LANGUAGES-clean):
|
| 171 |
|
|
$(MAKE) -C $(subst -clean,,$@) clean
|