5 url = http://www.sslug.dk/~chlor/lessig/freeculture.sgml.2004-04-01.gz
8 # Valid book options are a4paper, a5paper, b5paper, letterpaper,
9 # legalpaper, landscape, 11pt, 12pt, oneside, twocolumn, notitlepage,
10 # titlepage, openany, draft, fleqn, leqno
12 -P latex.class.options=a5paper \
16 --xsl-user=data/user_param.xsl \
17 --xsl-user=data/xetex_param.xsl \
22 IMAGES = images/cc.png
26 data/xetex_param.xsl \
29 all: lint lint.nb html epub pdf
31 freeculture.nb.po: freeculture.pot
32 po4a --no-translations --msgmerge-opt --no-location po4a.cfg
34 freeculture.nb.xml: freeculture.nb.po freeculture.xml
35 po4a --translate-only freeculture.nb.xml po4a.cfg
37 pdf: freeculture.nb.pdf freeculture.pdf
38 epub: freeculture.nb.epub
39 html: freeculture.html freeculture.nb.html
41 %.pdf: %.xml $(IMAGES) $(XSLTS)
44 # Alternative processing path to dblatex is to use xmlto using fop to
45 # create PDF like this. The PDF output (visual design) is better, but
46 # the footnote handling is worse and images are missing.
47 # xmlto --noautosize --stringparam paper.type=A5 \
48 # --stringparam fop1.extensions=1 \
51 # Third alternative is to use xsltproc and fop directly, as
52 # recommended by <URL: http://www.sagehill.net/docbookxsl/index.html > .
53 # This include images, but the index refs and footnote handling is
57 --stringparam paper.type A5 \
58 --stringparam fop1.extensions 1 \
59 /usr/share/xml/docbook/stylesheet/docbook-xsl/fo/docbook.xsl \
61 fop -fo myfile.fo -pdf $@
63 %.html: %.xml $(IMAGES)
64 xmlto html-nochunks $<
66 %.txt: %.xml $(IMAGES)
69 %.epub: %.xml $(IMAGES)
73 GET $(url) | gunzip > freeculture.xml
75 freeculture.pot: freeculture.xml
76 po4a-gettextize -f docbook -m $^ > $@.new && mv $@.new $@
78 stats: update-stats progress.png
81 printf "%s " $$(date +"%Y-%m-%dT%H%M") ; \
82 msgfmt -o /dev/null --statistics freeculture.nb.po 2>&1 \
84 progress.png: stats.txt progress.gnuplot
85 awk '{print $$1, $$2, $$5, $$8}' < stats.txt > stats.csv
86 gnuplot progress.gnuplot
89 # Have to disable --postvalid, when using xref with xrefstyle.
90 # See <URL: http://bugs.debian.org/682944 > for the bug report.
91 XMLLINTOPTS = --nonet --noout --xinclude --postvalid
93 xmllint $(XMLLINTOPTS) freeculture.xml
95 lint.nb: freeculture.nb.xml
96 xmllint $(XMLLINTOPTS) freeculture.nb.xml
99 wget -O $@ http://upload.wikimedia.org/wikipedia/commons/9/97/CC_some_rights_reserved_new_2.svg
101 images/cc.png: images/cc.svg
102 inkscape -z -D --export-height=200 -D --export-png=$(shell pwd)/$@ $^