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
31 data/dblatex-endnotes.xsl \
37 data/stylesheet-html.xsl
45 data/stylesheet-fo.xsl
48 all: lint lint.nb html epub pdf mobi
50 freeculture.nb.po: freeculture.pot
51 po4a --no-translations --msgmerge-opt --no-location po4a.cfg
53 freeculture.nb.xml: freeculture.nb.po freeculture.xml
54 po4a --translate-only freeculture.nb.xml po4a.cfg
56 freeculture.es_419.po: freeculture.pot
57 po4a --no-translations --msgmerge-opt --no-location po4a.cfg
58 freeculture.es_419.xml: freeculture.es_419.po freeculture.xml
59 po4a --translate-only freeculture.es_419.xml po4a.cfg
61 pdf: freeculture.nb.pdf freeculture.pdf
62 epub: freeculture.nb.epub freeculture.epub
63 mobi: freeculture.nb.mobi freeculture.mobi
64 html: freeculture.nb.html freeculture.html
66 %.pdf: %.xml $(IMAGES) $(PDF_XSLT) Makefile
70 # This converts the docbook content to latex and leave it to latex
71 # to format it. Index ranges are broken in oldstable, fixed in jessie.
74 # Alternative processing path to dblatex is to use xmlto using fop
75 # to create PDF like this. The PDF output (visual design) is
76 # better, but the footnote handling is worse and images are missing.
79 # Third alternative is to use xsltproc and fop directly, as
80 # recommended by <URL: http://www.sagehill.net/docbookxsl/index.html >.
81 # This include images, but the index refs and footnote/endnote handling
85 echo "Using $$pipeline pipeline" ; \
86 case "$$pipeline" in \
88 PATH=$(PWD)/bin:$$PATH $(DBLATEX) $< ; \
92 -x data/stylesheet-fo.xsl \
97 --output $(subst .pdf,.fo,$@) \
98 data/stylesheet-fo.xsl \
100 fop -c data/fop-params.xconf -fo $(subst .pdf,.fo,$@) -pdf $@ ; \
104 pdf-compare: freeculture.xml $(IMAGES)
105 $(DBLATEX) -o freeculture-dblatex.pdf freeculture.xml
106 $(DBLATEX) -T db2latex \-o freeculture-dblatex-db2latex.pdf freeculture.xml
109 #xmlto pdf freeculture.xml && mv freeculture.pdf freeculture-xmlto.pdf
110 xmlto --with-fop pdf freeculture.xml && mv freeculture.pdf freeculture-xmlto-fop.pdf
112 xsltproc --output freeculture-docbook-xsl.fo \
113 /usr/share/xml/docbook/stylesheet/docbook-xsl/fo/docbook.xsl \
115 fop -fo freeculture-docbook-xsl.fo -pdf freeculture-docbook-xsl.pdf
117 %.html: %.xml $(IMAGES) $(HTML_XSLT)
119 -x data/stylesheet-html.xsl \
123 %.txt: %.xml $(IMAGES)
126 %.epub: %.xml $(IMAGES)
133 GET $(url) | gunzip > freeculture.xml
135 # <beginpage> workaround can be removed when BTS #684137 is fixed in
137 freeculture.pot: freeculture.xml
138 po4a-gettextize -o nodefault='<beginpage>' -o inline='<beginpage>' \
139 -f docbook -m $^ > $@.new && mv $@.new $@
141 stats: update-stats progress.png
142 update-stats: freeculture.nb.po lint.nb
144 printf "%s " $$(date +"%Y-%m-%dT%H%M") ; \
145 msgfmt -o /dev/null --statistics freeculture.nb.po 2>&1 \
147 | sed -e 's/translated messages/oversatte meldinger/' -e 's/fuzzy translations/antatte oversettelser/' -e 's/untranslated messages/oversatte meldinger/' \
149 progress.png: stats.txt progress.gnuplot
150 awk '{print $$1, $$2, $$5, $$8}' < stats.txt > stats.csv
151 gnuplot progress.gnuplot
154 # Have to disable --postvalid, when using xref with xrefstyle.
155 # See <URL: http://bugs.debian.org/682944 > for the bug report.
156 XMLLINTOPTS = --nonet --noout --xinclude --postvalid
157 lint: freeculture.xml
158 xmllint $(XMLLINTOPTS) freeculture.xml
160 lint.nb: freeculture.nb.xml
161 xmllint $(XMLLINTOPTS) freeculture.nb.xml
164 wget -O $@ http://upload.wikimedia.org/wikipedia/commons/9/97/CC_some_rights_reserved_new_2.svg
166 images/cc.png: images/cc.svg
167 inkscape -z -D --export-height=200 -D --export-png=$(shell pwd)/$@ $^
176 $(RM) freeculture-docbook-xsl.pdf \
177 freeculture-docbook-xsl.fo \
178 freeculture-dblatex-db2latex.pdf \
179 freeculture-dblatex.pdf \
180 freeculture-xmlto-fop.pdf
182 .SUFFIXES: .png .xcf .svg .xml