Subversion Repositories HelenOS-doc

Rev

Rev 3 | Rev 80 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

#!/bin/bash

#  DocBook Toolchain for ${PLATFORM}
#  by Sergey Bondari <bondari@itbs.cz>


check_error() {
    if [ "$1" -ne "0" ]; then
    echo
    echo "Script failed: $2"
    exit
    fi
}

DOCBOOKXSL_VERSION="1.69.1"
FOP_VERSION="0.20.5"

DOCBOOKXSL="docbook-xsl-${DOCBOOKXSL_VERSION}.tar.bz2"
FOP="fop-${FOP_VERSION}-src.tar.gz"
JIMI="jimi-1.0.jar"

DOCBOOKXSL_SOURCE="http://www.helenos.eu/tools/"
JIMI_SOURCE="http://www.helenos.eu/tools/"
FOP_SOURCE="http://ftp.sh.cvut.cz/MIRRORS/apache/xmlgraphics/fop/"


WORKDIR=`pwd`

DOCBOOKXSLDIR="${WORKDIR}/docbook-xsl-${DOCBOOKXSL_VERSION}"
FOPDIR="${WORKDIR}/fop-${FOP_VERSION}"

echo ">>> Downloading tarballs"

if [ ! -f "${DOCBOOKXSL}" ]; then
    wget -c "${DOCBOOKXSL_SOURCE}${DOCBOOKXSL}"
    check_error $? "Error downloading DOCBOOK XSL."
fi

if [ ! -f "${FOP}" ]; then
    wget -c "${FOP_SOURCE}${FOP}"
    check_error $? "Error downloading FOP."
fi

if [ ! -f "${JIMI}" ]; then
    wget -c "${JIMI_SOURCE}${JIMI}"
    check_error $? "Error downloading JIMI."
fi

echo ">>> Unpacking tarballs"
tar -jxvf "${DOCBOOKXSL}"
check_error $? "Error unpacking DOCBOOK XSL."

tar -zxvf "${FOP}"
check_error $? "Error unpacking FOP."

rm -rf "docbook-xsl"
mv ${DOCBOOKXSLDIR} "docbook-xsl"
check_error $? "Rename failed."

rm -rf "fop"
mv ${FOPDIR} "fop"
check_error $? "Rename failed."

cp ${JIMI} fop/lib
check_error $? "Cannot inject JIMI to FOP."

echo
echo ">>> Done."