]> pere.pagekite.me Git - text-free-culture-lessig.git/blobdiff - Makefile
Add build rules for the Danish version.
[text-free-culture-lessig.git] / Makefile
index 482d5dafbc93ee79c551ff7cb4e6263e537b6054..48dd362b835212e706c9cef3e7c2e72204feaed7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -9,20 +9,31 @@ url = http://www.sslug.dk/~chlor/lessig/freeculture.sgml.2004-04-01.gz
 # legalpaper, landscape, 11pt, 12pt, oneside, twocolumn, notitlepage,
 # titlepage, openany, draft, fleqn, leqno
 #  -P latex.class.options=a5paper
-DBLATEX = dblatex \
+DBLATEX = dblatex
+DBLATEX_OPTS = \
        -T simple \
        -b xetex \
        -r data/dblatex-postprocess \
        --indexstyle=myindexstyle.ist \
-       --param lingua=nb \
        --xsl-user=data/user_param.xsl \
        --xsl-user=data/xetex_param.xsl \
+       -V \
+       -P latex.index.tool=xindy \
        -p data/pdf.xsl
 
 
 DBTOEPUB = dbtoepub
 
-IMAGES = images/cc.png images/pattern-modern-media-ownership.png images/tom-the-dancing-bug.png
+IMAGES = \
+       images/cc.png \
+       images/pattern-modern-media-ownership.png \
+       images/tom-the-dancing-bug.png \
+       images/cover-front-10dpi.png \
+       images/cover-front-72dpi.png \
+       images/fr/cover-front-10dpi.png \
+       images/fr/cover-front-72dpi.png \
+       images/nb/cover-front-10dpi.png \
+       images/nb/cover-front-72dpi.png
 
 XSLT = \
   data/user_param.xsl
@@ -35,7 +46,13 @@ HTML_XSLT = \
   data/html.xsl \
   data/stylesheet-html.xsl
 
+EPUB_XSLT = \
+  $(XSLT) \
+  data/html.xsl \
+  data/stylesheet-epub.xsl
+
 PDF_XSLT = \
+  $(DB_XSLT) \
   $(XSLT) \
   data/lulu.xsl \
   data/licentia.xsl \
@@ -43,30 +60,31 @@ PDF_XSLT = \
   data/stylesheet-fo.xsl
 
 
-all: lint lint.nb html epub pdf mobi
+all: lint lint.nb lint.fr html epub pdf mobi
 
-freeculture.nb.po: freeculture.pot
+freeculture.nb.po freeculture.fr.po freeculture.da.po: freeculture.pot
        po4a --no-translations --msgmerge-opt --no-location po4a.cfg
 
 freeculture.nb.xml: freeculture.nb.po freeculture.xml
        po4a --translate-only freeculture.nb.xml po4a.cfg 
 
-freeculture.es_419.po: freeculture.pot
-       po4a --no-translations --msgmerge-opt --no-location po4a.cfg
-freeculture.es_419.xml: freeculture.es_419.po freeculture.xml
-       po4a --translate-only freeculture.es_419.xml po4a.cfg 
+freeculture.fr.xml: freeculture.fr.po freeculture.xml
+       po4a --translate-only freeculture.fr.xml po4a.cfg 
 
-pdf: freeculture.nb.pdf freeculture.pdf
-epub: freeculture.nb.epub freeculture.epub 
-mobi: freeculture.nb.mobi freeculture.mobi 
-html: freeculture.nb.html freeculture.html 
+freeculture.da.xml: freeculture.da.po freeculture.xml
+       po4a --translate-only freeculture.da.xml po4a.cfg 
 
-%.pdf: %.xml $(IMAGES) $(PDF_XSLT) Makefile
+pdf: freeculture.nb.pdf freeculture.fr.pdf freeculture.pdf
+epub: freeculture.nb.epub freeculture.fr.epub freeculture.epub 
+mobi: freeculture.nb.mobi freeculture.fr.mobi freeculture.mobi 
+html: freeculture.nb.html freeculture.fr.html freeculture.html 
+
+%.pdf: %.xml $(IMAGES) $(PDF_XSLT) Makefile myclass.cls data/dblatex-postprocess
 # Possible pipelines:
 #
 # dblatex:
 #   This converts the docbook content to latex and leave it to latex
-#   to format it.  Index ranges are broken.
+#   to format it.  Index ranges are broken in oldstable, fixed in jessie.
 #
 # xmlto:
 #   Alternative processing path to dblatex is to use xmlto using fop
@@ -83,7 +101,7 @@ html: freeculture.nb.html freeculture.html
        echo "Using $$pipeline pipeline" ; \
        case "$$pipeline" in  \
        dblatex) \
-         $(DBLATEX) $< ; \
+         PATH=$(PWD)/bin:$$PATH $(DBLATEX) $(DBLATEX_OPTS) $< ; \
          ;; \
        xmlto) \
          xmlto --noautosize \
@@ -121,8 +139,10 @@ pdf-compare: freeculture.xml $(IMAGES)
 %.txt: %.xml $(IMAGES)
        xmlto txt $<
 
