Hi
I'm using Slitaz 5.0 rc3 and installed LibreOffice using the Package Manager some how it doesn't work.
It does not show up in the office applications.
Not beeing held back by any real computer knowledge I looked for the LibreOffice package.
I found it in /usr/bin when I dubbelklick it I get the choices * execute ( if I klick on it nothing happens )
* execute in terminal ( if I klick on it I get a blackscreen and have no idea what to do )
* open ( if I klick on that I get the following and still no idea )
#!/bin/sh
# get-LibreOffice - install LibreOffice excl. KDE/Gnome integration & test suite.
#
# (C) 2010 SliTaz - GNU General Public License v3.
# Author : Ben Arnold <ben@seawolfsanctuary.com>
# via : get-OpenOffice3 (Eric Joseph-Alexandre <erjo@slitaz.org>)
#
PACKAGE="LibreOffice"
URL="http://www.libreoffice.org"
ROOT="$1"
DIR="stable"
SUFFIX="Linux_x86_rpm.tar.gz"
WGET_URL="http://download.documentfoundation.org/libreoffice/$DIR"
VERSION="$(basename $(wget -O - $WGET_URL/ 2> /dev/null | \
sed '/href=\"[0-9]/!d;s/.*href=\"//;s/[/\">].*//' | tail -1))"
if [ -z "$VERSION" ]; then
echo "Can't detect an appropriate version. The version numbering or URL may have changed. Aborted."
exit 0
fi
VER="${VERSION/\-/}" # without hyphens
TARBALL="LibreOffice_${VER}_${SUFFIX}"
for LOC in ${LANG/_/-} ${LANG%_*}; do
L_SUFFIX="Linux_x86_rpm_langpack_$LOC.tar.gz"
L_TARBALL="LibreOffice_${VER}_${L_SUFFIX}"
LANG_URL="$WGET_URL/${VERSION}/rpm/x86/${L_TARBALL}"
busybox wget -s $LANG_URL 2> /dev/null || continue
echo "Added $LANG ($LOC)."
break
done
WGET_URL="$WGET_URL/${VERSION}/rpm/x86/${TARBALL}"
CUR_DIR=$(pwd)
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 "\33[70G[ "
if [ $CHECK = 0 ]; then
echo -en "\33[1;33mOK"
else
echo -en "\33[1;31mFailed"
fi
echo -e "\33[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 be 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 LibreOffice 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
if [ -n $L_TARBALL ] ; then # Are we localised?
wget -c $LANG_URL -O $SOURCE_DIR/$L_TARBALL
fi
status
fi
if [ ! -f $SOURCE_DIR/$TARBALL ]; then
rm -rf $SOURCE_DIR
echo "Could not download $TARBALL. Exiting."
exit 1
fi
echo -n "Extracting files (this may take a while): "
# Creates TEMP_DIR and extract tarball
mkdir -p $TEMP_DIR
for TB in $TARBALL $L_TARBALL ; do
tar xvzf $SOURCE_DIR/$TB -C $TEMP_DIR > $LOG 2>&1 || \
(echo "Failed to extract $TB" ; exit 1)
done
# Get version found in archive (often directory is still RC version when final is present)
ARCHIVED_VERSION=cd $TEMP_DIR;find . -type d 2> /dev/null | grep LibreOffice | head -n 1 | sed 's/_/ /g' | awk '{print $2}'
echo -n "(found v${ARCHIVED_VERSION})"
# Consolidate localisations into main package
if [ -n $L_TARBALL ] ; then # Are we localised?
TARBALL_NAME="${TARBALL/.tar.gz/}"
L_TARBALL_NAME="${L_TARBALL/.tar.gz/}"
mv -f $TEMP_DIR/${L_TARBALL_NAME/$VERSION/$ARCHIVED_VERSION}/RPMS/*.rpm $TEMP_DIR/${TARBALL_NAME/$VERSION/$ARCHIVED_VERSION}/RPMS/
fi
status
# Extracted pkg can be removed: Save RAM
rm -rf $SOURCE_DIR
# Extract everything from RPMS
cd $TEMP_DIR/${TARBALL_NAME/$VERSION/$ARCHIVED_VERSION}/RPMS
for i in *.rpm
do
if (! echo $i | egrep -qi $EXCLUDE); then
echo -n "."
(rpm2cpio $i | cpio -id >> $LOG 2>&1 ) && rm -f $i
fi
done
#rpm2cpio desktop-integration/*freedesktop*.rpm | cpio -id >> $LOG 2>&1
#rpm2cpio *freedesktop*.rpm | cpio -id >> $LOG 2>&1
# extracted pkg can be removed: Save RAM
rm -f desktop-integration/*freedesktop*.rpm
status
echo -n "Preparing package... "
# Make the package
mkdir -p $PACKAGE-$VERSION/fs/usr/lib/libreoffice \
$PACKAGE-$VERSION/fs/usr/share
# use mv instead of 'cp -a' to save RAM
mv opt/libreoffice* $PACKAGE-$VERSION/fs/usr/lib
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 libexec directory
bin=$(echo $PACKAGE-$VERSION/fs/usr/bin/libreoffice???)
if [ -L $bin ]; then
target=$(readlink $bin)
rm -f $bin
ln -s ${target/opt/usr\/lib\/libreoffice} $bin
else
sed -i 's#/opt/#/usr/lib/libreoffice/#' $bin
fi
# Create receipt
cat > $PACKAGE-$VERSION/receipt <<EOT
# SliTaz package receipt.
PACKAGE="$PACKAGE"
VERSION="$VERSION"
CATEGORY="office"
SHORT_DESC="Productivity suite."
DEPENDS="java6-jre cups"
WEB_SITE="$URL"
post_install()
{
ln -sf /usr/lib/libreoffice?* /usr/lib/libreoffice
path_libreoffice=\$(find /usr/lib/libreoffice -name libreoffice*.*)
# Remove links if exist
rm -f /usr/share/applications/libreoffice-*
# Create links
cd /usr/share/applications
ln -sf \$path_libreoffice/share/xdg/base.desktop libreoffice-base.desktop
ln -sf \$path_libreoffice/share/xdg/impress.desktop libreoffice-impress.desktop
ln -sf \$path_libreoffice/share/xdg/writer.desktop libreoffice-writer.desktop
ln -sf \$path_libreoffice/share/xdg/calc.desktop libreoffice-calc.desktop
ln -sf \$path_libreoffice/share/xdg/math.desktop libreoffice-math.desktop
ln -sf \$path_libreoffice/share/xdg/draw.desktop libreoffice-draw.desktop
chmod +x \$path_libreoffice/share/xdg/*.desktop
# If necessary, recreate links for soffice
rm -f /usr/bin/soffice /usr/bin/libreoffice
ln -sf \$path_libreoffice/program/soffice /usr/bin/libreoffice
ln -sf \$path_libreoffice/program/soffice /usr/bin/soffice
}
post_remove()
{
rm -f /usr/share/applications/libreoffice-*
}
EOT
status
# Pack
tazpkg pack $PACKAGE-$VERSION
# Clean to save RAM memory
rm -rf $PACKAGE-$VERSION
# Install pseudo package
tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
case " $@ " in
*\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;;
esac
# Clean
cd $CUR_DIR
rm -rf $TEMP_DIR