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 \
15 --xsl-user=data/user_param.xsl \
16 --xsl-user=data/xetex_param.xsl \
21 IMAGES = images/cc.png
25 data/xetex_param.xsl \
28 all: lint lint.nb html epub pdf
30 freeculture.nb.po: freeculture.pot
31 po4a --no-translations --msgmerge-opt --no-location po4a.cfg
33 freeculture.nb.xml: freeculture.nb.po freeculture.xml
34 po4a --translate-only freeculture.nb.xml po4a.cfg
36 pdf: freeculture.nb.pdf freeculture.pdf
37 epub: freeculture.nb.epub
38 html: freeculture.html freeculture.nb.html
40 %.pdf: %.xml $(IMAGES) $(XSLTS)
41 $(DBLATEX) $< --param=lingua=nb
43 # Alternative processing path to dblatex is to use xmlto using fop to
44 # create PDF like this. The PDF output (visual design) is better, but
45 # the PDF index and footnote handling is worse and images are missing.
46 # xmlto --noautosize -m xmlto-pdf.xsl --with-fop pdf $^
48 %.html: %.xml $(IMAGES)
49 xmlto html-nochunks $<
51 %.txt: %.xml $(IMAGES)
54 %.epub: %.xml, $(IMAGES)
58 GET $(url) | gunzip > freeculture.xml
60 freeculture.pot: freeculture.xml
61 po4a-gettextize -f docbook -m $^ > $@.new && mv $@.new $@
63 stats: update-stats progress.png
66 printf "%s " $$(date +"%Y-%m-%dT%H%M") ; \
67 msgfmt -o /dev/null --statistics freeculture.nb.po 2>&1 \
69 progress.png: stats.txt progress.gnuplot
70 awk '{print $$1, $$2, $$5, $$8}' < stats.txt > stats.csv
71 gnuplot progress.gnuplot
74 # Have to disable --postvalid, when using xref with xrefstyle.
75 # See <URL: http://bugs.debian.org/682944 > for the bug report.
76 XMLLINTOPTS = --nonet --noout --xinclude --postvalid
78 xmllint $(XMLLINTOPTS) freeculture.xml
80 lint.nb: freeculture.nb.xml
81 xmllint $(XMLLINTOPTS) freeculture.nb.xml
84 wget -O $@ http://upload.wikimedia.org/wikipedia/commons/9/97/CC_some_rights_reserved_new_2.svg
86 images/cc.png: images/cc.svg
87 inkscape -z -D --export-height=200 -D --export-png=$(shell pwd)/$@ $^