#!/bin/sh

# comment out if compiling with java support
# due to an error during installation java support is disabled
# "java_loader error ... no mapping from JAVA to C++"
#export JAVA_HOME=/usr/local/openjdk-6
#export PATH=${JAVA_HOME}/bin:$PATH
#export ANT_HOME=/opt/ant
#export PATH=${ANT_HOME}/bin:$PATH

# work around for some errors
sudo ln -s /usr/local/lib/pkgconfig/mozilla-plugin.pc /usr/local/lib/pkgconfig/xulrunner-plugin.pc

# after applying the patch ooo-build-3.2.0.7_tinycore.diff

./configure --prefix=/usr/local --with-distro=TinyCore \
--disable-odk --enable-extensions --disable-mono --enable-graphite \
--enable-cairo --disable-kde --disable-kde4 --disable-pam \
--with-gcc-speedup=ccache --without-java --with-lang="" \
--with-google-docs --with-oooblogger --with-num-cpus=2 \
--with-openclipart=/usr/local/share/openclipart

# download openoffice.org sources, about 900MB 
./download

# build process takes about 3 hours in a core2 3GHz cpu
# and 10GB hard disk space should be enough
make

# install
bin/ooinstall /tmp/openoffice3/usr/local/openoffice3