-%.epub: %.xml $(IMAGES)
-       $(DBTOEPUB) $<
+%.epub: %.xml $(IMAGES) $(EPUB_XSLT)
+       $(DBTOEPUB) \
+       -s data/stylesheet-epub.xsl \
+       $<
 
 %.mobi: %.epub
        ebook-convert $< $@
@@ -132,9 +152,10 @@ freeculture.xml:
 
 # <beginpage> workaround can be removed when BTS #684137 is fixed in
 # po4a.
-freeculture.pot: freeculture.xml
+freeculture.pot: freeculture.xml cover-text.xml
        po4a-gettextize -o nodefault='<beginpage>' -o inline='<beginpage>' \
-         -f docbook -m $^  > $@.new && mv $@.new $@
+          -o attributes='href' \
+         -f docbook -m freeculture.xml -m cover-text.xml  > $@.new && mv $@.new $@
 
 stats: update-stats progress.png
 update-stats: freeculture.nb.po lint.nb
@@ -158,12 +179,46 @@ lint: freeculture.xml
 lint.nb: freeculture.nb.xml
        xmllint  $(XMLLINTOPTS) freeculture.nb.xml
 
+lint.fr: freeculture.fr.xml
+       xmllint  $(XMLLINTOPTS) freeculture.fr.xml
+
+lint.da: freeculture.da.xml
+       xmllint  $(XMLLINTOPTS) freeculture.da.xml
+
 images/cc.svg:
        wget -O $@ http://upload.wikimedia.org/wikipedia/commons/9/97/CC_some_rights_reserved_new_2.svg
 
 images/cc.png: images/cc.svg
        inkscape -z -D --export-height=200 -D --export-png=$(shell pwd)/$@ $^
 
+images/cover-art.pdf: images/cover-art.svg
+       inkscape --export-dpi=600 --export-pdf=$@ $^
+
+images/nb/cover-art.pdf: images/nb/cover-art.svg
+       inkscape --export-dpi=600 --export-pdf=$@ $^
+
+images/fr/cover-art.pdf: images/fr/cover-art.svg
+       inkscape --export-dpi=600 --export-pdf=$@ $^
+
+INKSCAPE_FRONTCOORDINATES = 603.54:0:1154.70:832.500
+images/cover-front-72dpi.png: images/cover-art.svg Makefile
+       inkscape --export-dpi=72 --export-png=$@ -a $(INKSCAPE_FRONTCOORDINATES) images/cover-art.svg
+
+images/nb/cover-front-72dpi.png: images/nb/cover-art.svg Makefile
+       inkscape --export-dpi=72 --export-png=$@ -a $(INKSCAPE_FRONTCOORDINATES) images/nb/cover-art.svg
+
+images/fr/cover-front-72dpi.png: images/fr/cover-art.svg Makefile
+       inkscape --export-dpi=72 --export-png=$@ -a $(INKSCAPE_FRONTCOORDINATES) images/fr/cover-art.svg
+
+images/cover-front-10dpi.png: images/cover-art.svg Makefile
+       inkscape --export-dpi=10 --export-png=$@ -a $(INKSCAPE_FRONTCOORDINATES) images/cover-art.svg
+
+images/nb/cover-front-10dpi.png: images/nb/cover-art.svg Makefile
+       inkscape --export-dpi=10 --export-png=$@ -a $(INKSCAPE_FRONTCOORDINATES) images/nb/cover-art.svg
+
+images/fr/cover-front-10dpi.png: images/fr/cover-art.svg Makefile
+       inkscape --export-dpi=10 --export-png=$@ -a $(INKSCAPE_FRONTCOORDINATES) images/fr/cover-art.svg
+
 .xcf.png:
        convert $^ $@
 
@@ -171,10 +226,34 @@ clean:
        $(RM) *~
 
 distclean: clean
-       $(RM) freeculture-docbook-xsl.pdf \
+       $(RM) \
+       freeculture.pdf \
+       freeculture.epub \
+       freeculture.html \
+       freeculture.txt \
+       freeculture.mobi \
+       freeculture.nb.pdf \
+       freeculture.nb.epub \
+       freeculture.nb.html \
+       freeculture.nb.txt \
+       freeculture.nb.mobi \
+       freeculture.nb.xml \
+       freeculture.fr.pdf \
+       freeculture.fr.epub \
+       freeculture.fr.html \
+       freeculture.fr.txt \
+       freeculture.fr.mobi \
+       freeculture.fr.xml \
+       freeculture.da.pdf \
+       freeculture.da.epub \
+       freeculture.da.html \
+       freeculture.da.txt \
+       freeculture.da.mobi \
+       freeculture.da.xml \
+       freeculture-docbook-xsl.pdf \
        freeculture-docbook-xsl.fo \
        freeculture-dblatex-db2latex.pdf \
        freeculture-dblatex.pdf \
        freeculture-xmlto-fop.pdf
 
-.SUFFIXES: .png .xcf .svg .xml
+.SUFFIXES: .png .xcf .svg .xml .pdf