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 \
22 IMAGES = images/cc.png
24 all: lint lint.nb html epub pdf
26 freeculture.nb.po: freeculture.pot
27 po4a --no-translations --msgmerge-opt --no-location po4a.cfg
29 freeculture.nb.xml: freeculture.nb.po freeculture.xml
30 po4a --translate-only freeculture.nb.xml po4a.cfg
32 pdf: freeculture.nb.pdf freeculture.pdf
33 epub: freeculture.nb.epub
34 html: freeculture.html freeculture.nb.html
36 %.pdf: %.xml $(IMAGES)
37 $(DBLATEX) $< --param=lingua=nb
39 # Alternative processing path to dblatex is to use xmlto using fop to
40 # create PDF like this. The PDF output (visual design) is better, but
41 # the PDF index and footnote handling is worse and images are missing.
42 # xmlto --noautosize -m xmlto-pdf.xsl --with-fop pdf $^
44 %.html: %.xml $(IMAGES)
45 xmlto html-nochunks $<
47 %.txt: %.xml $(IMAGES)
50 %.epub: %.xml, $(IMAGES)
54 GET $(url) | gunzip > freeculture.xml
56 freeculture.pot: freeculture.xml
57 po4a-gettextize -f docbook -m $^ > $@.new && mv $@.new $@
59 stats: update-stats progress.png
62 printf "%s " $$(date +"%Y-%m-%dT%H%M") ; \
63 msgfmt -o /dev/null --statistics freeculture.nb.po 2>&1 \
65 progress.png: stats.txt progress.gnuplot
66 awk '{print $$1, $$2, $$5, $$8}' < stats.txt > stats.csv
67 gnuplot progress.gnuplot
70 # Have to disable --postvalid, when using xref with xrefstyle.
71 # See <URL: http://bugs.debian.org/682944 > for the bug report.
72 XMLLINTOPTS = --nonet --noout --xinclude --postvalid
74 xmllint $(XMLLINTOPTS) freeculture.xml
76 lint.nb: freeculture.nb.xml
77 xmllint $(XMLLINTOPTS) freeculture.nb.xml
80 wget -O $@ http://upload.wikimedia.org/wikipedia/commons/9/97/CC_some_rights_reserved_new_2.svg
82 images/cc.png: images/cc.svg
83 inkscape -z -D --export-height=200 -D --export-png=$(shell pwd)/$@ $^