# HG changeset patch # User Pascal Bellard # Date 1234259198 0 # Node ID a373634791a5c5177fd29430974357cdd341ebec # Parent 792a1b3ccf5568e45044625acbd41384c215b687 get-OpenOffice3: no hardcoded version diff -r 792a1b3ccf55 -r a373634791a5 get-OpenOffice3/stuff/get-OpenOffice3 --- a/get-OpenOffice3/stuff/get-OpenOffice3 Mon Feb 09 23:07:37 2009 +0000 +++ b/get-OpenOffice3/stuff/get-OpenOffice3 Tue Feb 10 09:46:38 2009 +0000 @@ -10,13 +10,33 @@ URL="http://www.openoffice.org" ROOT="$1" -if [ "$LANG" = "fr_FR" ]; then - TARBALL="OOo_${VERSION}_LinuxIntel_install_fr.tar.gz" - WGET_URL="ftp://ftp.proxad.net/mirrors/ftp.openoffice.org/localized/fr/${VERSION}/${TARBALL}" -else - TARBALL="OOo_${VERSION}_LinuxIntel_install_en-US.tar.gz" - WGET_URL="ftp://ftp.proxad.net/mirrors/ftp.openoffice.org/stable/${VERSION}/${TARBALL}" -fi +case "$LANG" in +fr_FR) + WGET_URL="ftp://ftp.proxad.net/mirrors/ftp.openoffice.org/localized/fr" + VERSION_URL="http://openofficeorg.secsup.org/localized/fr/" + SUFFIX="LinuxIntel_install_fr.tar.gz";; +de_DE) + WGET_URL="ftp://ftp.proxad.net/mirrors/ftp.openoffice.org/localized/de" + VERSION_URL="http://openofficeorg.secsup.org/localized/de/" + SUFFIX="LinuxIntel_install_de.tar.gz";; +es_ES) + WGET_URL="ftp://ftp.proxad.net/mirrors/ftp.openoffice.org/localized/es" + VERSION_URL="http://openofficeorg.secsup.org/localized/es/" + SUFFIX="LinuxIntel_install_es.tar.gz";; +*) + WGET_URL="ftp://ftp.proxad.net/mirrors/ftp.openoffice.org/stable" + VERSION_URL="http://openofficeorg.secsup.org/stable/" + SUFFIX="LinuxIntel_install_en-US.tar.gz";; +esac + +VERSION="$(basename $(wget -O - $VERSION_URL 2> /dev/null | grep href | \ + tail -1 | sed 's/.*href=\"\(.*\)\".*/\1/'))" +if [ -z "$VERSION" ]; then + echo "Can't find VERSION. Abort." + exit 0 +fi +TARBALL="OOo_${VERSION}_${SUFFIX}" +WGET_URL=$WGET_URL/$VERSION/$TARBALL TEMP_DIR="/home/slitaz/build/$PACKAGE.$$" SOURCE_DIR="/home/slitaz/src" @@ -86,9 +106,7 @@ status fi - - -# Creates TEM_DIR and extract tarball +# Creates TEMP_DIR and extract tarball mkdir -p $TEMP_DIR echo -n "Extract files from archive..." tar xvzf $SOURCE_DIR/$TARBALL -C $TEMP_DIR > $LOG 2>&1 || \