rendered paste bodypkgname=openoffice
pkgver=2.0.4
OO_milestone=OOD680_m5
pkgrel=1
desc="OpenOffice.org - a free multiplatform and multilingual office suite"
arch=(i686 x86_64)
url="http://www.openoffice.org"
#install=install.openoffice
#depends=('ttf-bitstream-vera' 'cups' 'curl' 'desktop-file-utils' 'expat' 'fontconfig' 'freetype2' 'gtk2' 'hunspell' 'icu' 'imagemagick' 'libxaw' #'libxml2' 'libart-lgpl' 'libsndfile' 'libstdc++5' 'libpng' 'neon' 'nss' 'perl' 'perl-archive-zip' 'python' 'sane' 'unzip' 'libwpd' 'xmlsec' 'xorg-#server' 'xulrunner' 'zip')
#makedepends=('apache-ant' 'bison' 'ccache' 'cairo' 'curl' 'findutils' 'flex' 'gawk' 'gcc' 'jdk' 'jre' 'pam' 'perl-archive-zip' 'pkgconfig' 'tcsh' #'libidl2')
conflicts=('openoffice-base' 'openoffice-cvs')
provides=('openoffice-base' 'openoffice-cvs')
source=("http://ftp.ussg.iu.edu/openoffice/stable/$pkgver/OOo_2.0.4_src.tar.gz")
md5sums=('df4bb26645e974a2358bc17f8381a197')
build() {
# parallel build is broken in most cases
export MAKEFLAGS="-j1"
# # Apply patches
# for OOPATCHES in ../*.diff
# do patch -p0 < ../${OOPATCHES} || return 1
# done
cd $startdir/src/${OO_milestone}/config_office
# Need to recreate the configure script because of patches
# autoconf
./configure --with-vendor="Archlinux Community"\
--with-build-version="2.0.4 Archlinux build-1"\
--with-arch="x86_64"\
--disable-ldap\
--with-openldap\
--disable-directx\
--disable-gnome-vfs\
--disable-mono\
--disable-mozilla\
--disable-odk\
--disable-qadevoo\
--enable-cups\
--enable-cairo\
--enable-evolution2\
--with-package-format=native\
--with-system-boost\
--with-system-curl\
--with-system-expat\
--with-system-freetype\
--with-system-jpeg\
--with-system-libwpd\
--with-system-libxml\
--with-system-neon\
--with-system-python\
--with-system-sane-header\
--with-system-sndfile\
--with-system-stdlibs\
--with-system-xmlsec\
--with-system-xrender-headers\
--with-system-zlib\
--without-docdir\
--without-fonts\
--without-java\
--without-myspell-dicts\
--without-nas\
--with-gcc-speedup=ccache\
--with-xulrunner
#--with-lang=ALL\
cd ..
# Setup environment for build
source LinuxX86-64Env.Set.sh
# Build dmake utility
./bootstrap || return 1
# to compile with SMP add -P2 or above, remove -P2 if you've only got on CPU core
# smp is know to be broken most times
dmake -P2 || return 1
# install binaries
cp -R instsetoo_native/unxlngx6.pro/OpenOffice/native/install/en-US/linux-2.6-x86_64/buildroot/* $startdir/pkg/
# multilang
# for lang in `ls -1 instsetoo_native/unxlngx6.pro/OpenOffice/native/install/`; do
# cp -R instsetoo_native/unxlngx6.pro/OpenOffice/native/install/${lang}/linux-2.6-x86_64/buildroot/ $startdir/pkg/
# done
cd $startdir/pkg/opt
mv openoffice.org2.0 openoffice
# replace original splash intro screen with one provided by shastry
# rm -rf $startdir/pkg/opt/openoffice/program/intro.bmp
# install -D -m644 cp $startdir/src/intro.bmp $startdir/pkg/opt/openoffice/program/
# prepare filesystem entries
mkdir -p $startdir/pkg/usr/{bin,share/applications}
mkdir -p $startdir/pkg/usr/share/icons/{HighContrast,hicolor,locolor}
# make symlinks
cd $startdir/pkg/usr/bin
ln -s ../../opt/openoffice/program/soffice soffice
ln -s ../../opt/openoffice/program/spadmin spadmin
# install shortcuts
cp $startdir/pkg/opt/openoffice/share/xdg/*.desktop $startdir/pkg/usr/share/applications
cd $startdir/pkg/usr/share/applications
sed -i -e 's|Exec=openoffice.org-2.0|Exec=/opt/openoffice/program/soffice|g' *.desktop
sed -i -e 's|Exec=/opt/openoffice/program/soffice-printeradmin|Exec=/opt/openoffice/program/spadmin|g' printeradmin.desktop
# fix icons in shortcuts
sed -i -e 's|Icon=openofficeorg-20-base|Icon=base|g' *.desktop
sed -i -e 's|Icon=openofficeorg-20-calc|Icon=ooocalc|g' *.desktop
sed -i -e 's|Icon=openofficeorg-20-draw|Icon=draw|g' *.desktop
sed -i -e 's|Icon=openofficeorg-20-impress|Icon=impress|g' *.desktop
sed -i -e 's|Icon=openofficeorg-20-math|Icon=math|g' *.desktop
sed -i -e 's|Icon=openofficeorg-20-writer|Icon=writer|g' *.desktop
sed -i -e 's|Icon=openofficeorg-20-printeradmin.png|Icon=printeradmin|g' *.desktop
# install icons
cd $startdir/src/${OO_milestone}/sysui/desktop/icons
cp -a -v HighContrast/*x* $startdir/pkg/usr/share/icons/HighContrast
cp -a -v hicolor/*x* $startdir/pkg/usr/share/icons/hicolor
cp -a -v locolor/*x* $startdir/pkg/usr/share/icons/locolor
rm -rf $startdir/pkg/usr/share/icons/*/*/CVS
rm -rf $startdir/pkg/usr/share/icons/*/*/*/CVS
## just in case icon calc is used by calculator :)
find $startdir/pkg/usr/share/icons -type d -name apps -exec mv \{}/calc.png \{}/ooocalc.png \;
# fix ownership and permissions
chown root.root -R $startdir/pkg/
chmod +rX -R $startdir/pkg/usr
#rm -f $startdir/pkg/opt/openoffice/program/oo_product.bmp
}