]> pere.pagekite.me Git - text-free-culture-lessig.git/blob - Makefile
Remove dblatex param=nb, which do not seem to have any effect.
[text-free-culture-lessig.git] / Makefile
1 #
2 # configuration here:
3 #
4
5 url = http://www.sslug.dk/~chlor/lessig/freeculture.sgml.2004-04-01.gz
6
7 # PDF rule
8 # Valid book options are a4paper, a5paper, b5paper, letterpaper,
9 # legalpaper, landscape, 11pt, 12pt, oneside, twocolumn, notitlepage,
10 # titlepage, openany, draft, fleqn, leqno
11 DBLATEX = dblatex \
12 -P latex.class.options=a5paper \
13 -T db2latex \
14 --backend=xetex \
15 --xsl-user=data/user_param.xsl \
16 --xsl-user=data/xetex_param.xsl \
17 -p data/pdf.xsl
18
19 DBTOEPUB = dbtoepub
20
21 IMAGES = images/cc.png
22
23 all: lint lint.nb html epub pdf
24
25 freeculture.nb.po: freeculture.pot
26 po4a --no-translations --msgmerge-opt --no-location po4a.cfg
27
28 freeculture.nb.xml: freeculture.nb.po freeculture.xml
29 po4a --translate-only freeculture.nb.xml po4a.cfg
30
31 pdf: freeculture.nb.pdf freeculture.pdf
32 epub: freeculture.nb.epub
33 html: freeculture.html freeculture.nb.html
34
35 %.pdf: %.xml $(IMAGES)
36 $(DBLATEX) $< --param=lingua=nb
37
38 # Alternative processing path to dblatex is to use xmlto using fop to
39 # create PDF like this. The PDF output (visual design) is better, but
40 # the PDF index and footnote handling is worse and images are missing.
41 # xmlto --noautosize -m xmlto-pdf.xsl --with-fop pdf $^
42
43 %.html: %.xml $(IMAGES)
44 xmlto html-nochunks $<
45
46 %.txt: %.xml $(IMAGES)
47 xmlto txt $<
48
49 %.epub: %.xml, $(IMAGES)
50 $(DBTOEPUB) $^ $<
51
52 freeculture.xml:
53 GET $(url) | gunzip > freeculture.xml
54
55 freeculture.pot: freeculture.xml
56 po4a-gettextize -f docbook -m $^ > $@.new && mv $@.new $@
57
58 stats: update-stats progress.png
59 update-stats:
60 ( \
61 printf "%s " $$(date +"%Y-%m-%dT%H%M") ; \
62 msgfmt -o /dev/null --statistics freeculture.nb.po 2>&1 \
63 ) | tee -a stats.txt
64 progress.png: stats.txt progress.gnuplot
65 awk '{print $$1, $$2, $$5, $$8}' < stats.txt > stats.csv
66 gnuplot progress.gnuplot
67 rm stats.csv
68
69 # Have to disable --postvalid, when using xref with xrefstyle.
70 # See <URL: http://bugs.debian.org/682944 > for the bug report.
71 XMLLINTOPTS = --nonet --noout --xinclude --postvalid
72 lint: freeculture.xml
73 xmllint $(XMLLINTOPTS) freeculture.xml
74
75 lint.nb: freeculture.nb.xml
76 xmllint $(XMLLINTOPTS) freeculture.nb.xml
77
78 images/cc.svg:
79 wget -O $@ http://upload.wikimedia.org/wikipedia/commons/9/97/CC_some_rights_reserved_new_2.svg
80
81 images/cc.png: images/cc.svg
82 inkscape -z -D --export-height=200 -D --export-png=$(shell pwd)/$@ $^