get-scripts annotate openoffice3 @ rev 40

list CATEGORY, VERSION, LICENSE
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun May 03 11:24:38 2015 +0200 (2015-05-03)
parents 1b30389a08fc
children 5d357cb2f906
rev   line source
pascal@34 1 SHORT_DESC="Productivity suite."
pascal@34 2 WEB_SITE="http://www.openoffice.org"
pascal@40 3 CATEGORY="office"
pascal@40 4 LICENSE="Apache"
pascal@34 5 # end of get.list data
pascal@4 6 #!/bin/sh
pascal@4 7 # get-OpenOffice3, install everything for OpenOffice.org exept KDE/Gnome integration and testsuite.
pascal@4 8 #
pascal@4 9 # (C) 2008 SliTaz - GNU General Public License v3.
pascal@4 10 #
pascal@4 11 # Author : Eric Joseph-Alexandre <erjo@slitaz.org>
pascal@4 12
pascal@4 13 PACKAGE="OpenOffice3"
pascal@4 14 PATTERN="Linux_x86_install-rpm"
pascal@4 15
pascal@4 16 for MIRROR in \
pascal@4 17 http://mirror.switch.ch/ftp/mirror/OpenOffice \
pascal@4 18 http://openoffice.cict.fr \
pascal@4 19 http://wwwftp.ciril.fr/pub/openoffice \
pascal@4 20 http://artfiles.org/openoffice.org \
pascal@4 21 http://vesta.informatik.rwth-aachen.de/ftp/pub/mirror/OpenOffice \
pascal@4 22 http://ftp.ntua.gr/pub/OpenOffice \
pascal@4 23 http://ftp.iitm.ac.in/openoffice \
pascal@4 24 http://www.ring.gr.jp/archives/misc/openoffice \
pascal@4 25 http://ftp.nluug.nl/pub/office/openoffice \
pascal@4 26
pascal@4 27 do
pascal@4 28 wget -O - $MIRROR/ 2> /dev/null | grep -q localized || continue
pascal@4 29 DIR="stable"
pascal@4 30 LOC=$(wget -O - $MIRROR/localized/ 2> /dev/null | \
pascal@4 31 grep -E ">$LANG/|>${LANG/_/-}/|>${LANG%_*}/" | \
pascal@4 32 head -1 | sed 's/.*href=\"\(.*\)\/\".*/\1/')
pascal@4 33 [ -n "$LOC" ] && DIR="localized/$LOC"
pascal@4 34 VERSION="$(basename $(wget -O - $MIRROR/$DIR/ 2> /dev/null | grep \
pascal@4 35 href=\"[0-9] | tail -1 | sed 's/.*href=\"\(.*\)\".*/\1/') 2> /dev/null)"
pascal@4 36 [ -n "$VERSION" ] && break
pascal@4 37 done
pascal@4 38
pascal@4 39 if [ -z "$VERSION" ]; then
pascal@4 40 abort_package "Can't find VERSION. Abort."
pascal@4 41 fi
pascal@4 42 echo "Selecting $DIR version $VERSION ..."
pascal@4 43 TARBALL="$(wget -O - $MIRROR/$DIR/$VERSION/ \
pascal@4 44 2> /dev/null | grep $PATTERN | tail -1 | sed 's/.*href=\"\(.*\)\".*/\1/')"
pascal@4 45 echo "Archive is $TARBALL ..."
pascal@4 46 WGET_URL=$MIRROR/$DIR/$VERSION/$TARBALL
pascal@4 47
pascal@4 48 TEMP_DIR="/tmp/$PACKAGE.$$"
pascal@4 49 CUR_DIR=$(pwd)
pascal@4 50 SOURCE_DIR="/tmp/src.$$"
pascal@4 51 EXCLUDE="kde|gnome|test"
pascal@4 52 LOG="/tmp/$(basename $0 .sh).log"
pascal@4 53
pascal@4 54 # Check if we have the tarball before.
pascal@4 55 if [ ! -f $SOURCE_DIR/$TARBALL ]; then
pascal@4 56 echo "Downloading OppenOffice.org tarball (it's time to have a break)... "
pascal@4 57 #Check if $SOURCE_DIR exist
pascal@4 58 test -d $SOURCE_DIR || mkdir -p $SOURCE_DIR
pascal@4 59 # Get the file.
pascal@4 60 wget -c $WGET_URL -O $SOURCE_DIR/$TARBALL
pascal@4 61 status
pascal@4 62 fi
pascal@4 63 if [ ! -f $SOURCE_DIR/$TARBALL ]; then
pascal@4 64 rm -rf $SOURCE_DIR
pascal@4 65 abort_package "Could not download $TARBALL. Exiting."
pascal@4 66 fi
pascal@4 67
pascal@4 68 # Creates TEMP_DIR and extract tarball
pascal@4 69 mkdir -p $TEMP_DIR
pascal@4 70 echo -n "Extract files from archive..."
pascal@4 71 tar xvzf $SOURCE_DIR/$TARBALL -C $TEMP_DIR > $LOG 2>&1 ||
pascal@4 72 abort_package "Failed to extract $TARBALL"
pascal@4 73 status
pascal@4 74
pascal@4 75 # extracted pkg can be removed: Save RAM
pascal@4 76 rm -rf $SOURCE_DIR
pascal@4 77
pascal@4 78 cd $TEMP_DIR/*/RPMS
pascal@4 79
pascal@4 80 # Extract everything from RPMS
pascal@4 81 for i in *.rpm
pascal@4 82 do
pascal@4 83 if (! echo $i | egrep -qi $EXCLUDE); then
pascal@4 84 (rpm2cpio $i | cpio -id >> $LOG 2>&1 ) && rm -f $i
pascal@4 85 fi
pascal@4 86 done
pascal@4 87 rpm2cpio desktop-integration/*freedesktop*.rpm | cpio -id >> $LOG 2>&1
pascal@4 88
pascal@4 89 # extracted pkg can be removed: Save RAM
pascal@4 90 rm -f desktop-integration/*freedesktop*.rpm
pascal@4 91
pascal@4 92
pascal@4 93 # Make the package