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
15 -r data/dblatex-postprocess \
16 --indexstyle=myindexstyle.ist \
17 --xsl-user=data/dblatex-endnotes.xsl \
18 --xsl-user=data/user_param.xsl \
19 --xsl-user=data/xetex_param.xsl \
25 IMAGES = images/cc.png images/pattern-modern-media-ownership.png images/tom-the-dancing-bug.png
36 data/stylesheet-html.xsl
43 data/stylesheet-fo.xsl
46 all: lint lint.nb html epub pdf mobi
48 freeculture.nb.po: freeculture.pot
49 po4a --no-translations --msgmerge-opt --no-location po4a.cfg
51 freeculture.nb.xml: freeculture.nb.po freeculture.xml
52 po4a --translate-only freeculture.nb.xml po4a.cfg
54 freeculture.es_419.po: freeculture.pot
55 po4a --no-translations --msgmerge-opt --no-location po4a.cfg
56 freeculture.es_419.xml: freeculture.es_419.po freeculture.xml
57 po4a --translate-only freeculture.es_419.xml po4a.cfg
59 pdf: freeculture.nb.pdf freeculture.pdf
60 epub: freeculture.nb.epub freeculture.epub
61 mobi: freeculture.nb.mobi freeculture.mobi
62 html: freeculture.nb.html freeculture.html
64 %.pdf: %.xml $(IMAGES) $(PDF_XSLT) Makefile
68 # This converts the docbook content to latex and leave it to latex
69 # to format it. Index ranges are broken.
72 # Alternative processing path to dblatex is to use xmlto using fop
73 # to create PDF like this. The PDF output (visual design) is
74 # better, but the footnote handling is worse and images are missing.
77 # Third alternative is to use xsltproc and fop directly, as
78 # recommended by <URL: http://www.sagehill.net/docbookxsl/index.html >.
79 # This include images, but the index refs and footnote/endnote handling
83 echo "Using $$pipeline pipeline" ; \
84 case "$$pipeline" in \
86 PATH=$(PWD)/bin:$$PATH $(DBLATEX) $< ; \
90 -x data/stylesheet-fo.xsl \
95 --output $(subst .pdf,.fo,$@) \
96 data/stylesheet-fo.xsl \
98 fop -c data/fop-params.xconf -fo $(subst .pdf,.fo,$@) -pdf $@ ; \
102 pdf-compare: freeculture.xml $(IMAGES)
103 $(DBLATEX) -o freeculture-dblatex.pdf freeculture.xml
104 $(DBLATEX) -T db2latex \-o freeculture-dblatex-db2latex.pdf freeculture.xml
107 #xmlto pdf freeculture.xml && mv freeculture.pdf freeculture-xmlto.pdf
108 xmlto --with-fop pdf freeculture.xml && mv freeculture.pdf freeculture-xmlto-fop.pdf
110 xsltproc --output freeculture-docbook-xsl.fo \
111 /usr/share/xml/docbook/stylesheet/docbook-xsl/fo/docbook.xsl \
113 fop -fo freeculture-docbook-xsl.fo -pdf freeculture-docbook-xsl.pdf
115 %.html: %.xml $(IMAGES) $(HTML_XSLT)
117 -x data/stylesheet-html.xsl \
121 %.txt: %.xml $(IMAGES)
124 %.epub: %.xml $(IMAGES)
131 GET $(url) | gunzip > freeculture.xml
133 # <beginpage> workaround can be removed when BTS #684137 is fixed in
135 freeculture.pot: freeculture.xml
136 po4a-gettextize -o nodefault='<beginpage>' -o inline='<beginpage>' \
137 -f docbook -m $^ > $@.new && mv $@.new $@
139 stats: update-stats progress.png
140 update-stats: freeculture.nb.po lint.nb
142 printf "%s " $$(date +"%Y-%m-%dT%H%M") ; \
143 msgfmt -o /dev/null --statistics freeculture.nb.po 2>&1 \
145 | sed -e 's/translated messages/oversatte meldinger/' -e 's/fuzzy translations/antatte oversettelser/' -e 's/untranslated messages/oversatte meldinger/' \
147 progress.png: stats.txt progress.gnuplot
148 awk '{print $$1, $$2, $$5, $$8}' < stats.txt > stats.csv
149 gnuplot progress.gnuplot
152 # Have to disable --postvalid, when using xref with xrefstyle.
153 # See <URL: http://bugs.debian.org/682944 > for the bug report.
154 XMLLINTOPTS = --nonet --noout --xinclude --postvalid
155 lint: freeculture.xml
156 xmllint $(XMLLINTOPTS) freeculture.xml
158 lint.nb: freeculture.nb.xml
159 xmllint $(XMLLINTOPTS) freeculture.nb.xml
162 wget -O $@ http://upload.wikimedia.org/wikipedia/commons/9/97/CC_some_rights_reserved_new_2.svg
164 images/cc.png: images/cc.svg
165 inkscape -z -D --export-height=200 -D --export-png=$(shell pwd)/$@ $^
174 $(RM) freeculture-docbook-xsl.pdf \
175 freeculture-docbook-xsl.fo \
176 freeculture-dblatex-db2latex.pdf \
177 freeculture-dblatex.pdf \
178 freeculture-xmlto-fop.pdf
180 .SUFFIXES: .png .xcf .svg .xml