From 83bd31f55fd63308b09ae9dc916db28d0c1cb051 Mon Sep 17 00:00:00 2001 From: Karl Eichwalder Date: Mon, 14 Apr 2014 17:28:35 +0200 Subject: [PATCH] build SLES (reuse SLED) --- SLES/Makefile.am | 91 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 84 insertions(+), 7 deletions(-) diff --git a/SLES/Makefile.am b/SLES/Makefile.am index de8f7f8..64d9416 100644 --- a/SLES/Makefile.am +++ b/SLES/Makefile.am @@ -1,16 +1,93 @@ # -# Makefile.am for slide-show/slide +# Makefile.am for slide-show/SLED # -instdir = /SuSE/SuSE-SLES/CD1/suse/setup/slide +instdir = /SuSE/SuSE-SLES/CD1/suse/setup/slide -# note: txt/*/*.rtf does not work. you get a dir called "txt/*"! -EXTRA_DIST = pic/*.png \ - txt/cs/*.rtf \ - txt/de/*.rtf \ - txt/en/*.rtf +fname = slideshow +# list of languages available in SVN +# CAUTION: Czech is "cs", not "cz"! Use the LANG abbrev, not the country! +langs = +# list of languages ready for distribution _and_ installation +dist_langs = $(langs) +# take the files from txt/LL/*.rtf +# txt/*/*.rtf does not work. you get a dir called "txt/*"! +dist_lang_files = $(addprefix txt/,$(addsuffix /*.rtf,$(dist_langs))) + +EXTRA_DIST = \ + $(fname).xml $(xsl_styles) \ + $(pofiles) \ + pic/*.png \ + $(dist_lang_files) + +xml = $(addsuffix .xml,$(langs)) +rtf = $(xml:.xml=.rtf) +valid = $(xml:.xml=.valid) +# nochunk = $(xml:.xml=.nochunk) +#pofiles = $(xml:.xml=.po) +# po/LL.po +pofiles=$(addprefix po/,$(addsuffix .po,$(langs))) +xsl_styles = $(fname).xsl + +SUFFIXES = .xml .rtf .valid .po .pot + +CLEANFILES = $(rtf) $(valid) $(xml) $(fname).pot + +XSLTPROC = @XSLTPROC@ +XMLLINT = @XMLLINT@ +XML2PO = @XML2PO@ + +MSGMERGE_UPDATE = @MSGMERGE@ --update + +all: validate rtf + +outdir: + rm -fr txt + mkdir txt + +rtf: $(rtf) +%.rtf: %.xml outdir + ll=`echo $< | sed "s/\.xml$$//"`; \ + mkdir txt/$$ll ; \ + $(XSLTPROC) --nonet --stringparam out.dir "txt/$$ll" \ + $(fname).xsl $< 1>/dev/null; \ + pushd txt/$$ll ; \ + for f in *.rtf ; do \ + sed -i 's/\/>/>/;s/%imagedir%/\&imagedir;/' $$f; \ + done ; \ + popd + +validate: $(valid) +%.valid: %.xml + $(XMLLINT) --nonet --valid --noout $< && touch $@ + +pot: $(fname).pot +$(fname).pot: $(fname).xml + $(XMLLINT) --nonet --valid --noout $(fname).xml + $(XML2PO) --expand-all-entities -o $(fname).pot $(fname).xml + +# re-merge po translation files +po: $(pofiles) +$(pofiles): $(fname).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + echo "$(MSGMERGE_UPDATE) po/$${lang}.po $(fname).pot"; \ + if [ $${lang} = en ]; then \ + msgen -o po/$${lang}.po $(fname).pot ;\ + else $(MSGMERGE_UPDATE) po/$${lang}.po $(fname).pot ; fi + +xml: $(xml) +%.xml: po/%.po + @lang=`echo $@ | sed -e 's,.*/,,' -e 's,$(fname)_/,,' -e 's/\.xml$$//'`; \ + echo "$(XML2PO) -p po/$${lang}.po -o $${lang}.xml $(fname).pot"; \ + $(XML2PO) -p po/$${lang}.po -o $${lang}.xml $(fname).xml + +# rndir=$(DESTDIR)$(datadir)/doc/$(PACKAGE_NAME) install-data-local: +# $(mkinstalldirs) $(rndir) +# for file in $(html); do \ +# $(INSTALL_DATA) $$file $(rndir) ; \ +# done mkdir -p $(DESTDIR)/$(instdir) -test -d $(srcdir)/txt && cp -a $(srcdir)/txt $(DESTDIR)/$(instdir) -test -d $(srcdir)/pic && cp -a $(srcdir)/pic $(DESTDIR)/$(instdir)