]> pere.pagekite.me Git - text-free-culture-lessig.git/blobdiff - Makefile
Mention how Marc Jeanmougin helped me with the cover image.
[text-free-culture-lessig.git] / Makefile
index ad47ea02c250bdf67e1667263e3420347c66efc2..57f31fdd2536664d52ea5076116f46c3cea4f371 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -9,17 +9,22 @@ 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
 # 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 \
        -T simple \
-       --param lingua=nb \
+       -b xetex \
+       -r data/dblatex-postprocess \
+       --indexstyle=myindexstyle.ist \
        --xsl-user=data/user_param.xsl \
        --xsl-user=data/xetex_param.xsl \
        --xsl-user=data/user_param.xsl \
        --xsl-user=data/xetex_param.xsl \
+       -V \
+       -P latex.index.tool=xindy \
        -p data/pdf.xsl
 
 
 DBTOEPUB = dbtoepub
 
        -p data/pdf.xsl
 
 
 DBTOEPUB = dbtoepub
 
-IMAGES = images/cc.png
+IMAGES = images/cc.png images/pattern-modern-media-ownership.png images/tom-the-dancing-bug.png
 
 XSLT = \
   data/user_param.xsl
 
 XSLT = \
   data/user_param.xsl
@@ -33,6 +38,7 @@ HTML_XSLT = \
   data/stylesheet-html.xsl
 
 PDF_XSLT = \
   data/stylesheet-html.xsl
 
 PDF_XSLT = \
+  $(DB_XSLT) \
   $(XSLT) \
   data/lulu.xsl \
   data/licentia.xsl \
   $(XSLT) \
   data/lulu.xsl \
   data/licentia.xsl \
@@ -40,7 +46,7 @@ PDF_XSLT = \
   data/stylesheet-fo.xsl
 
 
   data/stylesheet-fo.xsl
 
 
-all: lint lint.nb html epub pdf
+all: lint lint.nb html epub pdf mobi
 
 freeculture.nb.po: freeculture.pot
        po4a --no-translations --msgmerge-opt --no-location po4a.cfg
 
 freeculture.nb.po: freeculture.pot
        po4a --no-translations --msgmerge-opt --no-location po4a.cfg
@@ -48,16 +54,22 @@ freeculture.nb.po: freeculture.pot
 freeculture.nb.xml: freeculture.nb.po freeculture.xml
        po4a --translate-only freeculture.nb.xml 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 
+
 pdf: freeculture.nb.pdf freeculture.pdf
 pdf: freeculture.nb.pdf freeculture.pdf
-epub: freeculture.nb.epub 
-html: freeculture.html freeculture.nb.html 
+epub: freeculture.nb.epub freeculture.epub 
+mobi: freeculture.nb.mobi freeculture.mobi 
+html: freeculture.nb.html freeculture.html 
 
 
-%.pdf: %.xml $(IMAGES) $(PDF_XSLT)
+%.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
 # Possible pipelines:
 #
 # dblatex:
 #   This converts the docbook content to latex and leave it to latex
-#   to format it.
+#   to format it.  Index ranges are broken in oldstable, fixed in jessie.
 #
 # xmlto:
 #   Alternative processing path to dblatex is to use xmlto using fop
 #
 # xmlto:
 #   Alternative processing path to dblatex is to use xmlto using fop
@@ -67,14 +79,14 @@ html: freeculture.html freeculture.nb.html
 # docbook-xsl:
 #   Third alternative is to use xsltproc and fop directly, as
 #   recommended by <URL: http://www.sagehill.net/docbookxsl/index.html >.
 # docbook-xsl:
 #   Third alternative is to use xsltproc and fop directly, as
 #   recommended by <URL: http://www.sagehill.net/docbookxsl/index.html >.
-#   This include images, but the index refs and footnote handling
+#   This include images, but the index refs and footnote/endnote handling
 #   is broken.
 
        pipeline=dblatex; \
        echo "Using $$pipeline pipeline" ; \
        case "$$pipeline" in  \
        dblatex) \
 #   is broken.
 
        pipeline=dblatex; \
        echo "Using $$pipeline pipeline" ; \
        case "$$pipeline" in  \
        dblatex) \
