Subversion Repositories HelenOS-doc

Rev

Rev 4 | 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"
DOCBOOKXSL_PATCH="docbook-xsl-${DOCBOOKXSL_VERSION}-patch.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 "${DOCBOOKXSL_PATCH}" ]; then
    wget -c "${DOCBOOKXSL_SOURCE}${DOCBOOKXSL_PATCH}"
    check_error $? "Error downloading DOCBOOK XSL Patch."
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."

tar -jxvf "${DOCBOOKXSL_PATCH}"
check_error $? "Docbook XSL patch injection 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."