/usr/bin/get-OpenOffice3and did the following changes:
Line 19: SUFFIX="Linux_x86_install-rpm_en-US.tar.gz";;
Line 22: VERSION="3.2.1"
#!/bin/sh
# get-OpenOffice3, install everything for OpenOffice.org exept KDE/Gnome integration and testsuite.
#
# (C) 2008 SliTaz - GNU General Public License v3.
#
# Author : Eric Joseph-Alexandre
PACKAGE="OpenOffice3"
URL="http://www.openoffice.org"
ROOT="$1"
case "$LANG" in
fr_FR*|de_DE*|es_ES*|it_IT*|ru_RU*)
LOC=${LANG%_*}
DIR="localized/$LOC"
SUFFIX="Linux_x86_install-rpm_$LOC.tar.gz";;
*)
DIR="stable"
SUFFIX="Linux_x86_install-rpm_en-US.tar.gz";;
esac
VERSION="$(basename $(wget -O - http://openofficeorg.secsup.org/$DIR/ \
2> /dev/null | grep href=\"[0-9] | tail -1 | sed 's/.*href=\"\(.*\)\".*/\1/'))"
if [ -z "$VERSION" ]; then
echo "Can't find VERSION. Abort."
exit 0
fi
TARBALL="OOo_${VERSION}_${SUFFIX}"
WGET_URL=ftp://ftp.proxad.net/mirrors/ftp.openoffice.org/$DIR/$VERSION/$TARBALL
TEMP_DIR="/tmp/$PACKAGE.$$"
SOURCE_DIR="/tmp/src.$$"
EXCLUDE="kde|gnome|test"
LOG="/tmp/$(basename $0 .sh).log"
# Status function with color (supported by Ash).
status()
{
local CHECK=$?
echo -en "\\033[70G[ "
if [ $CHECK = 0 ]; then
echo -en "\\033[1;33mOK"
else
echo -en "\\033[1;31mFailed"
fi
echo -e "\\033[0;39m ]"
return $CHECK
}
# Check if user is root to install, or remove packages.
check_root()
{
if test $(id -u) != 0 ; then
echo -e "\nYou must be root to run `basename $0` with this option."
echo -e "Please use 'su' and root password to become super-user.\n"
exit 0
fi
}
check_if_installed()
{
# Avoid reinstall
if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ];then
return 0
else
return 1
fi
}
#We need to bee root
check_root
#check if package already installed
if (check_if_installed $PACKAGE); then
echo "$PACKAGE is already installed."
[ -n "$ROOT" ] && exit 0
echo -n "Would you like to remove and reinstall this package [y/n]? "
read answer
case "$answer" in
y|Y)
tazpkg remove $PACKAGE ;;
*)
exit 0 ;;
esac
fi
# Check if we have the tarball before.
if [ ! -f $SOURCE_DIR/$TARBALL ]; then
echo "Downloading OppenOffice.org tarball (it's time to have a break)... "
#Check if $SOURCE_DIR exist
test -d $SOURCE_DIR || mkdir -p $SOURCE_DIR
# Get the file.
wget -c $WGET_URL -O $SOURCE_DIR/$TARBALL
status
fi
# Creates TEMP_DIR and extract tarball
mkdir -p $TEMP_DIR
echo -n "Extract files from archive..."
tar xvzf $SOURCE_DIR/$TARBALL -C $TEMP_DIR > $LOG 2>&1 || \
(echo "Failed to extract $TARBALL" ; exit 1)
status
# extracted pkg can be removed: Save RAM
rm -rf $SOURCE_DIR
cd $TEMP_DIR/*/RPMS
# Extract everything from RPMS
for i in *.rpm
do
if (! echo $i | egrep -qi $EXCLUDE); then
(rpm2cpio $i | cpio -id >> $LOG 2>&1 ) && rm -f $i
fi
done
rpm2cpio desktop-integration/*freedesktop*.rpm | cpio -id >> $LOG 2>&1
# extracted pkg can be removed: Save RAM
rm -f desktop-integration/*freedesktop*.rpm
# Make the package
mkdir -p $PACKAGE-$VERSION/fs/usr/lib/openoffice \
$PACKAGE-$VERSION/fs/usr/share
# use mv instead of 'cp -a' to save RAM
mv opt/openoffice* $PACKAGE-$VERSION/fs/usr/lib/openoffice
mv usr/share/mime $PACKAGE-$VERSION/fs/usr/share
mv usr/share/icons $PACKAGE-$VERSION/fs/usr/share
mv usr/bin $PACKAGE-$VERSION/fs/usr
# relocalized OOo libexec directory
sed -i 's#/opt/#/usr/lib/openoffice/#' $PACKAGE-$VERSION/fs/usr/bin/openoffice*
# Create receipt
cat > $PACKAGE-$VERSION/receipt <<EOT<br /># SliTaz package receipt.
PACKAGE="$PACKAGE"
VERSION="$VERSION"
CATEGORY="office"
SHORT_DESC="Productivity suite."
DEPENDS=""
WEB_SITE="$URL"
post_install()
{
cd /usr/share/applications
ln -s /usr/lib/openoffice/openoffice.org3/share/xdg/base.desktop openoffice.org3-base.desktop
ln -s /usr/lib/openoffice/openoffice.org3/share/xdg/impress.desktop openoffice.org3-impress.desktop
ln -s /usr/lib/openoffice/openoffice.org3/share/xdg/writer.desktop openoffice.org3-writer.desktop
ln -s /usr/lib/openoffice/openoffice.org3/share/xdg/calc.desktop openoffice.org3-calc.desktop
ln -s /usr/lib/openoffice/openoffice.org3/share/xdg/math.desktop openoffice.org3-math.desktop
ln -s /usr/lib/openoffice/openoffice.org3/share/xdg/draw.desktop openoffice.org3-draw.desktop
ln -s /usr/lib/openoffice/openoffice.org3/share/xdg/printeradmin.desktop openoffice.org3-printeradmin.desktop
cd /usr/bin
ln -sf /usr/lib/openoffice/openoffice.org3/program/soffice
}
post_remove()
{
rm -f /usr/share/applications/openoffice.org3-*
}
EOT
# Pack
tazpkg pack $PACKAGE-$VERSION
# Clean to save RAM memory
rm -rf $PACKAGE-$VERSION
# Install pseudo package
tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
# Clean
rm -rf $TEMP_DIR
It looks like you're new here. If you want to get involved, click one of these buttons!