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 -r data/dblatex-postprocess \
17 --indexstyle=myindexstyle.ist \
18 --xsl-user=data/user_param.xsl \
19 --xsl-user=data/xetex_param.xsl \
21 -P latex.index.tool=xindy \
29 images/pattern-modern-media-ownership.png \
30 images/tom-the-dancing-bug.png \
31 images/cover-front-10dpi.png \
32 images/cover-front-72dpi.png \
33 images/nb/cover-front-10dpi.png \
34 images/nb/cover-front-72dpi.png
45 data/stylesheet-html.xsl
50 data/stylesheet-epub.xsl
58 data/stylesheet-fo.xsl
61 all: lint lint.nb lint.fr html epub pdf mobi
63 freeculture.nb.po freeculture.fr.po: freeculture.pot
64 po4a --no-translations --msgmerge-opt --no-location po4a.cfg
66 freeculture.nb.xml: freeculture.nb.po freeculture.xml
67 po4a --translate-only freeculture.nb.xml po4a.cfg
69 freeculture.fr.xml: freeculture.fr.po freeculture.xml
70 po4a --translate-only freeculture.fr.xml po4a.cfg
72 pdf: freeculture.nb.pdf freeculture.fr.pdf freeculture.pdf
73 epub: freeculture.nb.epub freeculture.fr.epub freeculture.epub
74 mobi: freeculture.nb.mobi freeculture.fr.mobi freeculture.mobi
75 html: freeculture.nb.html freeculture.fr.html freeculture.html
77 %.pdf: %.xml $(IMAGES) $(PDF_XSLT) Makefile myclass.cls data/dblatex-postprocess
81 # This converts the docbook content to latex and leave it to latex
82 # to format it. Index ranges are broken in oldstable, fixed in jessie.
85 # Alternative processing path to dblatex is to use xmlto using fop
86 # to create PDF like this. The PDF output (visual design) is
87 # better, but the footnote handling is worse and images are missing.
90 # Third alternative is to use xsltproc and fop directly, as
91 # recommended by <URL: http://www.sagehill.net/docbookxsl/index.html >.
92 # This include images, but the index refs and footnote/endnote handling
96 echo "Using $$pipeline pipeline" ; \
97 case "$$pipeline" in \
99 PATH=$(PWD)/bin:$$PATH $(DBLATEX) $(DBLATEX_OPTS) $< ; \
103 -x data/stylesheet-fo.xsl \
104 --with-fop pdf $< ; \
108 --output $(subst .pdf,.fo,$@) \
109 data/stylesheet-fo.xsl \
111 fop -c data/fop-params.xconf -fo $(subst .pdf,.fo,$@) -pdf $@ ; \
115 pdf-compare: freeculture.xml $(IMAGES)
116 $(DBLATEX) -o freeculture-dblatex.pdf freeculture.xml
117 $(DBLATEX) -T db2latex \-o freeculture-dblatex-db2latex.pdf freeculture.xml
120 #xmlto pdf freeculture.xml && mv freeculture.pdf freeculture-xmlto.pdf
121 xmlto --with-fop pdf freeculture.xml && mv freeculture.pdf freeculture-xmlto-fop.pdf
123 xsltproc --output freeculture-docbook-xsl.fo \
124 /usr/share/xml/docbook/stylesheet/docbook-xsl/fo/docbook.xsl \
126 fop -fo freeculture-docbook-xsl.fo -pdf freeculture-docbook-xsl.pdf
128 %.html: %.xml $(IMAGES) $(HTML_XSLT)
130 -x data/stylesheet-html.xsl \
134 %.txt: %.xml $(IMAGES)
137 %.epub: %.xml $(IMAGES) $(EPUB_XSLT)
139 -s data/stylesheet-epub.xsl \
146 GET $(url) | gunzip > freeculture.xml
148 # <beginpage> workaround can be removed when BTS #684137 is fixed in
150 freeculture.pot: freeculture.xml cover-text.xml
151 po4a-gettextize -o nodefault='<beginpage>' -o inline='<beginpage>' \
152 -o attributes='href' \
153 -f docbook -m freeculture.xml -m cover-text.xml > $@.new && mv $@.new $@
155 stats: update-stats progress.png
156 update-stats: freeculture.nb.po lint.nb
158 printf "%s " $$(date +"%Y-%m-%dT%H%M") ; \
159 msgfmt -o /dev/null --statistics freeculture.nb.po 2>&1 \
161 | sed -e 's/translated messages/oversatte meldinger/' -e 's/fuzzy translations/antatte oversettelser/' -e 's/untranslated messages/oversatte meldinger/' \
163 progress.png: stats.txt progress.gnuplot
164 awk '{print $$1, $$2, $$5, $$8}' < stats.txt > stats.csv
165 gnuplot progress.gnuplot
168 # Have to disable --postvalid, when using xref with xrefstyle.
169 # See <URL: http://bugs.debian.org/682944 > for the bug report.
170 XMLLINTOPTS = --nonet --noout --xinclude --postvalid
171 lint: freeculture.xml
172 xmllint $(XMLLINTOPTS) freeculture.xml
174 lint.nb: freeculture.nb.xml
175 xmllint $(XMLLINTOPTS) freeculture.nb.xml
177 lint.fr: freeculture.fr.xml
178 xmllint $(XMLLINTOPTS) freeculture.fr.xml
181 wget -O $@ http://upload.wikimedia.org/wikipedia/commons/9/97/CC_some_rights_reserved_new_2.svg
183 images/cc.png: images/cc.svg
184 inkscape -z -D --export-height=200 -D --export-png=$(shell pwd)/$@ $^
186 images/cover-art.pdf: images/cover-art.svg
187 inkscape --export-dpi=600 --export-pdf=$@ $^
189 images/nb/cover-art.pdf: images/nb/cover-art.svg
190 inkscape --export-dpi=600 --export-pdf=$@ $^
192 images/fr/cover-art.pdf: images/fr/cover-art.svg
193 inkscape --export-dpi=600 --export-pdf=$@ $^
195 INKSCAPE_FRONTCOORDINATES = 603.54:0:1154.70:832.500
196 images/cover-front-72dpi.png: images/cover-art.svg Makefile
197 inkscape --export-dpi=72 --export-png=$@ -a $(INKSCAPE_FRONTCOORDINATES) images/cover-art.svg
199 images/nb/cover-front-72dpi.png: images/nb/cover-art.svg Makefile
200 inkscape --export-dpi=72 --export-png=$@ -a $(INKSCAPE_FRONTCOORDINATES) images/nb/cover-art.svg
202 images/cover-front-10dpi.png: images/cover-art.svg Makefile
203 inkscape --export-dpi=10 --export-png=$@ -a $(INKSCAPE_FRONTCOORDINATES) images/cover-art.svg
205 images/nb/cover-front-10dpi.png: images/nb/cover-art.svg Makefile
206 inkscape --export-dpi=10 --export-png=$@ -a $(INKSCAPE_FRONTCOORDINATES) images/nb/cover-art.svg
222 freeculture.nb.epub \
223 freeculture.nb.html \
225 freeculture.nb.mobi \
228 freeculture.fr.epub \
229 freeculture.fr.html \
231 freeculture.fr.mobi \
233 freeculture-docbook-xsl.pdf \
234 freeculture-docbook-xsl.fo \
235 freeculture-dblatex-db2latex.pdf \
236 freeculture-dblatex.pdf \
237 freeculture-xmlto-fop.pdf
239 .SUFFIXES: .png .xcf .svg .xml .pdf