wok rev 2203

get-OpenOffice3: no hardcoded version
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Feb 10 09:46:38 2009 +0000 (2009-02-10)
parents 792a1b3ccf55
children cf69f6384a8d
files get-OpenOffice3/stuff/get-OpenOffice3
line diff
     1.1 --- a/get-OpenOffice3/stuff/get-OpenOffice3	Mon Feb 09 23:07:37 2009 +0000
     1.2 +++ b/get-OpenOffice3/stuff/get-OpenOffice3	Tue Feb 10 09:46:38 2009 +0000
     1.3 @@ -10,13 +10,33 @@
     1.4  URL="http://www.openoffice.org"
     1.5  ROOT="$1"
     1.6  
     1.7 -if [ "$LANG" = "fr_FR" ]; then
     1.8 -	TARBALL="OOo_${VERSION}_LinuxIntel_install_fr.tar.gz"
     1.9 -	WGET_URL="ftp://ftp.proxad.net/mirrors/ftp.openoffice.org/localized/fr/${VERSION}/${TARBALL}"
    1.10 -else
    1.11 -	TARBALL="OOo_${VERSION}_LinuxIntel_install_en-US.tar.gz"
    1.12 -	WGET_URL="ftp://ftp.proxad.net/mirrors/ftp.openoffice.org/stable/${VERSION}/${TARBALL}"
    1.13 -fi 
    1.14 +case "$LANG" in
    1.15 +fr_FR)
    1.16 +	WGET_URL="ftp://ftp.proxad.net/mirrors/ftp.openoffice.org/localized/fr"
    1.17 +	VERSION_URL="http://openofficeorg.secsup.org/localized/fr/"
    1.18 +	SUFFIX="LinuxIntel_install_fr.tar.gz";;
    1.19 +de_DE)
    1.20 +	WGET_URL="ftp://ftp.proxad.net/mirrors/ftp.openoffice.org/localized/de"
    1.21 +	VERSION_URL="http://openofficeorg.secsup.org/localized/de/"
    1.22 +	SUFFIX="LinuxIntel_install_de.tar.gz";;
    1.23 +es_ES)
    1.24 +	WGET_URL="ftp://ftp.proxad.net/mirrors/ftp.openoffice.org/localized/es"
    1.25 +	VERSION_URL="http://openofficeorg.secsup.org/localized/es/"
    1.26 +	SUFFIX="LinuxIntel_install_es.tar.gz";;
    1.27 +*)
    1.28 +	WGET_URL="ftp://ftp.proxad.net/mirrors/ftp.openoffice.org/stable"
    1.29 +	VERSION_URL="http://openofficeorg.secsup.org/stable/"
    1.30 +	SUFFIX="LinuxIntel_install_en-US.tar.gz";;
    1.31 +esac
    1.32 +
    1.33 +VERSION="$(basename $(wget -O - $VERSION_URL 2> /dev/null | grep href | \
    1.34 +	    tail -1 | sed 's/.*href=\"\(.*\)\".*/\1/'))"
    1.35 +if [ -z "$VERSION" ]; then
    1.36 +	echo "Can't find VERSION. Abort."
    1.37 +	exit 0
    1.38 +fi
    1.39 +TARBALL="OOo_${VERSION}_${SUFFIX}"
    1.40 +WGET_URL=$WGET_URL/$VERSION/$TARBALL
    1.41  
    1.42  TEMP_DIR="/home/slitaz/build/$PACKAGE.$$"
    1.43  SOURCE_DIR="/home/slitaz/src"
    1.44 @@ -86,9 +106,7 @@
    1.45  	status
    1.46  fi
    1.47  
    1.48 -
    1.49 -
    1.50 -# Creates TEM_DIR and extract tarball
    1.51 +# Creates TEMP_DIR and extract tarball
    1.52  mkdir -p $TEMP_DIR
    1.53  echo -n "Extract files from archive..."
    1.54  tar xvzf $SOURCE_DIR/$TARBALL -C $TEMP_DIR > $LOG 2>&1 || \