wok-current rev 10921
fix get-LibreOffice
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Aug 05 21:16:43 2011 +0200 (2011-08-05) |
parents | e542ba4fbc72 |
children | 56c7b3252d19 |
files | get-LibreOffice/stuff/get-LibreOffice |
line diff
1.1 --- a/get-LibreOffice/stuff/get-LibreOffice Thu Aug 04 21:31:15 2011 +0200 1.2 +++ b/get-LibreOffice/stuff/get-LibreOffice Fri Aug 05 21:16:43 2011 +0200 1.3 @@ -11,9 +11,10 @@ 1.4 ROOT="$1" 1.5 DIR="stable" 1.6 SUFFIX="Linux_x86_install-rpm_en-US.tar.gz" 1.7 +WGET_URL="http://download.documentfoundation.org/libreoffice/$DIR" 1.8 1.9 -VERSION="$(basename $(wget -O - http://download.documentfoundation.org/libreoffice/$DIR/ \ 1.10 - 2> /dev/null | grep href=\"[0-9] | tail -1 | sed 's/.*href=\"//;s/[/\">].*//'))" 1.11 +VERSION="$(basename $(wget -O - $WGET_URL/ 2> /dev/null | \ 1.12 + sed '/href=\"[0-9]/!d;s/.*href=\"//;s/[/\">].*//' | tail -1))" 1.13 if [ -z "$VERSION" ]; then 1.14 echo "Can't detect an appropriate version. The version numbering or URL may have changed. Aborted." 1.15 exit 0 1.16 @@ -22,24 +23,18 @@ 1.17 1.18 1.19 TARBALL="LibO_${VER}_${SUFFIX}" 1.20 -WGET_URL="http://download.documentfoundation.org/libreoffice/${DIR}/${VERSION}/rpm/x86/${TARBALL}" 1.21 1.22 -case "$LANG" in 1.23 -fr_FR|de_DE|es_ES|it_IT|ru_RU) 1.24 - LOC=${LANG%_*} # strip 1.25 +for LOC in ${LANG/_/-} ${LANG%_*}; do 1.26 L_SUFFIX="Linux_x86_langpack-rpm_$LOC.tar.gz" 1.27 L_TARBALL="LibO_${VER}_${L_SUFFIX}" 1.28 - LANG_URL="http://download.documentfoundation.org/libreoffice/${DIR}/${VERSION}/rpm/x86/${L_TARBALL}" 1.29 - echo "Added $LANG ($LOC)." ;; 1.30 -en_GB|pt_BR) 1.31 - LANG=${LANG/_/-} # convert 1.32 - L_SUFFIX="Linux_x86_langpack-rpm_$LANG.tar.gz" 1.33 - L_TARBALL="LibO_${VER}_${L_SUFFIX}" 1.34 - LANG_URL="http://download.documentfoundation.org/libreoffice/${DIR}/${VERSION}/rpm/x86/${L_TARBALL}" 1.35 - echo "Added $LANG." ;; 1.36 -esac 1.37 + LANG_URL="$WGET_URL/${VERSION}/rpm/x86/${L_TARBALL}" 1.38 + busybox wget -s $LANG_URL 2> /dev/null || continue 1.39 + echo "Added $LANG ($LOC)." 1.40 + break 1.41 +done 1.42 +WGET_URL="$WGET_URL/${VERSION}/rpm/x86/${TARBALL}" 1.43 1.44 - 1.45 +CUR_DIR=$(pwd) 1.46 TEMP_DIR="/tmp/$PACKAGE.$$" 1.47 SOURCE_DIR="/tmp/src.$$" 1.48 EXCLUDE="kde|gnome|test" 1.49 @@ -169,7 +164,14 @@ 1.50 mv usr/bin $PACKAGE-$VERSION/fs/usr 1.51 1.52 # relocalized libexec directory 1.53 -sed -i 's#/opt/#/usr/lib/libreoffice/#' $PACKAGE-$VERSION/fs/usr/bin/libreoffice* 1.54 +bin=$(ls $PACKAGE-$VERSION/fs/usr/bin/libreoffice???) 1.55 +if [ -L $bin ]; then 1.56 + target=$(readlink $bin) 1.57 + rm -f $bin 1.58 + ln -s ${target/opt/usr\/lib\/libreoffice} $bin 1.59 +else 1.60 + sed -i 's#/opt/#/usr/lib/libreoffice/#' $bin 1.61 +fi 1.62 1.63 # Create receipt 1.64 cat > $PACKAGE-$VERSION/receipt <<EOT 1.65 @@ -179,22 +181,23 @@ 1.66 VERSION="$VERSION" 1.67 CATEGORY="office" 1.68 SHORT_DESC="Productivity suite." 1.69 -DEPENDS="" 1.70 +DEPENDS="java6-jre" 1.71 WEB_SITE="$URL" 1.72 1.73 post_install() 1.74 { 1.75 cd /usr/share/applications 1.76 - ln -s /usr/lib/libreoffice/share/xdg/base.desktop libreoffice-base.desktop 1.77 - ln -s /usr/lib/libreoffice/share/xdg/impress.desktop libreoffice-impress.desktop 1.78 - ln -s /usr/lib/libreoffice/share/xdg/writer.desktop libreoffice-writer.desktop 1.79 - ln -s /usr/lib/libreoffice/share/xdg/calc.desktop libreoffice-calc.desktop 1.80 - ln -s /usr/lib/libreoffice/share/xdg/math.desktop libreoffice-math.desktop 1.81 - ln -s /usr/lib/libreoffice/share/xdg/draw.desktop libreoffice-draw.desktop 1.82 - ln -s /usr/lib/libreoffice/share/xdg/printeradmin.desktop libreoffice-printeradmin.desktop 1.83 + ln -s /usr/lib/libreoffice?*/share/xdg/base.desktop libreoffice-base.desktop 1.84 + ln -s /usr/lib/libreoffice?*/share/xdg/impress.desktop libreoffice-impress.desktop 1.85 + ln -s /usr/lib/libreoffice?*/share/xdg/writer.desktop libreoffice-writer.desktop 1.86 + ln -s /usr/lib/libreoffice?*/share/xdg/calc.desktop libreoffice-calc.desktop 1.87 + ln -s /usr/lib/libreoffice?*/share/xdg/math.desktop libreoffice-math.desktop 1.88 + ln -s /usr/lib/libreoffice?*/share/xdg/draw.desktop libreoffice-draw.desktop 1.89 + ln -s /usr/lib/libreoffice?*/share/xdg/printeradmin.desktop libreoffice-printeradmin.desktop 1.90 + chmod +x /usr/lib/libreoffice?*/share/xdg/*.desktop 1.91 1.92 cd /usr/bin 1.93 - ln -s /usr/lib/libreoffice /usr/lib/libreoffice/libreoffice 1.94 + ln -s /usr/lib/libreoffice?* /usr/lib/libreoffice 1.95 ln -sf /usr/lib/libreoffice/program/soffice 1.96 } 1.97 1.98 @@ -214,6 +217,10 @@ 1.99 1.100 # Install pseudo package 1.101 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT 1.102 +case " $@ " in 1.103 +*\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;; 1.104 +esac 1.105 1.106 # Clean 1.107 +cd $CUR_DIR 1.108 rm -rf $TEMP_DIR