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
11 # -P latex.class.options=a5paper
16 --xsl-user=data/user_param.xsl \
17 --xsl-user=data/xetex_param.xsl \
23 IMAGES = images/cc.png
34 data/stylesheet-html.xsl
41 data/stylesheet-fo.xsl
44 all: lint lint.nb html epub pdf
46 freeculture.nb.po: freeculture.pot
47 po4a --no-translations --msgmerge-opt --no-location po4a.cfg
49 freeculture.nb.xml: freeculture.nb.po freeculture.xml
50 po4a --translate-only freeculture.nb.xml po4a.cfg
52 pdf: freeculture.nb.pdf freeculture.pdf
53 epub: freeculture.nb.epub
54 html: freeculture.html freeculture.nb.html
56 %.pdf: %.xml $(IMAGES) $(PDF_XSLT)
59 # Alternative processing path to dblatex is to use xmlto using fop to
60 # create PDF like this. The PDF output (visual design) is better, but
61 # the footnote handling is worse and images are missing.
62 # xmlto --noautosize \
63 # -x data/stylesheet-fo.xsl \
66 # Third alternative is to use xsltproc and fop directly, as
67 # recommended by <URL: http://www.sagehill.net/docbookxsl/index.html > .
68 # This include images, but the index refs and footnote handling is
72 data/stylesheet-fo.xsl \
74 fop -c data/fop-params.xconf -fo myfile.fo -pdf $@
76 %.html: %.xml $(IMAGES) $(HTML_XSLT)
78 -x data/stylesheet-html.xsl \
82 %.txt: %.xml $(IMAGES)
85 %.epub: %.xml $(IMAGES)
89 GET $(url) | gunzip > freeculture.xml
91 freeculture.pot: freeculture.xml
92 po4a-gettextize -f docbook -m $^ > $@.new && mv $@.new $@
94 stats: update-stats progress.png
95 update-stats: freeculture.nb.po
97 printf "%s " $$(date +"%Y-%m-%dT%H%M") ; \
98 msgfmt -o /dev/null --statistics freeculture.nb.po 2>&1 \
100 progress.png: stats.txt progress.gnuplot
101 awk '{print $$1, $$2, $$5, $$8}' < stats.txt > stats.csv
102 gnuplot progress.gnuplot
105 # Have to disable --postvalid, when using xref with xrefstyle.
106 # See <URL: http://bugs.debian.org/682944 > for the bug report.
107 XMLLINTOPTS = --nonet --noout --xinclude --postvalid
108 lint: freeculture.xml
109 xmllint $(XMLLINTOPTS) freeculture.xml
111 lint.nb: freeculture.nb.xml
112 xmllint $(XMLLINTOPTS) freeculture.nb.xml
115 wget -O $@ http://upload.wikimedia.org/wikipedia/commons/9/97/CC_some_rights_reserved_new_2.svg
117 images/cc.png: images/cc.svg
118 inkscape -z -D --export-height=200 -D --export-png=$(shell pwd)/$@ $^