Subversion Repositories HelenOS-doc

Rev

Rev 80 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 bondari 1
#!/bin/bash
2
 
3
#  DocBook Toolchain for ${PLATFORM}
4
#  by Sergey Bondari <bondari@itbs.cz>
5
 
6
 
7
check_error() {
8
    if [ "$1" -ne "0" ]; then
9
	echo
10
	echo "Script failed: $2"
11
	exit
12
    fi
13
}
14
 
15
DOCBOOKXSL_VERSION="1.69.1"
16
FOP_VERSION="0.20.5"
80 bondari 17
DBLATEX_VERSION="0.1.9"
3 bondari 18
 
19
DOCBOOKXSL="docbook-xsl-${DOCBOOKXSL_VERSION}.tar.bz2"
10 bondari 20
DOCBOOKXSL_PATCH="docbook-xsl-${DOCBOOKXSL_VERSION}-patch.tar.bz2"
21
 
3 bondari 22
FOP="fop-${FOP_VERSION}-src.tar.gz"
23
JIMI="jimi-1.0.jar"
80 bondari 24
DBLATEX="dblatex-${DBLATEX_VERSION}.tar.bz2"
3 bondari 25
 
4 bondari 26
DOCBOOKXSL_SOURCE="http://www.helenos.eu/tools/"
27
JIMI_SOURCE="http://www.helenos.eu/tools/"
3 bondari 28
FOP_SOURCE="http://ftp.sh.cvut.cz/MIRRORS/apache/xmlgraphics/fop/"
80 bondari 29
DBLATEX_SOURCE="http://mesh.dl.sourceforge.net/sourceforge/dblatex/"
3 bondari 30
 
31
WORKDIR=`pwd`
32
 
33
DOCBOOKXSLDIR="${WORKDIR}/docbook-xsl-${DOCBOOKXSL_VERSION}"
34
FOPDIR="${WORKDIR}/fop-${FOP_VERSION}"
35
 
36
echo ">>> Downloading tarballs"
37
 
38
if [ ! -f "${DOCBOOKXSL}" ]; then
39
    wget -c "${DOCBOOKXSL_SOURCE}${DOCBOOKXSL}"
40
    check_error $? "Error downloading DOCBOOK XSL."
41
fi
42
 
10 bondari 43
if [ ! -f "${DOCBOOKXSL_PATCH}" ]; then
44
    wget -c "${DOCBOOKXSL_SOURCE}${DOCBOOKXSL_PATCH}"
45
    check_error $? "Error downloading DOCBOOK XSL Patch."
46
fi
47
 
3 bondari 48
if [ ! -f "${FOP}" ]; then
49
    wget -c "${FOP_SOURCE}${FOP}"
50
    check_error $? "Error downloading FOP."
51
fi
52
 
53
if [ ! -f "${JIMI}" ]; then
54
    wget -c "${JIMI_SOURCE}${JIMI}"
55
    check_error $? "Error downloading JIMI."
56
fi
57
 
80 bondari 58
if [ ! -f "${DBLATEX}" ]; then
59
    wget -c "${DBLATEX_SOURCE}${DBLATEX}"
60
    check_error $? "Error downloading DBLaTex Patch."
61
fi
10 bondari 62
 
63
 
3 bondari 64
echo ">>> Unpacking tarballs"
65
tar -jxvf "${DOCBOOKXSL}"
66
check_error $? "Error unpacking DOCBOOK XSL."
67
 
68
tar -zxvf "${FOP}"
69
check_error $? "Error unpacking FOP."
70
 
71
rm -rf "docbook-xsl"
72
mv ${DOCBOOKXSLDIR} "docbook-xsl"
73
check_error $? "Rename failed."
74
 
10 bondari 75
tar -jxvf "${DOCBOOKXSL_PATCH}"
76
check_error $? "Docbook XSL patch injection failed"
77
 
80 bondari 78
tar -jxvf "${DBLATEX}"
79
 
3 bondari 80
rm -rf "fop"
81
mv ${FOPDIR} "fop"
82
check_error $? "Rename failed."
83
 
84
cp ${JIMI} fop/lib
85
check_error $? "Cannot inject JIMI to FOP."
86
 
82 jermar 87
mkdir -p ${WORKDIR}/dblatex
80 bondari 88
cd dblatex-${DBLATEX_VERSION}
82 jermar 89
./configure --prefix=${WORKDIR}/dblatex
90
make
80 bondari 91
make install
92
cd ..
93
 
3 bondari 94
echo
95
echo ">>> Done."