chiark / gitweb /
Mention collab-maint in the VCS section. Closes: #496815
[developers-reference.git] / Makefile
index 3699123c6a4164bc74d24786d448abf3a0b111e1..5c19b3bbf7f65b18688230e5f8c91a1ab3b04821 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,14 +4,14 @@
 
 SOURCES                := $(wildcard *.dbk) common.ent version.ent
 
 
 SOURCES                := $(wildcard *.dbk) common.ent version.ent
 
-FORMATS                := html txt pdf
-LANGS           := fr ja
+FORMATS                := html txt pdf epub
+LANGS           := de fr ja
 TARGETS                := $(foreach fmt,$(FORMATS),developers-reference.$(fmt)) \
                   $(foreach lng,$(LANGS), \
                       $(foreach fmt,$(FORMATS), \
                           $(lng)/developers-reference.$(fmt)))
 # list of targets, that currently cannot build
 TARGETS                := $(foreach fmt,$(FORMATS),developers-reference.$(fmt)) \
                   $(foreach lng,$(LANGS), \
                       $(foreach fmt,$(FORMATS), \
                           $(lng)/developers-reference.$(fmt)))
 # list of targets, that currently cannot build
-BLACKLIST      := ja/developers-reference.pdf
+#BLACKLIST     := ja/developers-reference.pdf
 
 # hopefully overwritten by caller, e.g. debian/rules
 VERSION=unknown
 
 # hopefully overwritten by caller, e.g. debian/rules
 VERSION=unknown
@@ -27,8 +27,7 @@ XL=xmllint --nonet --noout --postvalid --xinclude
 # - fop is currently in contrib, but can go to main, see #366783
 # - xmlroff (not mature enough, #182445)
 DBLATEX=dblatex --style=db2latex
 # - fop is currently in contrib, but can go to main, see #366783
 # - xmlroff (not mature enough, #182445)
 DBLATEX=dblatex --style=db2latex
-# The "--keep 0" should be removed as soon as the translations are ready
-TRANSLATE=po4a-translate --format docbook --keep 0
+TRANSLATE=po4a po4a/po4a.cfg
 
 # XSL files and parameters
 # note: the URL is used as identifier, no HTTP is used!
 
 # XSL files and parameters
 # note: the URL is used as identifier, no HTTP is used!
@@ -60,6 +59,7 @@ publish:      all
        ln -sf index.en.html $(PUBLISHDIR)/developers-reference/index.html
        ln -sf developers-reference.en.pdf $(PUBLISHDIR)/developers-reference/developers-reference.pdf
        ln -sf developers-reference.en.txt $(PUBLISHDIR)/developers-reference/developers-reference.txt
        ln -sf index.en.html $(PUBLISHDIR)/developers-reference/index.html
        ln -sf developers-reference.en.pdf $(PUBLISHDIR)/developers-reference/developers-reference.pdf
        ln -sf developers-reference.en.txt $(PUBLISHDIR)/developers-reference/developers-reference.txt
+       ln -sf developers-reference.en.epub $(PUBLISHDIR)/developers-reference/developers-reference.epub
 
 .PHONY: developers-reference.html %/developers-reference.html
 developers-reference.html:     $(CURDIR)/index.html
 
 .PHONY: developers-reference.html %/developers-reference.html
 developers-reference.html:     $(CURDIR)/index.html
@@ -75,12 +75,13 @@ index.html:                 $(CURDIR)/developers-reference.html
 .PRECIOUS:             %.dbk %.ent
 ifndef LINGUA
 %.dbk %.ent: FORCE
 .PRECIOUS:             %.dbk %.ent
 ifndef LINGUA
 %.dbk %.ent: FORCE
+       $(TRANSLATE)
        $(MAKE) $@ LINGUA=`basename $(@D)`
 
 FORCE:
 else
        $(MAKE) $@ LINGUA=`basename $(@D)`
 
 FORCE:
 else
-$(LINGUA)/%.dbk:       %.dbk $(patsubst %.dbk,po4a/$(LINGUA)/%.po,%.dbk)
-       $(TRANSLATE) -m $< -p po4a/$(@:.dbk=.po) -l $@
+$(LINGUA)/%.dbk:       %.dbk po4a/$(LINGUA).po
+       $(TRANSLATE)
 
 $(LINGUA)/common.ent:  common.ent
        cd $(@D) && ln -sf ../$(@F) .
 
 $(LINGUA)/common.ent:  common.ent
        cd $(@D) && ln -sf ../$(@F) .
