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 %.epub: %.xml, $(IMAGES)
51 GET $(url) | gunzip > freeculture.xml
53 freeculture.pot: freeculture.xml
54 po4a-gettextize -f docbook -m $^ > $@.new && mv $@.new $@
56 stats: update-stats progress.png
59 printf "%s " $$(date +"%Y-%m-%dT%H%M") ; \
60 msgfmt -o /dev/null --statistics freeculture.nb.po 2>&1 \
62 progress.png: stats.txt progress.gnuplot
63 awk '{print $$1, $$2, $$5, $$8}' < stats.txt > stats.csv
64 gnuplot progress.gnuplot
67 # Have to disable --postvalid, when using xref with xrefstyle.
68 # See <URL: http://bugs.debian.org/682944 > for the bug report.
69 XMLLINTOPTS = --nonet --noout --xinclude --postvalid
71 xmllint $(XMLLINTOPTS) freeculture.xml
73 lint.nb: freeculture.nb.xml
74 xmllint $(XMLLINTOPTS) freeculture.nb.xml
77 wget -O $@ http://upload.wikimedia.org/wikipedia/commons/9/97/CC_some_rights_reserved_new_2.svg
79 images/cc.png: images/cc.svg
80 convert -adaptive-resize 500x200 $^ $@