User:Wope/Linux parallele Installation2
From Apache OpenOffice Wiki
#!/bin/bash
#*************************************************************************
#*
#* OpenOffice.org - a multi-platform office productivity suite
#*
#* $RCSfile: install.sh,v $
#*
#* $Revision: 1.02 $
#*
#* last change: $Author: wolfgangpechlaner $ $Date: 2010/04/19 08:50:00 $
#*
#* The Contents of this file are made available subject to
#* the terms of GNU Lesser General Public License Version 2.1.
#*
#*
#* GNU Lesser General Public License Version 2.1
#* =============================================
#* Copyright 2005 by Sun Microsystems, Inc.
#* 901 San Antonio Road, Palo Alto, CA 94303, USA
#*
#* This library is free software; you can redistribute it and/or
#* modify it under the terms of the GNU Lesser General Public
#* License version 2.1, as published by the Free Software Foundation.
#*
#* This library is distributed in the hope that it will be useful,
#* but WITHOUT ANY WARRANTY; without even the implied warranty of
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
#* Lesser General Public License for more details.
#*
#* You should have received a copy of the GNU Lesser General Public
#* License along with this library; if not, write to the Free Software
#* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
#* MA 02111-1307 USA
#*
#########################################################################
#
# Owner : wope@openoffice.org
#
# short description : prepares a 2nd Installation for testing
# # it is assumed, that
# - the tar.gz files are in $DOWNLOADDIR,
# - the opt-directory shall be expanded to $OPTDIR,
# - the prefix of the tar.gz files is $PREFIXTAR
# - the langid is in $LANGID
# input :2 parameters (MWS and Milestone of the desired version
#
#########################################################################
DOWNLOADDIR=$HOME/Downloads
OPTDIR=$HOME
PREFIXTAR=OOo-Dev_
LANGID=de
TYP=Linux_x86-64_
# TYP=LinuxIntel
UNIXTYP=rpm
# UNIXTYP=deb
#########################################################################
usage() {
echo "### Usage: $0 <MWS> <Milestone>"
echo "### [-o OPTDIR] [-d DOWNLOADDIR] [-l LANGID]"
echo "### [-p PREFIXTAR] [-t TYP]"
echo "### MWS is the Master Workspace (eg DEV300 or OOO320)"
}
paramvalues() {
echo "Downloaddir : $DOWNLOADDIR"
echo "Optdir : $OPTDIR"
echo "Langid : $LANGID"
echo "Prefixtar : $PREFIXTAR"
echo "Unixtyp : $UNIXTYP"
echo "TYP : $TYP"
}
if [ $# -lt 2 ]
then
usage;
paramvalues;
exit -1
else
echo "*** $1_$2 would be installed ***"
fi;
export MWS="$1"
export MS="$2"
shift; shift # further parameters
while [ $# -ge 2 ]
do
case $1 in
-d) DOWNLODDIR=$2;;
-o) OPTDIR=$2;;
-l) LANGID=$2;;
-p) PREFIXTAR=$2;;
-u) UNIXTYP=$2;;
*) echo "*** invalid parameter ***"
usage;
paramvalues;
exit -1;;
esac
shift; shift
done
case $UNIXTYP in
rpm) ;;
deb) ;;
*) echo "*** invalid UNIXTYP ***"
paramvalues;
exit -1;;
esac
if [ ! -f $DOWNLOADDIR/$PREFIXTAR$MWS$MS\_$TYP\install-$UNIXTYP\_en-US.*tar.gz ]
then
echo "** file $PREFIXTAR$MWS$MS\_$TYP\install-$UNIXTYP\_en-US.tar.gz not found **"
paramvalues;
exit 1
fi
if [ ! -f $DOWNLOADDIR/$PREFIXTAR$MWS$MS\_$TYP\langpack-$UNIXTYP\_$LANGID.*tar.gz ]
then
echo "** file $PREFIXTAR$MWS$MS\_$TYP\langpack_$LANGID.tar.gz not found **"
paramvalues;
exit 1
fi
if [ ! -d $OPTDIR ]
then
mkdir $OPTDIR
echo "*** directory $OPTDIR created ***"
fi
paramvalues;
if [ -d $OPTDIR/opt ] ;then
echo "******* delete the old files *******"
rm -rf $OPTDIR/opt
fi
echo "******* unpack the tar.gz files *******"
cd $DOWNLOADDIR
tar -xzvf $PREFIXTAR$MWS$MS\_$TYP\install-$UNIXTYP\_en-US.*tar.gz >$MWS\_$MS\_install.log
tar -xzvf $PREFIXTAR$MWS$MS\_$TYP\langpack-$UNIXTYP\_$LANGID.*tar.gz >>$MWS\_$MS\_install.log
echo "******* install $UNIXTYP files *******"
cd $OPTDIR
case $UNIXTYP in
rpm)
for i in $DOWNLOADDIR/$MWS\_$MS\_native_packed*_en-US.*/????/o*.$UNIXTYP
do rpm2cpio $i | cpio -id 2>>$MWS\_$MS\_install.log
done
for i in $DOWNLOADDIR/$MWS\_$MS\_native_packed*_$LANGID.*/????/o*.$UNIXTYP
do rpm2cpio $i | cpio -id 2>>$MWS\_$MS\_install.log
done
;;
deb)
for i in $DOWNLOADDIR/$MWS\_$MS\_native_packed*_en-US.*/????/o*.$UNIXTYP
do dkpg-deb -x $i . 2>>$MWS\_$MS\_install.log
done
for i in $DOWNLOADDIR/$MWS\_$MS\_native_packed*_$LANGID.*/????/o*.$UNIXTYP
do dkpg-deb -x $i . 2>>$MWS\_$MS\_install.log
done
;;
esac
echo "******* test start $MWS $MS *******"
$OPTDIR/opt/ooo-dev3/program/soffice
echo "******* logfile $MWS $MS install.log ******"