-         $(DBLATEX) $< ; \
+         PATH=$(PWD)/bin:$$PATH $(DBLATEX) $(DBLATEX_OPTS) $< ; \
          ;; \
        xmlto) \
          xmlto --noautosize \
          ;; \
        xmlto) \
          xmlto --noautosize \
@@ -91,8 +103,8 @@ html: freeculture.html freeculture.nb.html
        esac
 
 pdf-compare: freeculture.xml $(IMAGES)
        esac
 
 pdf-compare: freeculture.xml $(IMAGES)
-       dblatex -o freeculture-dblatex.pdf freeculture.xml
-       dblatex -T db2latex \-o freeculture-dblatex-db2latex.pdf freeculture.xml
+       $(DBLATEX) -o freeculture-dblatex.pdf freeculture.xml
+       $(DBLATEX) -T db2latex \-o freeculture-dblatex-db2latex.pdf freeculture.xml
 
        # plain xmlto fail
        #xmlto pdf freeculture.xml && mv freeculture.pdf freeculture-xmlto.pdf
 
        # plain xmlto fail
        #xmlto pdf freeculture.xml && mv freeculture.pdf freeculture-xmlto.pdf
@@ -115,21 +127,26 @@ pdf-compare: freeculture.xml $(IMAGES)
 %.epub: %.xml $(IMAGES)
        $(DBTOEPUB) $<
 
 %.epub: %.xml $(IMAGES)
        $(DBTOEPUB) $<
 
+%.mobi: %.epub
+       ebook-convert $< $@
+
 freeculture.xml:
        GET $(url) | gunzip > freeculture.xml
 
 # <beginpage> workaround can be removed when BTS #684137 is fixed in
 # po4a.
 freeculture.xml:
        GET $(url) | gunzip > 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>' \
        po4a-gettextize -o nodefault='<beginpage>' -o inline='<beginpage>' \
-         -f docbook -m $^  > $@.new && mv $@.new $@
+         -f docbook -m freeculture.xml -m cover-text.xml  > $@.new && mv $@.new $@
 
 stats: update-stats progress.png
 
 stats: update-stats progress.png
-update-stats: freeculture.nb.po
+update-stats: freeculture.nb.po lint.nb
        ( \
        printf "%s " $$(date +"%Y-%m-%dT%H%M") ; \
        msgfmt -o /dev/null --statistics freeculture.nb.po 2>&1 \
        ( \
        printf "%s " $$(date +"%Y-%m-%dT%H%M") ; \
        msgfmt -o /dev/null --statistics freeculture.nb.po 2>&1 \
-       ) | tee -a stats.txt
+       ) \
+         | sed -e 's/translated messages/oversatte meldinger/' -e 's/fuzzy translations/antatte oversettelser/' -e 's/untranslated messages/oversatte meldinger/' \
+         | tee -a stats.txt
 progress.png: stats.txt progress.gnuplot
        awk '{print $$1, $$2, $$5, $$8}' < stats.txt > stats.csv
        gnuplot progress.gnuplot
 progress.png: stats.txt progress.gnuplot
        awk '{print $$1, $$2, $$5, $$8}' < stats.txt > stats.csv
        gnuplot progress.gnuplot
@@ -149,3 +166,21 @@ images/cc.svg:
 
 images/cc.png: images/cc.svg
        inkscape -z -D --export-height=200 -D --export-png=$(shell pwd)/$@ $^
 
 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-pdf=$@ $^
+
+.xcf.png:
+       convert $^ $@
+
+clean:
+       $(RM) *~
+
+distclean: clean
+       $(RM) freeculture-docbook-xsl.pdf \
+       freeculture-docbook-xsl.fo \
+       freeculture-dblatex-db2latex.pdf \
+       freeculture-dblatex.pdf \
+       freeculture-xmlto-fop.pdf
+
+.SUFFIXES: .png .xcf .svg .xml .pdf