Subversion Repositories HelenOS-doc

Rev

Rev 80 | 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"
DBLATEX_VERSION="0.1.9"

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"
DBLATEX="dblatex-${DBLATEX_VERSION}.tar.bz2"

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/"
DBLATEX_SOURCE="http://mesh.dl.sourceforge.net/sourceforge/dblatex/"

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

if [ ! -f "${DBLATEX}" ]; then
    wget -c "${DBLATEX_SOURCE}${DBLATEX}"
    check_error $? "Error downloading DBLaTex Patch."
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"

tar -jxvf "${DBLATEX}"

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

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

mkdir -p ${WORKDIR}/dblatex
cd dblatex-${DBLATEX_VERSION}
./configure --prefix=${WORKDIR}/dblatex
make
make install
cd ..

echo
echo ">>> Done."