PKGBUILDs/extra/openoffice-base-beta/PKGBUILD
2009-10-09 21:23:22 -05:00

288 lines
10 KiB
Bash

# Maintainer: AndyRTR <andyrtr@archlinux.org>
# Contributor: Hussam Al-Tayeb <ht990332@gmail.com>
pkgname=openoffice-base-beta
pkgver=3.1.1_ooo310_m17 # m9=RC1
pkgrel=1
pkgdesc="OpenOffice.org - a free multiplatform and multilingual office suite"
arch=(i686 x86_64)
_OO_milestone=OOO310_m17
license=('LGPL3')
url="http://www.openoffice.org"
install=openoffice.install
depends=('curl>=7.19.2' 'hunspell>=1.2.8' 'python>=2.6.2' 'libwpd' 'redland' 'libxaw' 'neon>=0.28.4'
'dbus-glib' 'icu>=4.2.1' 'hsqldb-java' 'libxslt' 'hicolor-icon-theme' 'desktop-file-utils')
optdepends=('java-runtime: adds java support'
'libcups: adds printing support'
'gconf: adds additional gnome support'
'nss: adds support for signed files/macros'
'pstoedit: translates PostScript and PDF graphics into other vector formats')
makedepends=('bison' 'svn' 'automake' 'findutils' 'flex' 'gawk' 'gcc-libs' 'libart-lgpl' 'libxtst'
'pam' 'sane' 'zip' 'perl-archive-zip' 'pkgconfig' 'unzip' 'xulrunner>=1.9.1-2'
'apache-ant>=1.7.1-3' 'cairo' 'gperf' 'libcups' 'pstoedit' 'gconf' 'openjdk6>=1.5-4') #'boost'
backup=(usr/lib/openoffice-beta/program/sofficerc )
provides=('openoffice-base')
source=(${pkgname}-${_OO_milestone}.tar.gz
startcenter.desktop
default-no-startup-wizard.diff
default-system-fpicker.diff
soffice-detect-mozilla-certificates.diff
buildfix-gcc43.diff
shell.patch
soltools-mkdepend-getline.diff
buildfix-sw-printf.diff
openoffice.org-3.0.1.oooXXXXX.extensions.npapi.patch
openoffice-beta.profile)
options=('!distcc' '!ccache' '!makeflags')
# see ftp://ftp.linux.cz/pub/localization/OpenOffice.org/devel/build/build for upstream build instructions
build() {
cd ${srcdir}
# now svn: http://wiki.services.openoffice.org/wiki/OOo_and_Subversion
# svn checkout svn://svn.services.openoffice.org/ooo/tags/${_OO_milestone}
# find ${srcdir} -type d -depth -name ".svn" -exec rm -rf {} \;
# tar -cvzf ../${pkgname}-${_OO_milestone}.tar.gz ${_OO_milestone}/*
# return 1
cd ${srcdir}/${_OO_milestone}
# just to make sure that it will detect the desired JDK/JVM - we want openjdk6
unset J2REDIR; unset J2SDKDIR; unset JAVA_HOME; unset CLASSPATH
[ -z "${JAVA_HOME}" ] && . /etc/profile.d/openjdk6.sh
JAVAHOME=${JAVA_HOME}
[ -z "${MOZ_PLUGIN_PATH}" ] && . /etc/profile.d/mozilla-common.sh
# some speedups
export SMP="6"
MAXMODULESFLAG="-P${SMP}"
MAXPROCESSESFLAG="-P${SMP}"
export nodep=true
export NO_HIDS=true
# build fixes
patch -Np0 -i ${srcdir}/buildfix-gcc43.diff || return 1
patch -Np0 -i ${srcdir}/buildfix-sw-printf.diff || return 1
patch -Np0 -i ${srcdir}/soltools-mkdepend-getline.diff || return 1
patch -Np1 -i ${srcdir}/openoffice.org-3.0.1.oooXXXXX.extensions.npapi.patch || return 1
# allows soffice to find the user's firefox profile so that it can read
# its digital certificates. Nss stores digital certificates in your mozilla firefox profile.
patch -Np0 -i ${srcdir}/soffice-detect-mozilla-certificates.diff || return 1
# important bugfixes
# try to fix non-gtk integration
patch -Np0 -i ${srcdir}/shell.patch || return 1
# remove the startup wizard
patch -Np0 -i ${srcdir}/default-no-startup-wizard.diff || return 1
# enables the default system-file-picker in case we have that built
patch -Np0 -i ${srcdir}/default-system-fpicker.diff || return 1
if [ "$CARCH" = "x86_64" ]; then
EXTRAOPTS="--without-stlport"
# fix to build with SUN jdk/jre and OpenJDK
# http://qa.openoffice.org/issues/show_bug.cgi?id=74749
sed -i "s:lib64\/libjpeg.so:lib\/libjpeg.so:g" ${srcdir}/${_OO_milestone}/solenv/inc/libs.mk || return 1
else EXTRAOPTS="--with-stlport"
fi
cd ${srcdir}/${_OO_milestone}
# export C(XX)FLAGS
# http://www.openoffice.org/issues/show_bug.cgi?id=103205
unset CFLAGS
unset CXXFLAGS
# export ARCH_FLAGS="$CFLAGS"
# Need to recreate the configure script because of patches
autoreconf -v || return 1
./configure --with-build-version="${pkgver} ArchLinux build-${pkgrel} (${_OO_milestone})" \
--with-vendor="ArchLinux"\
--prefix=/usr --exec-prefix=/usr\
--disable-ldap\
--with-lang="en-US"\
--with-dict=ALL\
--disable-gnome-vfs\
--disable-binfilter\
--disable-evolution2\
--disable-kde\
--disable-lockdown\
--disable-mediawiki\
--disable-minimizer\
--disable-odk\
--disable-pdfimport\
--disable-qadevooo\
--disable-reportdesign\
--disable-systray\
--disable-mathmldtd\
--enable-gio\
--enable-gtk\
--enable-cups\
--enable-dbus\
--enable-cairo\
--enable-crashdump=no\
--enable-vba\
--with-package-format=native\
--with-system-db\
--with-system-cairo\
--with-system-curl\
--with-system-expat\
--with-system-freetype\
--with-system-hunspell\
--with-system-icu\
--with-system-jpeg\
--with-system-libwpd\
--with-system-libxml\
--with-system-libxslt\
--with-system-mozilla=libxul\
--with-system-neon\
--with-system-python\
--with-system-redland\
--with-system-sane-header\
--with-system-sndfile\
--with-system-stdlibs\
--with-system-xrender-headers\
--with-system-zlib\
--with-system-openssl\
--without-fonts\
--without-afms\
--without-gpc\
--without-nas\
--with-jdk-home=${JAVA_HOME}\
--with-system-hsqldb\
--with-hsqldb-jar=/usr/share/java/hsqldb.jar\
--with-system-xerces\
--with-xerces-jar=/usr/share/java/xercesImpl.jar\
--with-system-xalan\
--with-xalan-jar=/usr/share/java/xalan.jar\
--with-system-xml-apis\
--with-xml-apis-jar=/usr/share/java/xml-apis.jar\
--with-serializer-jar=/usr/share/java/serializer.jar\
--with-ant-home="/usr/share/java/apache-ant"\
--with-use-shell=bash\
$EXTRAOPTS || return 1
# --with-system-boost\
# Setup environment for build
if [ "$CARCH" = "x86_64" ]; then
source LinuxX86-64Env.Set.sh
else source LinuxX86Env.Set.sh
fi
# Build dmake utility
./bootstrap || return 1
cd instsetoo_native
build.pl -P${SMP} ${MAXMODULESFLAG} ${MAXPROCESSESFLAG} --dlv_switch -link --all || return 1
cd ..
# install binaries
if [ "$CARCH" = "x86_64" ]; then
cp -R instsetoo_native/unxlngx6.pro/OpenOffice/native/install/en-US/linux-2.6-x86_64/buildroot/* ${pkgdir}/
else cp -R instsetoo_native/unxlngi6.pro/OpenOffice/native/install/en-US/linux-2.6-intel/buildroot/* ${pkgdir}/
fi
# move all to /usr/lib
mkdir -p ${pkgdir}/usr/lib
mv ${pkgdir}/opt/* ${pkgdir}/usr/lib/
rmdir ${pkgdir}/opt
## Step 1
cd ${pkgdir}/usr/lib/openoffice.org || return 1
mv ure/ basis3.1/ || return 1
cd basis3.1 || return 1
rm ure-link && mv ure ure-link || return 1
## Step 2
cd ${pkgdir}/usr/lib/ || return 1
mv openoffice.org/basis3.1/ openoffice.org3/ || return 1
cd openoffice.org3/ || return 1
rm basis-link && mv basis3.1 basis-link || return 1
## Step 3
cd ${pkgdir}/usr/lib/ || return 1
rmdir ${pkgdir}/usr/lib/openoffice.org || return 1
mv openoffice.org3 openoffice || return 1
# install all built dictionaries from source tree
pushd ${srcdir}/${_OO_milestone}/dictionaries/unxlng?6.pro/bin
for i in `ls -1 dict-??.oxt`; do
install -D -m644 $i ${pkgdir}/usr/lib/openoffice/share/extension/install/$i || return 1
done
popd
# prepare filesystem entries
mkdir -p ${pkgdir}/usr/{bin,share/applications}
mkdir -p ${pkgdir}/usr/share/icons/{hicolor,locolor}
# install shortcuts
mv ${pkgdir}/usr/lib/openoffice/share/xdg/*.desktop ${pkgdir}/usr/share/applications
# add startcenter desktop file
install -D -m644 ${srcdir}/startcenter.desktop ${pkgdir}/usr/share/applications/startcenter.desktop || return 1
cd ${pkgdir}/usr/share/applications
sed -i -e 's|Exec=openoffice.org3|Exec=/usr/bin/soffice|g' *.desktop || return 1
sed -i -e 's|Exec=/usr/bin/soffice-printeradmin|Exec=/usr/bin/spadmin|g' printeradmin.desktop || return 1
# fix exec commands in shortcuts for Xfce menu
sed -i -e 's|base %U|base|g' base.desktop || return 1
sed -i -e 's|calc %U|calc|g' calc.desktop || return 1
sed -i -e 's|draw %U|draw|g' draw.desktop || return 1
sed -i -e 's|impress %U|impress|g' impress.desktop || return 1
sed -i -e 's|math %U|math|g' math.desktop || return 1
sed -i -e 's|writer %U|writer|g' writer.desktop || return 1
# remove quickstarter, we disabled it above
rm -rf ${pkgdir}/usr/share/applications/qstart.desktop
# fix icons in desktop files
sed -i -e 's|Icon=openofficeorg3-|Icon=|g' *.desktop
# install icons
cd ${srcdir}/${_OO_milestone}/sysui/desktop/icons
cp -a -v hicolor/*x* ${pkgdir}/usr/share/icons/hicolor
cp -a -v locolor/*x* ${pkgdir}/usr/share/icons/locolor
# just in case icon calc is used by calculator :)
find ${pkgdir}/usr/share/icons -type d -name apps -exec mv {}/calc.png {}/ooocalc.png \;
sed -i -e 's|Icon=calc|Icon=ooocalc|g' ${pkgdir}/usr/share/applications/calc.desktop # already done above
# fix ownership and permissions
chown root.root -R ${pkgdir}/
chmod +rX -R ${pkgdir}/usr
## Develize it for BETA!
cd ${pkgdir}/usr/lib/
mv openoffice openoffice-beta
sed -i -e 's|Exec=/usr/bin/soffice|Exec=/usr/bin/soffice-beta|g' ${pkgdir}/usr/share/applications/*.desktop
sed -i -e 's|Exec=/usr/bin/spadmin|Exec=/usr/bin/spadmin-beta|g' ${pkgdir}/usr/share/applications/printeradmin.desktop
cd ${pkgdir}/usr/bin
rm -f soffice spadmin
ln -sf /usr/lib/openoffice-beta/program/soffice soffice-beta
ln -sf /usr/lib/openoffice-beta/program/spadmin spadmin-beta
cd ${pkgdir}/usr/share/applications/
for desktopz in *.desktop
do mv $desktopz Beta-$desktopz
done
for i in `find ${pkgdir}/usr/share/icons -name '*.png'` ; do mv $i `dirname $i`/beta-`basename $i` ; done ;
cd ${pkgdir}/usr/share/applications/
sed -i -e 's|Icon=|Icon=beta-|g' ${pkgdir}/usr/share/applications/*.desktop
sed -i -e 's|OpenOffice\.org\ 3\.1|OpenOffice\.org\ Beta|g' ${pkgdir}/usr/share/applications/*.desktop
cd ${pkgdir}/usr/lib/openoffice-beta/program/
ln -sf /usr/lib/openoffice-beta/program/soffice.bin soffice-beta.bin
# set desktop variable to force gtk/gnome vcl usage
install -m755 -d ${pkgdir}/etc/profile.d
install -m755 ${srcdir}/openoffice-beta.profile ${pkgdir}/etc/profile.d/openoffice-beta.sh || return 1
# link the mozilla-plugin
mkdir -p ${pkgdir}/usr/lib/mozilla/plugins/
cd ${pkgdir}/usr/lib/mozilla/plugins/
ln -v -s /usr/lib/openoffice-beta/program/libnpsoplugin.so .
mv ${pkgdir}/usr/lib/mozilla/plugins/libnpsoplugin.so ${pkgdir}/usr/lib/mozilla/plugins/libnpsoplugin-beta.so
}