wok annotate get-flash-plugin/stuff/get-flash-plugin @ rev 1685

get-flash-plugin: speedup & fix version
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Nov 09 23:08:30 2008 +0000 (2008-11-09)
parents c5d8d030881f
children e01dd228942a
rev   line source
pascal@305 1 #!/bin/sh -e
pascal@1684 2 : ${DIALOG=tazdialog}
pascal@305 3
pascal@417 4 if test $(id -u) != 0 ; then
pascal@417 5 echo -e "\nYou must be root to run `basename $0`."
pascal@417 6 echo -e "Please type 'su' and root password to become super-user.\n"
pascal@417 7 exit 0
pascal@417 8 fi
pascal@417 9
pascal@446 10 if [ -d /var/lib/tazpkg/installed/flash-plugin ]; then
pascal@446 11 tazpkg remove flash-plugin
pascal@446 12 [ -d /var/lib/tazpkg/installed/flash-plugin ] && exit 1
pascal@446 13 fi
pascal@305 14 WEB_SITE="http://www.adobe.com/products/flash/"
pascal@1684 15 URL="http://fpdownload.macromedia.com/get/flashplayer/current/"
pascal@305 16
pascal@305 17 # Download tarball
pascal@1685 18 VERSIONS=""; i=9; while true; do
pascal@1685 19 if wget -s ${URL}install_flash_player_${i}_linux.tar.gz 2> /dev/null; then
pascal@1685 20 VERSIONS="$VERSIONS $i"
pascal@1685 21 elif [ -n "$VERSIONS" ]; then
pascal@1685 22 break
pascal@1685 23 elif [ $i -gt 20 ]; then
pascal@1685 24 exit 1
pascal@1685 25 fi
pascal@1685 26 i=$(($i + 1))
pascal@1684 27 done
pascal@1684 28
pascal@1684 29 value="$(echo $VERSIONS)"
pascal@1684 30 case "$VERSIONS" in
pascal@1684 31 *[0-9]\ [1-9]*)
pascal@1684 32 exec 3>&1
pascal@1684 33 value=`$DIALOG --clear --colors --title " Install Flash plugin " \
pascal@1684 34 --menu "Which version to install" 16 70 5 \
pascal@1684 35 $(for i in $VERSIONS; do echo $i; echo "flash-$i"; done) \
pascal@1684 36 2>&1 1>&3`
pascal@1684 37 retval=$?
pascal@1684 38 exec 3>&-
pascal@1684 39 [ -n "$value" ] || exit 0
pascal@1684 40 [ "$retval" = "1" ] && exit 0
pascal@1684 41 esac
pascal@1684 42 DIR=install_flash_player_${value}_linux
pascal@1684 43 TARBALL=$DIR.tar.gz
pascal@1684 44 wget $URL$TARBALL
pascal@305 45
pascal@305 46 # Extract
pascal@305 47 tar xzf $TARBALL
pascal@305 48
pascal@305 49 cd $DIR
pascal@1685 50 VERSION="$(strings libflashplayer.so | grep ^LNX | sed -e 's/LNX //' -e 's/,/./g')"
pascal@305 51
pascal@305 52 # Install files
pascal@1173 53 chmod 755 libflashplayer.so
pascal@1174 54 chown root.root libflashplayer.so
pascal@1173 55 mv libflashplayer.so /usr/lib/firefox*/plugins
pascal@305 56
pascal@305 57 # Create pseudo package
pascal@1173 58 while read file; do
pascal@1173 59 dest=flash-plugin-$VERSION/fs$(dirname $file)
pascal@1173 60 [ -d $dest ] || mkdir -p $dest
pascal@1173 61 cp -a $file $dest
pascal@1173 62 done <<EOT
pascal@1173 63 $(ls /usr/lib/firefox*/plugins/libflashplayer.so)
pascal@1173 64 EOT
pascal@1173 65 cat > flash-plugin-$VERSION/receipt <<EOT
pascal@305 66 PACKAGE="flash-plugin"
pascal@305 67 VERSION="$VERSION"
pascal@305 68 CATEGORY="non-free"
pascal@305 69 SHORT_DESC="Adobe Flash Player."
pascal@305 70 WEB_SITE="$WEB_SITE"
pascal@305 71 EOT
pascal@1173 72
pascal@1173 73 # Pack
pascal@1173 74 tazpkg pack flash-plugin-$VERSION
pascal@305 75
pascal@305 76 # Install pseudo package
pascal@305 77 tazpkg install flash-plugin-$VERSION.tazpkg
pascal@305 78 cd ..
pascal@305 79
pascal@305 80 # Clean
pascal@305 81 rm -rf $DIR $TARBALL
pascal@305 82