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
26 data/xetex_param.xsl \
29 all: lint lint.nb html epub pdf
31 freeculture.nb.po: freeculture.pot
32 po4a --no-translations --msgmerge-opt --no-location po4a.cfg
34 freeculture.nb.xml: freeculture.nb.po freeculture.xml
35 po4a --translate-only freeculture.nb.xml po4a.cfg
37 pdf: freeculture.nb.pdf freeculture.pdf
38 epub: freeculture.nb.epub
39 html: freeculture.html freeculture.nb.html
41 %.pdf: %.xml $(IMAGES) $(XSLTS)
44 # Alternative processing path to dblatex is to use xmlto using fop to
45 # create PDF like this. The PDF output (visual design) is better, but
46 # the footnote handling is worse and images are missing.
47 # xmlto --noautosize \
48 # --stringparam fop1.extensions=1 \
49 # --stringparam insert.xref.page.number=1 \
50 # --stringparam page.width=6in \
51 # --stringparam page.height=9in \
52 # --stringparam page.margin.inner=1.0in \
53 # --stringparam page.margin.outer=0.8in \
54 # --stringparam body.start.indent=0pt \
55 # --stringparam body.font.family=Times \
56 # --stringparam title.font.family=Times \
57 # --stringparam dingbat.font.family=Times \
58 # --stringparam generate.toc='book toc title' \
59 # --stringparam hyphenate=false \
62 # Third alternative is to use xsltproc and fop directly, as
63 # recommended by <URL: http://www.sagehill.net/docbookxsl/index.html > .
64 # This include images, but the index refs and footnote handling is
68 --stringparam fop1.extensions 1 \
69 --stringparam insert.xref.page.number 1 \
70 --stringparam page.width 6in \
71 --stringparam page.height 9in \
72 --stringparam page.margin.inner 1.0in \
73 --stringparam page.margin.outer 0.8in \
74 --stringparam body.start.indent 0pt \
75 --stringparam body.font.family Times \
76 --stringparam title.font.family Times \
77 --stringparam dingbat.font.family Times \
78 --stringparam generate.toc 'book toc title' \
79 --stringparam hyphenate false \
80 /usr/share/xml/docbook/stylesheet/docbook-xsl/fo/docbook.xsl \
82 fop -fo myfile.fo -pdf $@
84 %.html: %.xml $(IMAGES)
85 xmlto html-nochunks $<
87 %.txt: %.xml $(IMAGES)
90 %.epub: %.xml $(IMAGES)
94 GET $(url) | gunzip > freeculture.xml
96 freeculture.pot: freeculture.xml
97 po4a-gettextize -f docbook -m $^ > $@.new && mv $@.new $@
99 stats: update-stats progress.png
100 update-stats: freeculture.nb.po
102 printf "%s " $$(date +"%Y-%m-%dT%H%M") ; \
103 msgfmt -o /dev/null --statistics freeculture.nb.po 2>&1 \
105 progress.png: stats.txt progress.gnuplot
106 awk '{print $$1, $$2, $$5, $$8}' < stats.txt > stats.csv
107 gnuplot progress.gnuplot
110 # Have to disable --postvalid, when using xref with xrefstyle.
111 # See <URL: http://bugs.debian.org/682944 > for the bug report.
112 XMLLINTOPTS = --nonet --noout --xinclude --postvalid
113 lint: freeculture.xml
114 xmllint $(XMLLINTOPTS) freeculture.xml
116 lint.nb: freeculture.nb.xml
117 xmllint $(XMLLINTOPTS) freeculture.nb.xml
120 wget -O $@ http://upload.wikimedia.org/wikipedia/commons/9/97/CC_some_rights_reserved_new_2.svg
122 images/cc.png: images/cc.svg
123 inkscape -z -D --export-height=200 -D --export-png=$(shell pwd)/$@ $^