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

365 lines
13 KiB
Bash

# $Id: PKGBUILD 54315 2009-10-08 11:42:02Z andyrtr $
# Maintainer: AndyRTR <andyrtr@archlinux.org>
# Contributor: Hussam Al-Tayeb <ht990332@gmail.com>
pkgbase="openoffice-base-devel"
pkgname=('openoffice-base-devel' 'openoffice-sdk-devel')
_OO_milestone=DEV300_m61
pkgver=3.2_${_OO_milestone/DEV/dev}
pkgrel=1
arch=('i686' 'x86_64')
license=('LGPL3')
url="http://www.openoffice.org"
makedepends=(# the real makedeps
'bison' 'svn' 'automake' 'findutils' 'flex' 'gawk' 'gcc-libs' 'libart-lgpl' 'libxtst'
'pam' 'sane' 'zip' 'perl-archive-zip' 'pkgconfig' 'unzip' "xulrunner>=1.9.1.3"
'apache-ant>=1.7.1-3' 'cairo' 'gperf' 'libcups' 'poppler' 'pstoedit' 'gconf' "openjdk6>=1.6.1"
# from main OOo the deps
"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'
'beanshell' 'saxon' 'vigra' 'libgraphite' 'hyphen' 'lpsolve' 'libmspack' 'libldap' 'lucene')
# boost
# libmythes
source=(${pkgname}-${_OO_milestone}.tar.gz
http://tools.openoffice.org/unowinreg_prebuild/680/unowinreg.dll
startcenter.desktop
default-no-startup-wizard.diff
default-system-fpicker.diff
soffice-detect-mozilla-certificates.diff
buildfix-gcc44.diff
buildfix_FormulaMissingHeader.diff
http://www.openoffice.org/nonav/issues/showattachment.cgi/64767/openldap.patch
buildfix_system_db48.diff
openoffice.profile)
options=('!distcc' '!ccache' '!makeflags')
md5sums=('6244c09b0b4c67519191bef0f9ec393d'
'e3a0b76dcd876f3d721ee7183729153d'
'63209bbc64c901ef105455bda0282f45'
'71f136a31e296a04ab68932a31dd533e'
'6c596129fb48316226ce3adfd3a4c86d'
'1dc7480a04f572ad136d35923a2af66d'
'c8e82b4d2324fe62ad8c6e29213e80b5'
'863a3ab2c17a3d11b8fa3ec321986366'
'a130ad960f76b692e34f8566e5ca3f2b'
'0cd6f3525939d3ef6e5a30ad30c25d27'
'8d68d44c941a687813ddd968383cdf27')
# 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
[ -z "${ANT_HOME}" ] && . /etc/profile.d/apache-ant.sh
# some speedups
export SMP="6"
# export SMP="1"
MAXMODULESFLAG="-P${SMP}"
MAXPROCESSESFLAG="-P${SMP}"
export nodep=true
export NO_HIDS=true
# build fixes
patch -Np0 -i ${srcdir}/buildfix-gcc44.diff || return 1
patch -Np0 -i ${srcdir}/buildfix_FormulaMissingHeader.diff || return 1
patch -Np0 -i ${srcdir}/openldap.patch || return 1
patch -Np0 -i ${srcdir}/buildfix_system_db48.diff || 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
# 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
else EXTRAOPTS="--with-stlport --without-system-graphite"
fi
cd ${srcdir}/${_OO_milestone}
# needed to build the OO-SDK
mv ${srcdir}/unowinreg.dll external/unowinreg || return 1
# 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\
--with-lang="en-US"\
--with-dict=ALL\
--disable-gnome-vfs\
--disable-qadevooo\
--disable-reportdesign\
--disable-systray\
--disable-mathmldtd\
--enable-binfilter\
--enable-cairo\
--enable-crashdump=yes\
--enable-cups\
--enable-dbus\
--enable-evolution2\
--enable-gio\
--enable-gtk\
--enable-graphite\
--enable-kde4\
--enable-ldap\
--enable-lockdown\
--enable-mediawiki\
--enable-minimizer\
--enable-odk\
--enable-opengl\
--enable-pdfimport\
--enable-presenter-console\
--enable-report-builder\
--enable-vba\
--enable-verbose\
--enable-wiki-publisher\
--with-package-format=native\
--without-fonts\
--without-afms\
--without-gpc\
--without-nas\
--without-ppds\
--without-system-agg\
--without-system-boost\
--without-system-lucene\
--with-openldap\
--with-system-stdlibs\
--with-system-libs\
--with-system-sane-header\
--with-system-mozilla=libxul\
--with-system-xrender-headers\
--with-system-headers\
--with-system-redland\
--with-alloc=system\
--with-jdk-home=${JAVA_HOME}\
--with-lucene-core-jar=/usr/share/java/lucene-core.jar\
--with-lucene-analyzers-jar=/usr/share/java/lucene-analyzers.jar\
--with-saxon-jar=/usr/share/java/saxon/saxon9he.jar\
--with-use-shell=bash\
$EXTRAOPTS || return 1
# --enable-layout\ /bin/bash: tralay: command not found ???
#--with-system-jfreereport
# --with-system-mythes\
# we will need myspell dicts for --with-system-dicts --without-myspell-dicts
# 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 ..
}
package_openoffice-base-devel() {
pkgdesc="OpenOffice.org - a free multiplatform and multilingual office suite"
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'
'beanshell' 'saxon' 'vigra' 'libgraphite' 'hyphen' 'lpsolve' 'libmspack' 'libldap') # 'lucene' 'libmythes'
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'
'poppler: for shipped pdfimport extension'
'kdelibs: for kde integration')
backup=(usr/lib/openoffice-dev/program/sofficerc )
provides=('openoffice-base')
cd ${srcdir}/${_OO_milestone}
# 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.2/ || return 1
cd basis3.2 || return 1
rm ure-link && mv ure ure-link || return 1
## Step 2
cd ${pkgdir}/usr/lib/ || return 1
mv openoffice.org/basis3.2/ openoffice.org3/ || return 1
cd openoffice.org3/ || return 1
rm basis-link && mv basis3.2 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!
cd ${pkgdir}/usr/lib/
mv openoffice openoffice-dev
sed -i -e 's|Exec=/usr/bin/soffice|Exec=/usr/bin/soffice-dev|g' ${pkgdir}/usr/share/applications/*.desktop
sed -i -e 's|Exec=/usr/bin/spadmin|Exec=/usr/bin/spadmin-dev|g' ${pkgdir}/usr/share/applications/printeradmin.desktop
cd ${pkgdir}/usr/bin
rm -f soffice spadmin
ln -sf /usr/lib/openoffice-dev/program/soffice soffice-dev
ln -sf /usr/lib/openoffice-dev/program/spadmin spadmin-dev
cd ${pkgdir}/usr/share/applications/
for desktopz in *.desktop
do mv $desktopz Dev-$desktopz
done
for i in `find ${pkgdir}/usr/share/icons -name '*.png'` ; do mv $i `dirname $i`/dev-`basename $i` ; done ;
cd ${pkgdir}/usr/share/applications/
sed -i -e 's|Icon=|Icon=dev-|g' ${pkgdir}/usr/share/applications/*.desktop || return 1
sed -i -e 's|OpenOffice\.org\ 3\.2|OpenOffice\.org\ devel|g' ${pkgdir}/usr/share/applications/*.desktop || return 1
cd ${pkgdir}/usr/lib/openoffice-dev/program/
ln -sf /usr/lib/openoffice-dev/program/soffice.bin soffice-dev.bin
# set desktop variable to force gtk/gnome vcl usage
install -m755 -d ${pkgdir}/etc/profile.d
install -m755 ${srcdir}/openoffice.profile ${pkgdir}/etc/profile.d/openoffice-devel.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-dev/program/libnpsoplugin.so .
mv ${pkgdir}/usr/lib/mozilla/plugins/libnpsoplugin.so ${pkgdir}/usr/lib/mozilla/plugins/libnpsoplugin-dev.so
}
package_openoffice-sdk-devel() {
pkgdesc="OpenOffice.org SDK - development files"
depends=('openoffice-base-devel')
cd ${srcdir}/${_OO_milestone}
# install SDK
if [ "$CARCH" = "x86_64" ]; then
cp -R instsetoo_native/unxlngx6.pro/OpenOffice_SDK/native/install/en-US/linux-2.6-x86_64/buildroot/* ${pkgdir}/
else cp -R instsetoo_native/unxlngi6.pro/OpenOffice_SDK/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
cd ${pkgdir}/usr/lib/openoffice.org/basis3.2/sdk
for file in setsdkenv_unix.csh setsdkenv_unix.sh ; do
sed -e "s,@OO_SDK_NAME@,sdk," \
-e "s,@OO_SDK_HOME@,/usr/lib/openoffice-dev/basis-link/sdk," \
-e "s,@OFFICE_HOME@,/usr/lib/openoffice-dev," \
-e "s,@OFFICE_BASE_HOME@,/usr/lib/openoffice-dev/basis-link," \
-e "s,@OO_SDK_URE_HOME@,/usr/lib/openoffice-dev/basis-link/ure-link," \
-e "s,@OO_SDK_MAKE_HOME@,/usr/bin," \
-e "s,@OO_SDK_ZIP_HOME@,/usr/bin," \
-e "s,@OO_SDK_CPP_HOME@,/usr/bin," \
-e "s,@OO_SDK_CC_55_OR_HIGHER@,," \
-e "s,@OO_SDK_JAVA_HOME@,\$JAVA_HOME," \
-e "s,@OO_SDK_OUTPUT_DIR@,\$HOME," \
-e "s,@SDK_AUTO_DEPLOYMENT@,NO," \
$file.in > $file
chmod 755 $file
done
cd ${pkgdir}/usr/lib/ || return 1
mv openoffice.org openoffice || return 1
cd ${pkgdir}/usr/lib/openoffice/ || return 1
mv basis3.2 basis-link || return 1
# fix ownership and permissions
chown root.root -R ${pkgdir}/
## Develize it!
cd ${pkgdir}/usr/lib/
mv openoffice openoffice-dev
}