get-scripts annotate libreoffice @ rev 47

firefox-official: fix paths
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Jun 04 18:56:03 2015 +0200 (2015-06-04)
parents 9236e88ec240
children 2cdf3e534506
rev   line source
pascal@34 1 SHORT_DESC="Productivity suite."
pascal@34 2 WEB_SITE="http://www.libreoffice.org"
pascal@40 3 CATEGORY="office"
pascal@40 4 LICENSE="LGPL3"
pascal@34 5 # end of get.list data
pascal@4 6 #!/bin/sh
pascal@4 7 # get-LibreOffice - install LibreOffice excl. KDE/Gnome integration & test suite.
pascal@4 8 #
pascal@4 9 # (C) 2010 SliTaz - GNU General Public License v3.
pascal@4 10 # Author : Ben Arnold <ben@seawolfsanctuary.com>
pascal@4 11 # via : get-OpenOffice3 (Eric Joseph-Alexandre <erjo@slitaz.org>)
pascal@4 12 #
pascal@4 13
pascal@4 14 PACKAGE="LibreOffice"
pascal@4 15 DEPENDS="cups"
pascal@4 16 SUGGESTED="java6-jre"
pascal@4 17 DIR="stable"
pascal@4 18 PREFIX="LibreOffice"
pascal@4 19 SUFFIX="Linux_x86_rpm.tar.gz"
pascal@4 20 WGET_URL="http://download.documentfoundation.org/libreoffice/$DIR"
pascal@4 21
pascal@4 22 VERSION="$(basename $(wget -O - $WGET_URL/ 2> /dev/null | \
pascal@4 23 sed '/href=\"[0-9]/!d;s/.*href=\"//;s/[/\">].*//' | tail -1))"
pascal@4 24 if [ -z "$VERSION" ]; then
pascal@4 25 abort_package "Can't detect an appropriate version. The version numbering or URL may have changed. Aborted."
pascal@4 26 fi
pascal@45 27 [ "$1" == "--get-version" ] && echo $VERSION && exit
pascal@4 28 VER="${VERSION/\-/}" # without hyphens
pascal@4 29
pascal@4 30
pascal@4 31 TARBALL="${PREFIX}_${VER}_${SUFFIX}"
pascal@4 32
pascal@4 33 for LOC in ${LANG/_/-} ${LANG%_*}; do
pascal@4 34 L_SUFFIX="Linux_x86_rpm_langpack_$LOC.tar.gz"
pascal@4 35 L_TARBALL="${PREFIX}_${VER}_${L_SUFFIX}"
pascal@4 36 LANG_URL="$WGET_URL/${VERSION}/rpm/x86/${L_TARBALL}"
pascal@4 37 busybox wget -s $LANG_URL 2> /dev/null || continue
pascal@4 38 echo "Added $LANG ($LOC)."
pascal@4 39 break
pascal@4 40 done
pascal@4 41 WGET_URL="$WGET_URL/${VERSION}/rpm/x86/${TARBALL}"
pascal@4 42
pascal@4 43 CUR_DIR=$(pwd)
pascal@4 44 TEMP_DIR="/tmp/$PACKAGE.$$"
pascal@4 45 SOURCE_DIR="/tmp/src.$$"
pascal@4 46 EXCLUDE="kde|gnome|test"
pascal@4 47 LOG="/tmp/$(basename $0 .sh).log"
pascal@4 48
pascal@4 49 # Check if we have the tarball before.
pascal@4 50 if [ ! -f $SOURCE_DIR/$TARBALL ]; then
pascal@4 51 echo "Downloading LibreOffice tarball (it's time to have a break)... "
pascal@4 52 # Check if $SOURCE_DIR exist
pascal@4 53 test -d $SOURCE_DIR || mkdir -p $SOURCE_DIR
pascal@4 54 # Get the file.
pascal@4 55 wget -c $WGET_URL -O $SOURCE_DIR/$TARBALL
pascal@4 56 if [ -n $L_TARBALL ] ; then # Are we localised?
pascal@4 57 wget -c $LANG_URL -O $SOURCE_DIR/$L_TARBALL
pascal@4 58 fi
pascal@4 59 status
pascal@4 60 fi
pascal@4 61 if [ ! -f $SOURCE_DIR/$TARBALL ]; then
pascal@4 62 rm -rf $SOURCE_DIR
pascal@4 63 abort_package "Could not download $TARBALL. Exiting."
pascal@4 64 fi
pascal@4 65
pascal@4 66 echo -n "Extracting files (this may take a while): "
pascal@4 67
pascal@4 68 # Creates TEMP_DIR and extract tarball
pascal@4 69 mkdir -p $TEMP_DIR
pascal@4 70 for TB in $TARBALL $L_TARBALL ; do
pascal@4 71 tar xvzf $SOURCE_DIR/$TB -C $TEMP_DIR > $LOG 2>&1 ||
pascal@4 72 abort_package "Failed to extract $TB"
pascal@4 73 done
pascal@4 74
pascal@4 75 # Get version found in archive (often directory is still RC version when final is present)
pascal@4 76 ARCHIVED_VERSION=$(find $TEMP_DIR -type d 2> /dev/null | sed "/$PREFIX/!d;\$!d;s/_/ /g" | awk '{print $2}')
pascal@4 77 echo -n "(found v${ARCHIVED_VERSION})"
pascal@4 78
pascal@4 79 # Consolidate localisations into main package
pascal@4 80 if [ -n $L_TARBALL ] ; then # Are we localised?
pascal@4 81 TARBALL_NAME="${TARBALL/.tar.gz/}"
pascal@4 82 L_TARBALL_NAME="${L_TARBALL/.tar.gz/}"
pascal@4 83 mv -f $TEMP_DIR/${L_TARBALL_NAME/$VERSION/$ARCHIVED_VERSION}/RPMS/*.rpm $TEMP_DIR/${TARBALL_NAME/$VERSION/$ARCHIVED_VERSION}/RPMS/
pascal@4 84 fi
pascal@4 85 status
pascal@4 86
pascal@4 87 # Extracted pkg can be removed: Save RAM
pascal@4 88 rm -rf $SOURCE_DIR
pascal@4 89
pascal@4 90 # Extract everything from RPMS
pascal@4 91 cd $TEMP_DIR/${TARBALL_NAME/$VERSION/$ARCHIVED_VERSION}/RPMS
pascal@4 92 for i in *.rpm
pascal@4 93 do