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/fr/cover-front-10dpi.png \
34 images/fr/cover-front-72dpi.png \
35 images/nb/cover-front-10dpi.png \
36 images/nb/cover-front-72dpi.png
47 data/stylesheet-html.xsl
52 data/stylesheet-epub.xsl
60 data/stylesheet-fo.xsl
63 all: lint lint.nb lint.fr html epub pdf mobi
65 freeculture.nb.po freeculture.fr.po: freeculture.pot
66 po4a --no-translations --msgmerge-opt --no-location po4a.cfg
68 freeculture.nb.xml: freeculture.nb.po freeculture.xml
69 po4a --translate-only freeculture.nb.xml po4a.cfg
71 freeculture.fr.xml: freeculture.fr.po freeculture.xml
72 po4a --translate-only freeculture.fr.xml po4a.cfg
74 pdf: freeculture.nb.pdf freeculture.fr.pdf freeculture.pdf
75 epub: freeculture.nb.epub freeculture.fr.epub freeculture.epub
76 mobi: freeculture.nb.mobi freeculture.fr.mobi freeculture.mobi
77 html: freeculture.nb.html freeculture.fr.html freeculture.html
79 %.pdf: %.xml $(IMAGES) $(PDF_XSLT) Makefile myclass.cls data/dblatex-postprocess
83 # This converts the docbook content to latex and leave it to latex
84 # to format it. Index ranges are broken in oldstable, fixed in jessie.
87 # Alternative processing path to dblatex is to use xmlto using fop
88 # to create PDF like this. The PDF output (visual design) is
89 # better, but the footnote handling is worse and images are missing.
92 # Third alternative is to use xsltproc and fop directly, as
93 # recommended by <URL: http://www.sagehill.net/docbookxsl/index.html >.
94 # This include images, but the index refs and footnote/endnote handling
98 echo "Using $$pipeline pipeline" ; \
99 case "$$pipeline" in \
101 PATH=$(PWD)/bin:$$PATH $(DBLATEX) $(DBLATEX_OPTS) $< ; \
105 -x data/stylesheet-fo.xsl \
106 --with-fop pdf $< ; \
110 --output $(subst .pdf,.fo,$@) \
111 data/stylesheet-fo.xsl \
113 fop -c data/fop-params.xconf -fo $(subst .pdf,.fo,$@) -pdf $@ ; \
117 pdf-compare: freeculture.xml $(IMAGES)
118 $(DBLATEX) -o freeculture-dblatex.pdf freeculture.xml
119 $(DBLATEX) -T db2latex \-o freeculture-dblatex-db2latex.pdf freeculture.xml
122 #xmlto pdf freeculture.xml && mv freeculture.pdf freeculture-xmlto.pdf
123 xmlto --with-fop pdf freeculture.xml && mv freeculture.pdf freeculture-xmlto-fop.pdf
125 xsltproc --output freeculture-docbook-xsl.fo \
126 /usr/share/xml/docbook/stylesheet/docbook-xsl/fo/docbook.xsl \
128 fop -fo freeculture-docbook-xsl.fo -pdf freeculture-docbook-xsl.pdf
130 %.html: %.xml $(IMAGES) $(HTML_XSLT)
132 -x data/stylesheet-html.xsl \
136 %.txt: %.xml $(IMAGES)
139 %.epub: %.xml $(IMAGES) $(EPUB_XSLT)
141 -s data/stylesheet-epub.xsl \
148 GET $(url) | gunzip > freeculture.xml
150 # <beginpage> workaround can be removed when BTS #684137 is fixed in
152 freeculture.pot: freeculture.xml cover-text.xml
153 po4a-gettextize -o nodefault='<beginpage>' -o inline='<beginpage>' \
154 -o attributes='href' \
155 -f docbook -m freeculture.xml -m cover-text.xml > $@.new && mv $@.new $@
157 stats: update-stats progress.png
158 update-stats: freeculture.nb.po lint.nb
160 printf "%s " $$(date +"%Y-%m-%dT%H%M") ; \
161 msgfmt -o /dev/null --statistics freeculture.nb.po 2>&1 \
163 | sed -e 's/translated messages/oversatte meldinger/' -e 's/fuzzy translations/antatte oversettelser/' -e 's/untranslated messages/oversatte meldinger/' \
165 progress.png: stats.txt progress.gnuplot
166 awk '{print $$1, $$2, $$5, $$8}' < stats.txt > stats.csv
167 gnuplot progress.gnuplot
170 # Have to disable --postvalid, when using xref with xrefstyle.
171 # See <URL: http://bugs.debian.org/682944 > for the bug report.
172 XMLLINTOPTS = --nonet --noout --xinclude --postvalid
173 lint: freeculture.xml
174 xmllint $(XMLLINTOPTS) freeculture.xml
176 lint.nb: freeculture.nb.xml
177 xmllint $(XMLLINTOPTS) freeculture.nb.xml
179 lint.fr: freeculture.fr.xml
180 xmllint $(XMLLINTOPTS) freeculture.fr.xml
183 wget -O $@ http://upload.wikimedia.org/wikipedia/commons/9/97/CC_some_rights_reserved_new_2.svg
185 images/cc.png: images/cc.svg
186 inkscape -z -D --export-height=200 -D --export-png=$(shell pwd)/$@ $^
188 images/cover-art.pdf: images/cover-art.svg
189 inkscape --export-dpi=600 --export-pdf=$@ $^
191 images/nb/cover-art.pdf: images/nb/cover-art.svg
192 inkscape --export-dpi=600 --export-pdf=$@ $^
194 images/fr/cover-art.pdf: images/fr/cover-art.svg
195 inkscape --export-dpi=600 --export-pdf=$@ $^
197 INKSCAPE_FRONTCOORDINATES = 603.54:0:1154.70:832.500
198 images/cover-front-72dpi.png: images/cover-art.svg Makefile
199 inkscape --export-dpi=72 --export-png=$@ -a $(INKSCAPE_FRONTCOORDINATES) images/cover-art.svg
201 images/nb/cover-front-72dpi.png: images/nb/cover-art.svg Makefile
202 inkscape --export-dpi=72 --export-png=$@ -a $(INKSCAPE_FRONTCOORDINATES) images/nb/cover-art.svg
204 images/fr/cover-front-72dpi.png: images/fr/cover-art.svg Makefile
205 inkscape --export-dpi=72 --export-png=$@ -a $(INKSCAPE_FRONTCOORDINATES) images/fr/cover-art.svg
207 images/cover-front-10dpi.png: images/cover-art.svg Makefile
208 inkscape --export-dpi=10 --export-png=$@ -a $(INKSCAPE_FRONTCOORDINATES) images/cover-art.svg
210 images/nb/cover-front-10dpi.png: images/nb/cover-art.svg Makefile
211 inkscape --export-dpi=10 --export-png=$@ -a $(INKSCAPE_FRONTCOORDINATES) images/nb/cover-art.svg
213 images/fr/cover-front-10dpi.png: images/fr/cover-art.svg Makefile
214 inkscape --export-dpi=10 --export-png=$@ -a $(INKSCAPE_FRONTCOORDINATES) images/fr/cover-art.svg
230 freeculture.nb.epub \
231 freeculture.nb.html \
233 freeculture.nb.mobi \
236 freeculture.fr.epub \
237 freeculture.fr.html \
239 freeculture.fr.mobi \
241 freeculture-docbook-xsl.pdf \
242 freeculture-docbook-xsl.fo \
243 freeculture-dblatex-db2latex.pdf \
244 freeculture-dblatex.pdf \
245 freeculture-xmlto-fop.pdf
247 .SUFFIXES: .png .xcf .svg .xml .pdf