SliTaz SliTaz Forum

You are not logged in.

#1 2013-03-09 01:24:11

spunkysam
Member
Registered: 2013-03-09
Posts: 4

Installed LibreOffice 4.0.1 but cannot open

With the below script I have managed to download and install LibreOffice 4.0.1. There are no errors but nothing will open.

#!/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-OpenOffice4 (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-GB.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 [c]basename $0[/c] 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=[c]find $TEMP_DIR -type d 2> /dev/null | grep LibreOffice | head -n 1 | sed 's/_/ /g' | awk '{print $2}'[/c]

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/LibreOffice_4.0.1.2_Linux_x86_rpm_langpack_en-GB/RPMS/*.rpm $TEMP_DIR/LibreOffice_4.0.1.2_Linux_x86_rpm/RPMS/

fi

status

# Extracted pkg can be removed: Save RAM

rm -rf $SOURCE_DIR

# Extract everything from RPMS

cd $TEMP_DIR/LibreOffice_4.0.1.2_Linux_x86_rpm/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

# 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=$(ls $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"

WEB_SITE="$URL"

post_install()

{

    cd /usr/share/applications

    ln -s /usr/lib/libreoffice?*/share/xdg/base.desktop          libreoffice-base.desktop

    ln -s /usr/lib/libreoffice?*/share/xdg/impress.desktop       libreoffice-impress.desktop

    ln -s /usr/lib/libreoffice?*/share/xdg/writer.desktop        libreoffice-writer.desktop

    ln -s /usr/lib/libreoffice?*/share/xdg/calc.desktop          libreoffice-calc.desktop

    ln -s /usr/lib/libreoffice?*/share/xdg/math.desktop          libreoffice-math.desktop

    ln -s /usr/lib/libreoffice?*/share/xdg/draw.desktop          libreoffice-draw.desktop

    ln -s /usr/lib/libreoffice?*/share/xdg/printeradmin.desktop libreoffice-printeradmin.desktop

    chmod +x /usr/lib/libreoffice?*/share/xdg/*.desktop

    cd /usr/bin

    ln -s /usr/lib/libreoffice?* /usr/lib/libreoffice

    ln -sf /usr/lib/libreoffice/program/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

Offline

#2 2013-03-10 14:20:33

remyhr
Member
Registered: 2011-05-05
Posts: 5

Re: Installed LibreOffice 4.0.1 but cannot open

Hello,

With the script below I've installed LibreOffice 4.0.1 and it works.

#!/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}"

#http://download.documentfoundation.org/libreoffice/stable/4.0.0/rpm/x86/LibreOffice_4.0.0_Linux_x86_rpm_langpack_fr.tar.gz

#http://download.documentfoundation.org/libreoffice/stable/4.0.0/rpm/x86/LibreOffice_4.0.0_Linux_x86_rpm_langpack_fr.tar.gz

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 [c]basename $0[/c] 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=[c]find $TEMP_DIR -type d 2> /dev/null | grep LibreOffice_ | head -n 1 | sed 's/_/ /g' | awk '{print $2}'[/c]

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

# 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=$(ls $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"

WEB_SITE="$URL"

post_install()

{

    cd /usr/share/applications

    ln -s /usr/lib/libreoffice?*/share/xdg/base.desktop          libreoffice-base.desktop

    ln -s /usr/lib/libreoffice?*/share/xdg/impress.desktop       libreoffice-impress.desktop

    ln -s /usr/lib/libreoffice?*/share/xdg/writer.desktop        libreoffice-writer.desktop

    ln -s /usr/lib/libreoffice?*/share/xdg/calc.desktop          libreoffice-calc.desktop

    ln -s /usr/lib/libreoffice?*/share/xdg/math.desktop          libreoffice-math.desktop

    ln -s /usr/lib/libreoffice?*/share/xdg/draw.desktop          libreoffice-draw.desktop

    ln -s /usr/lib/libreoffice?*/share/xdg/printeradmin.desktop libreoffice-printeradmin.desktop

    chmod +x /usr/lib/libreoffice?*/share/xdg/*.desktop

    cd /usr/bin

    ln -s /usr/lib/libreoffice?* /usr/lib/libreoffice

    ln -sf /usr/lib/libreoffice/program/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

Offline

#3 2013-03-11 01:22:27

spunkysam
Member
Registered: 2013-03-09
Posts: 4

Re: Installed LibreOffice 4.0.1 but cannot open

Hey remyhr, just tried to install it but got the following errors

Extracting files (this may take a while): (found v)mv: can't rename '/tmp/LibreOffice.1635/LibreOffice__Linux_x86_rpm_langpack_en-GB/RPMS/*.rpm': No such file or directory

                                                                     [ Failed ]

/usr/bin/get-LibreOffice: cd: line 138: can't cd to /tmp/LibreOffice.1635/LibreOffice__Linux_x86_rpm/RPMS

From what I can see the script is adding an extra underscore in the directory path /LibreOffice__Linux_x86

I manually put the path in, but same problem as before, LibreOffice installs but nothing opens.

Thanks so much for your help

Offline

#4 2013-03-11 08:27:54

remyhr
Member
Registered: 2011-05-05
Posts: 5

Re: Installed LibreOffice 4.0.1 but cannot open

hello spunkysam,

I retry with my script and it works ... Why for me and not for you?

this error :

Extracting files (this may take a while): (found v)mv: can't rename '/tmp/LibreOffice.1635/LibreOffice__Linux_x86_rpm_langpack_en-GB/RPMS/*.rpm': No such file or directory

                                                                     [ Failed ]

come with this line :

ARCHIVED_VERSION=[c]find $TEMP_DIR -type d 2> /dev/null | grep LibreOffice_ | head -n 1 | sed 's/_/ /g' | awk '{print $2}'[/c]

echo -n "(found v${ARCHIVED_VERSION})"

in original script: grep LibreOffice but we need to have : grep LibreOffice_

In case I forgot something you find my script below

I hope it can help you

(Excuse me for my poor English... I'm french frog ;-))

#!/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}"

#http://download.documentfoundation.org/libreoffice/stable/4.0.0/rpm/x86/LibreOffice_4.0.0_Linux_x86_rpm_langpack_fr.tar.gz

#http://download.documentfoundation.org/libreoffice/stable/4.0.0/rpm/x86/LibreOffice_4.0.0_Linux_x86_rpm_langpack_fr.tar.gz

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 [c]basename $0[/c] 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=[c]find $TEMP_DIR -type d 2> /dev/null | grep LibreOffice_ | head -n 1 | sed 's/_/ /g' | awk '{print $2}'[/c]

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

# 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=$(ls $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"

WEB_SITE="$URL"

post_install()

{

    cd /usr/share/applications

    ln -s /usr/lib/libreoffice?*/share/xdg/base.desktop          libreoffice-base.desktop

    ln -s /usr/lib/libreoffice?*/share/xdg/impress.desktop       libreoffice-impress.desktop

    ln -s /usr/lib/libreoffice?*/share/xdg/writer.desktop        libreoffice-writer.desktop

    ln -s /usr/lib/libreoffice?*/share/xdg/calc.desktop          libreoffice-calc.desktop

    ln -s /usr/lib/libreoffice?*/share/xdg/math.desktop          libreoffice-math.desktop

    ln -s /usr/lib/libreoffice?*/share/xdg/draw.desktop          libreoffice-draw.desktop

    ln -s /usr/lib/libreoffice?*/share/xdg/printeradmin.desktop libreoffice-printeradmin.desktop

    chmod +x /usr/lib/libreoffice?*/share/xdg/*.desktop

    cd /usr/bin

    ln -s /usr/lib/libreoffice?* /usr/lib/libreoffice

    ln -sf /usr/lib/libreoffice/program/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

Offline

#5 2013-03-12 09:57:16

spunkysam
Member
Registered: 2013-03-09
Posts: 4

Re: Installed LibreOffice 4.0.1 but cannot open

Hey remyhr, instead of grep LibreOffice_ I tried grep LibreOffice but still got double underscore after LibreOffice__ very strange. Also it seems your post of the get_LibreOffice.txt has been removed. I should add I do have java installed.

Offline

#6 2013-03-12 10:32:57

aniguenni
Member
Registered: 2011-12-18
Posts: 153

Re: Installed LibreOffice 4.0.1 but cannot open

why you don't give freeoffice a try?

http://www.freeoffice.com/en

it's a fully featured office (compatible to libreoffice, openoffice, ms-word and many others). It has textmaker (like word), planmaker (like excel) and presentations (like powerpoint). and it is not so heavyweight like libreoffice or openoffice. i really do like it and don't miss libre office any longer.

thanks kultex in a earlier post: http://forum.slitaz.org/topic/softmaker-office-linux-for-free-until-24-december i got the impression and find it very suitable.

Offline

#7 2013-03-13 03:33:51

boechat
Member
Registered: 2012-08-01
Posts: 16

Re: Installed LibreOffice 4.0.1 but cannot open

Hi!

I tested the script and it crashed too.

spunkysam and remyhr, it occurred the same error for me.

I managed to install as follows:

0 - I uninstalled the previous version and any erroneous attempt;

1 - I downloaded LibreOffice and translation *_RPM*.tar.gz packages in the Open Document Foundation;

Take a look in http://download.documentfoundation.org/libreoffice/stable/4.0.1/rpm/x86/

There also has the help package, if you interest. Look for helppack.

2 - Extracted everything and put all the RPM's in a single folder;

3 - I converted everything with a single for loop + tazpkg:

for rpm in $(ls *.rpm); do tazpkg convert $rpm; done

4 - And I installed everything with:

for qwe in $(ls *.tazpkg); do tazpkg install $qwe; done

*** Not very fast conversion, but it worked perfectly to me and for other guy.

This method downloaded and installed all dependencies.

Offline

#8 2013-03-13 21:12:23

remyhr
Member
Registered: 2011-05-05
Posts: 5

Re: Installed LibreOffice 4.0.1 but cannot open

hello,

ok i have a problem ...why it works for me and not for you?

but it's not important ... i just want a good receipt to install libreoffice for any slitaz user ...

Offline

#9 2013-03-13 21:35:28

ernia
Member
Registered: 2011-05-20
Posts: 299

Re: Installed LibreOffice 4.0.1 but cannot open

look at this

http://forum.slitaz.org/topic/rolling-get-libreoffice-broken-ugly-fix#post-20485

i don't have time to test but your script seems to have the offending line, do you have coreutils-directory installed?

Offline

#10 2013-03-15 22:57:26

spunkysam
Member
Registered: 2013-03-09
Posts: 4

Re: Installed LibreOffice 4.0.1 but cannot open

OK, firstly thank you for everybody's help, it is greatly appreciated.

Good news is I got it working thanks to boechat's method (which takes a very very long time converting, I started at 830, woke up at 4am and it was still going, but then woke up at 9 and it was finished and working). I noticed when I went to install LibreOffice there were a lot of dependencies missing such as ghostscript, greasemonkey, icedteas6-jre and many more. That would explain why the script wasn't working. So thanks heaps boechat, especially for the simple instructions.

aniguenni I used the link you provided to download freeoffice and that installed without a problem (this was before I successfully installed LibreOffice). And I was amazed at how fast it was. When I use LibreOffice there is a slight delay in opening a document but freeoffice is pretty much instant. Only downside is LibreOffice has a much easier to use interface and admittedly looks nicer and with the ability to save in .docx and xlsx format (which freeoffice does not provide, unless you purchase their softoffice maker 2012). But I will play around with freeoffice, I love the idea of opening files instantly without any lag.

Once again thanks you everyone for your help.

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.018 seconds, 7 queries executed - Memory usage: 1.61 MiB (Peak: 1.77 MiB) ]