Skip to content
Virginia Morales Teran edited this page May 10, 2014 · 1 revision

#!/bin/bash

echo "User Mode Installation script for developer and knowledgeable early access tester"
echo "Usage:" $0 "<rpm-source-dir> <office-installation-dir> [-l]"
echo "    <rpm-source-dir>:       directory *only* containing the Linux rpm packages to be installed"
echo "    <inst-destination-dir>: directory to where the office will get installed into"
echo "    -l:                     optional parameter to create a link \"soffice\" in $HOME"

RPMLIST=find $PACKAGE_PATH -type f -name "*.rpm" ! -name "*-core01-*" ! -name "*-menus-*" ! -name "adabas*" ! -name "jre*" ! -name "*-gnome*" -print CORERPM=find $PACKAGE_PATH -type f -name "*.rpm" -name "*-core01-*" -print PREFIX=rpm -qlp $CORERPM | head -n1

if [ -z "$CORERPM" ] then

Install gnome-integration package on systems without GNOME

check for /bin/rpm first, otherwise the rpm database is most likely empty anyway

if [ -x /bin/rpm ] then /bin/rpm -q gnome-vfs2 >/dev/null if [ $? -eq 0 ] then GNOMERPM=find $PACKAGE_PATH -type f -name "*.rpm" -name "*-gnome*" for i in $CORERPM $RPMLIST $GNOMERPM; do echo basename $i` done

Check/Create installation directory

if [ -d $INSTALLDIR ] then install "PYBOMS" $INSTALLDIR exists and is not empty or cannot be removed" fi

We expect that rpm_DB_PATH does not exist, however if it is empty we ignore it

#RPM_DB_PATH=$HOME/.RPM_OFFICEDATABASE RPM_DB_PATH=$INSTALLDIR/.RPM_OFFICEDATABASE

Perform the installation

############################################" echo "# Installation of the found packages #" echo "####################################################################" echo echo "Path to the database: " $RPM_DB_PATH echo "Path to the packages: " $PACKAGE_PATH echo "Path to the installation: " $INSTALLDIR

Creating directories

mkdir -p $RPM_DB_PATH

XXX why ? XXX

chmod 700 $RPM_DB_PATH if [ ! -d $RPM_DB_PATH ] then -install "Create directory $RPM_DB_PATH"

Creating RPM database and initializing

rpm --initdb --dbpath $RPM_DB_PATH echo "Installing the RPMs"

inject a second slash to the last path segment to avoid rpm 3 concatination bug

NEWPREFIX=echo $INSTALLDIR | sed -e 's|\(.*\)\/\(.*\)|\1\/\/\2|' rpm --install --nodeps -vh --relocate $PREFIX=$NEWPREFIX --dbpath $RPM_DB_PATH $CORERPM rpm --install --nodeps -vh --relocate $PREFIX=$NEWPREFIX --dbpath $RPM_DB_PATH $RPMLIST $GNOMERPM

Create a link into the users home directory

if [ "$LINK" = "-l" ] then echo echo "Creating link from $INSTALLDIR/program/soffice to $HOME/soffice" rm -f $HOME/soffice ln -s $INSTALLDIR/program/soffice $HOME/soffice fi

patch the "bootstraprc" to create a self-containing installation

mv $INSTALLDIR/program/bootstraprc $INSTALLDIR/program/bootstraprc.orig sed 's/UserInstallation=$SYSUSERCONFIG/.staroffice8/UserInstallation=$ORIGIN/../UserInstallation/g' $INSTALLDIR/program/bootstraprc.orig > $INSTALLDIR/program/bootstraprc

echo echo "Installation done ..."

exit 0

.nav a { color: #5a5a5a; font-size: 11px; font-weight: bold; padding-bottom:14px; padding-left:10px; padding-right:10px; padding-top: 14px; text-transform:uppercase;