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
33 data/stylesheet-html.xsl
39 data/stylesheet-fo.xsl
42 all: lint lint.nb html epub pdf
44 freeculture.nb.po: freeculture.pot
45 po4a --no-translations --msgmerge-opt --no-location po4a.cfg
47 freeculture.nb.xml: freeculture.nb.po freeculture.xml
48 po4a --translate-only freeculture.nb.xml po4a.cfg
50 pdf: freeculture.nb.pdf freeculture.pdf
51 epub: freeculture.nb.epub
52 html: freeculture.html freeculture.nb.html
54 %.pdf: %.xml $(IMAGES) $(PDF_XSLTS)
57 # Alternative processing path to dblatex is to use xmlto using fop to
58 # create PDF like this. The PDF output (visual design) is better, but
59 # the footnote handling is worse and images are missing.
60 # xmlto --noautosize \
61 # -x data/stylesheet-fo.xsl \
64 # Third alternative is to use xsltproc and fop directly, as
65 # recommended by <URL: http://www.sagehill.net/docbookxsl/index.html > .
66 # This include images, but the index refs and footnote handling is
70 data/stylesheet-fo.xsl \
72 fop -c data/fop-params.xconf -fo myfile.fo -pdf $@
74 %.html: %.xml $(IMAGES) $(HTML_XSLT)
76 -x data/stylesheet-html.xsl \
80 %.txt: %.xml $(IMAGES)
83 %.epub: %.xml $(IMAGES)
87 GET $(url) | gunzip > freeculture.xml
89 freeculture.pot: freeculture.xml
90 po4a-gettextize -f docbook -m $^ > $@.new && mv $@.new $@
92 stats: update-stats progress.png
93 update-stats: freeculture.nb.po
95 printf "%s " $$(date +"%Y-%m-%dT%H%M") ; \
96 msgfmt -o /dev/null --statistics freeculture.nb.po 2>&1 \
98 progress.png: stats.txt progress.gnuplot
99 awk '{print $$1, $$2, $$5, $$8}' < stats.txt > stats.csv
100 gnuplot progress.gnuplot
103 # Have to disable --postvalid, when using xref with xrefstyle.
104 # See <URL: http://bugs.debian.org/682944 > for the bug report.
105 XMLLINTOPTS = --nonet --noout --xinclude --postvalid
106 lint: freeculture.xml
107 xmllint $(XMLLINTOPTS) freeculture.xml
109 lint.nb: freeculture.nb.xml
110 xmllint $(XMLLINTOPTS) freeculture.nb.xml
113 wget -O $@ http://upload.wikimedia.org/wikipedia/commons/9/97/CC_some_rights_reserved_new_2.svg
115 images/cc.png: images/cc.svg
116 inkscape -z -D --export-height=200 -D --export-png=$(shell pwd)/$@ $^