| 1 |
#!/bin/make |
| 2 |
# Copyright 2005 Paul Martin <[email protected]> |
| 3 |
# |
| 4 |
# This program is free software; you can redistribute it and/or modify |
| 5 |
# it under the terms of the GNU General Public License as published by |
| 6 |
# the Free Software Foundation; either version 2 of the License, or |
| 7 |
# (at your option) any later version. |
| 8 |
# |
| 9 |
# This program is distributed in the hope that it will be useful, |
| 10 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
# GNU General Public License for more details. |
| 13 |
# |
| 14 |
# You should have received a copy of the GNU General Public License |
| 15 |
# along with this program; if not, write to the Free Software |
| 16 |
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 |
|
| 18 |
|
| 19 |
# Find out which version of ELinks we've got |
| 20 |
# This allows us to build correctly on both sarge and etch |
| 21 |
elinks_version = $(shell elinks --version|perl -ne 'if (/^ELinks\s+(\d+\.\d+)/i) {print "$$1\n";}') |
| 22 |
|
| 23 |
ifeq ($(elinks_version),0.9) |
| 24 |
elinks_opts = -dump -dump-width 79 -no-numbering 1 |
| 25 |
else |
| 26 |
elinks_opts = -dump -dump-width 79 -no-numbering 1 -no-references 1 |
| 27 |
endif |
| 28 |
|
| 29 |
all: jargon.txt |
| 30 |
.PHONY: all |
| 31 |
|
| 32 |
jargsrc.tar.gz: |
| 33 |
wget http://www.catb.org/~esr/jargon/jargsrc.tar.gz |
| 34 |
|
| 35 |
jargon.xml: jargsrc.tar.gz |
| 36 |
tar xvfz jargsrc.tar.gz jargon.xml |
| 37 |
|
| 38 |
jargon-text.xsl: jargsrc.tar.gz |
| 39 |
tar xvfz jargsrc.tar.gz jargon-text.xsl |
| 40 |
patch -p0 <jargon-text.xsl.patch |
| 41 |
|
| 42 |
jargon.xsl: jargsrc.tar.gz |
| 43 |
tar xvfz jargsrc.tar.gz jargon.xsl |
| 44 |
patch -p0 <jargon.xsl.patch |
| 45 |
|
| 46 |
jargon-web.xml: |
| 47 |
# esr wrote xmlif, but jargon.xml uses the old syntax |
| 48 |
perl -pe 's/<\?(if|else|fi)\b/<?xmlif \1/' <jargon.xml | \ |
| 49 |
xmlif condition='web' >jargon-web.xml |
| 50 |
|
| 51 |
jargon-web.html: jargon-web.xml |
| 52 |
# Convert XML to HTML |
| 53 |
xmlto -m jargon-text.xsl html-nochunks jargon-web.xml |
| 54 |
# Change acute accents to apostrophes. iso_8859-15 shows them badly |
| 55 |
sed -i "s/\o264/'/" jargon-web.html |
| 56 |
|
| 57 |
jargon.txt: jargon-web.html |
| 58 |
# Turn into plain text |
| 59 |
elinks $(elinks_opts) jargon-web.html >jargon.txt |
| 60 |
|
| 61 |
clean: |
| 62 |
rm -f jargon-web.xml |
| 63 |
rm -f jargon-web.html |
| 64 |
rm -f jargon.txt |
| 65 |
rm -f jargsrc.tar.gz |
| 66 |
rm -f *~ |
| 67 |
|
| 68 |
force-update: superclean jargon.xsl jargon-text.xsl jargon.xml jargsrc.tar.gz |
| 69 |
.PHONY: force-update |
| 70 |
|
| 71 |
superclean: |
| 72 |
rm -f jargon.xml |
| 73 |
rm -f jargon-text.xsl |
| 74 |
rm -f jargon.xsl |