@@ -89,34 +90,43 @@ endif
 developers-reference.txt:      $(CURDIR)/developers-reference.txt
 %/developers-reference.txt:    $(addprefix %/,$(SOURCES))
        $(XP) $(DBK2HTML1) $(@D)/index.dbk \
 developers-reference.txt:      $(CURDIR)/developers-reference.txt
 %/developers-reference.txt:    $(addprefix %/,$(SOURCES))
        $(XP) $(DBK2HTML1) $(@D)/index.dbk \
-           | w3m -cols 70 -dump -no-graph -T text/html > $@
+           | LC_ALL=C.UTF-8 w3m -o display_charset=UTF-8 -cols 70 -dump -no-graph -T text/html > $@
+
+XSLT           := xslt
 
 developers-reference.pdf:       $(CURDIR)/developers-reference.pdf
 %/developers-reference.pdf:     $(addprefix %/,$(SOURCES))
 
 developers-reference.pdf:       $(CURDIR)/developers-reference.pdf
 %/developers-reference.pdf:     $(addprefix %/,$(SOURCES))
-       TOP=`pwd` && cd $(@D) && $(DBLATEX) index.dbk \
-           && mv index.dbk.pdf $(@F)
+       $(DBLATEX) $(@D)/index.dbk \
+           --backend=xetex \
+           --xsl-user=$(XSLT)/user_param.xsl \
+           --xsl-user=$(XSLT)/xetex_param.xsl \
+           --param=lingua=$(@D) \
+           && mv $(@D)/index.dbk.pdf $@
+
+developers-reference.epub:      $(CURDIR)/developers-reference.epub
+%/developers-reference.epub:     $(addprefix %/,$(SOURCES))
+       TOP=`pwd` && cd $(@D) && xmlto epub index.dbk && mv index.epub $(@F)
 
 .PHONY: pot
 
 .PHONY: pot
-pot:                           $(patsubst %.dbk,po4a/po/%.pot,$(SOURCES))
-po4a/po/%.pot:                 %.dbk
-       po4a-gettextize --format docbook --master $< --po $@
+pot:                                   po4a/po/developers-reference.pot
+po4a/po/developers-reference.pot:      %.dbk
+       $(TRANSLATE)
 
 ifdef LINGUA
 .PHONY: updatepo
 
 ifdef LINGUA
 .PHONY: updatepo
-updatepo:                      $(patsubst %.dbk,po4a/$(LINGUA)/%.po,$(SOURCES))
-po4a/$(LINGUA)/%.po:           %.dbk
-       po4a-updatepo --previous --format docbook --master $< --po $@
+updatepo:                      po4a/po/$(LINGUA).po
+po4a/po/$(LINGUA).po:          %.dbk
+       $(TRANSLATE)
 endif
 
 tidypo:
 endif
 
 tidypo:
-       for po in $(wildcard po4a/*/*.po po4a/*/*.pot); do \
-           msgcat $$po > $$po.tmp && mv $$po.tmp $$po; \
+       for po in po4a/po/*.po; do \
+           msgcat -o $$po $$po; \
        done
 
 checkpo:
        done
 
 checkpo:
-       @for po in $(wildcard po4a/*/*.po po4a/*/*.pot); do \
-           echo $$po; \
-           msgfmt --check --verbose $$po; \
+       @for po in po4a/po/*.po; do \
+           msgfmt -vv $$po; \
        done
 
 %/version.ent:
        done
 
 %/version.ent:
@@ -125,7 +135,7 @@ checkpo:
 
 .PHONY: clean
 clean:
 
 .PHONY: clean
 clean:
-       rm -f *.fo *.html *.pdf *.txt
+       rm -f *.fo *.html *.pdf *.txt *.epub
        for L in $(LANGS); do rm -rf `basename ./"$$L"/`; done
        rm -f version.ent
        rm -f `find . -name "*~" -o -name "*.bak"`
        for L in $(LANGS); do rm -rf `basename ./"$$L"/`; done
        rm -f version.ent
        rm -f `find . -name "*~" -o -name "*.bak"`