]> pere.pagekite.me Git - text-free-culture-lessig.git/blob - Makefile
New day, new opportunities.
[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 --param=lingua=nb
19
20 DBTOEPUB = dbtoepub
21
22 all: lint lint.nb html epub pdf
23
24 freeculture.nb.po: freeculture.pot
25 po4a --no-translations --msgmerge-opt --no-location po4a.cfg
26
27 freeculture.nb.xml: freeculture.nb.po freeculture.xml
28 po4a --translate-only freeculture.nb.xml po4a.cfg
29
30 pdf: freeculture.nb.pdf freeculture.pdf
31 epub: freeculture.nb.epub
32 html: freeculture.html freeculture.nb.html
33
34 %.pdf: %.xml
35 # $(DBLATEX) $^ --param=lingua=nb
36
37 # Alternative processing path to dblatex is to use xmlto using fop to
38 # create PDF like this. The PDF output (visual design) is better, but
39 # the PDF index and footnote handling is worse.
40 xmlto --noautosize -m xmlto-pdf.xsl --with-fop pdf $^
41
42 %.html: %.xml
43 xmlto html-nochunks $^
44
45 %.epub: %.xml
46 $(DBTOEPUB) $^
47
48 freeculture.xml:
49 GET $(url) | gunzip > freeculture.xml
50
51 freeculture.pot: freeculture.xml
52 po4a-gettextize -f docbook -m $^ > $@.new && mv $@.new $@
53
54 stats: update-stats progress.png
55 update-stats:
56 ( \
57 printf "%s " $$(date +"%Y-%m-%dT%H%M") ; \
58 msgfmt -o /dev/null --statistics freeculture.nb.po 2>&1 \
59 ) | tee -a stats.txt
60 progress.png: stats.txt progress.gnuplot
61 awk '{print $$1, $$2, $$5, $$8}' < stats.txt > stats.csv
62 gnuplot progress.gnuplot
63 rm stats.csv
64
65 # Have to disable --postvalid, when using xref with xrefstyle.
66 # See <URL: http://bugs.debian.org/682944 > for the bug report.
67 XMLLINTOPTS = --nonet --noout --xinclude --postvalid
68 lint: freeculture.xml
69 xmllint $(XMLLINTOPTS) freeculture.xml
70
71 lint.nb: freeculture.nb.xml
72 xmllint $(XMLLINTOPTS) freeculture.nb.xml