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

get-flash-plugin: Update to work with new firefox.
author Christopher Rogers <slaxemulator@gmail.com>
date Thu Nov 17 13:38:50 2011 +0000 (2011-11-17)
parents 5f75424c73c6
children 43ed4e348b0d
rev   line source
pascal@305 1 #!/bin/sh -e
pascal@1684 2 : ${DIALOG=tazdialog}
pascal@305 3
slaxemulator@11325 4 . /etc/slitaz/slitaz.conf
slaxemulator@11325 5
pascal@1713 6 ROOT="$1"
pascal@1713 7
pascal@417 8 if test $(id -u) != 0 ; then
pascal@417 9 echo -e "\nYou must be root to run `basename $0`."
pascal@417 10 echo -e "Please type 'su' and root password to become super-user.\n"
pascal@417 11 exit 0
pascal@417 12 fi
pascal@417 13
slaxemulator@11325 14 PACKAGE="flash-plugin"
slaxemulator@11325 15 if [ -d ${ROOT}${INSTALLED}/$PACKAGE ]; then
pascal@1713 16 [ -n "$ROOT" ] && exit 1
slaxemulator@11325 17 tazpkg remove $PACKAGE
slaxemulator@11325 18 [ -d $INSTALLED/$PACKAGE ] && exit 1
pascal@446 19 fi
pascal@305 20 WEB_SITE="http://www.adobe.com/products/flash/"
pascal@1684 21 URL="http://fpdownload.macromedia.com/get/flashplayer/current/"
pascal@305 22
pascal@305 23 # Download tarball
pascal@1685 24 VERSIONS=""; i=9; while true; do
pascal@9300 25 if busybox wget -s ${URL}install_flash_player_${i}_linux.tar.gz 2> /dev/null; then
pascal@1685 26 VERSIONS="$VERSIONS $i"
pascal@1713 27 [ -n "$ROOT" ] && break
pascal@1685 28 elif [ -n "$VERSIONS" ]; then
pascal@1685 29 break
pascal@1685 30 elif [ $i -gt 20 ]; then
pascal@1685 31 exit 1
pascal@1685 32 fi
pascal@1685 33 i=$(($i + 1))
pascal@1684 34 done
pascal@1684 35
pascal@1684 36 value="$(echo $VERSIONS)"
pascal@1684 37 case "$VERSIONS" in
pascal@1684 38 *[0-9]\ [1-9]*)
pascal@1684 39 exec 3>&1
pascal@1684 40 value=`$DIALOG --clear --colors --title " Install Flash plugin " \
pascal@1684 41 --menu "Which version to install" 16 70 5 \
pascal@1684 42 $(for i in $VERSIONS; do echo $i; echo "flash-$i"; done) \
pascal@1684 43 2>&1 1>&3`
pascal@1684 44 retval=$?
pascal@1684 45 exec 3>&-
pascal@1684 46 [ -n "$value" ] || exit 0
pascal@1684 47 [ "$retval" = "1" ] && exit 0
pascal@1684 48 esac
pascal@1684 49 DIR=install_flash_player_${value}_linux
pascal@1684 50 TARBALL=$DIR.tar.gz
pascal@3798 51 [ -f $TARBALL ] || wget $URL$TARBALL
pascal@3893 52 if [ ! -f $TARBALL ]; then
pascal@3893 53 echo "Could not download $TARBALL. Exiting."
pascal@3893 54 exit 1
pascal@3893 55 fi
pascal@3893 56
pascal@305 57
pascal@305 58 # Extract
pascal@3798 59 mkdir $DIR
pascal@3798 60 cd $DIR
pascal@3798 61 tar xzf ../$TARBALL
pascal@305 62
pascal@3798 63 [ -d $DIR ] && mv $DIR/* .
pascal@1685 64 VERSION="$(strings libflashplayer.so | grep ^LNX | sed -e 's/LNX //' -e 's/,/./g')"
pascal@305 65
pascal@305 66 # Install files
pascal@1173 67 chmod 755 libflashplayer.so
pascal@1174 68 chown root.root libflashplayer.so
slaxemulator@11325 69 dir=$PACKAGE-$VERSION/fs/usr/share/flash
pascal@1713 70 mkdir -p $dir
pascal@1713 71 mv libflashplayer.so $dir
pascal@305 72
jozee@5074 73 # Sanity Check: Reexport firefox libraries if they don't exist
slaxemulator@11325 74 dir=$PACKAGE-$VERSION/fs/usr/lib
jozee@5074 75 mkdir -p $dir
slaxemulator@11325 76 for i in /usr/lib/firefox/*.so ; do
jozee@5075 77 [ -f $i ] && [ -z "`ls /usr/lib/$(basename $i)`" ] && ln -s $i $dir
jozee@5074 78 done
jozee@5074 79
pascal@305 80 # Create pseudo package
slaxemulator@11325 81 cat > $PACKAGE-$VERSION/receipt <<EOT
slaxemulator@11325 82 PACKAGE="$PACKAGE"
pascal@305 83 VERSION="$VERSION"
pascal@305 84 CATEGORY="non-free"
pascal@305 85 SHORT_DESC="Adobe Flash Player."
pascal@305 86 WEB_SITE="$WEB_SITE"
jozee@5039 87 DEPENDS="libfirefox curl atk cairo expat fontconfig freetype glib gtk+ libpng \
pascal@2427 88 pango pixman xorg-libICE xorg-libSM xorg-libX11 xorg-libXau xorg-libXcomposite \
pascal@2427 89 xorg-libXcursor xorg-libXdamage xorg-libXdmcp xorg-libXext xorg-libXfixes \
pascal@2427 90 xorg-libXinerama xorg-libXrandr xorg-libXrender xorg-libXt zlib"
pascal@1713 91
pascal@1713 92 post_install()
pascal@1713 93 {
pascal@1713 94 echo -n "Processing post install commands..."
slaxemulator@11325 95 if [ -d \$1/$INSTALLED/firefox ] ; then
slaxemulator@11325 96 ln -s /usr/share/flash/libflashplayer.so \$1/usr/lib/firefox/plugins
jozee@5039 97 fi
jozee@5039 98 mkdir -p \$1/usr/lib/mozilla/plugins
jozee@5039 99 ln -s /usr/share/flash/libflashplayer.so \$1/usr/lib/mozilla/plugins
pascal@1713 100 status
pascal@1713 101 }
pascal@1713 102
pascal@1713 103 post_remove()
pascal@1713 104 {
pascal@1713 105 echo -n "Processing post remove commands..."
slaxemulator@11325 106 if [ -d $INSTALLED/firefox ] ; then
slaxemulator@11325 107 rm -f /usr/lib/firefox/plugins/libflashplayer.so
jozee@5039 108 fi
jozee@5039 109 rm -f /usr/lib/mozilla/plugins/libflashplayer.so
pascal@1713 110 status
pascal@1713 111 }
pascal@305 112 EOT
pascal@1173 113
pascal@1173 114 # Pack
slaxemulator@11325 115 tazpkg pack $PACKAGE-$VERSION
pascal@305 116
pascal@305 117 # Install pseudo package
slaxemulator@11325 118 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
pascal@305 119 cd ..
pascal@305 120
pascal@305 121 # Clean
pascal@305 122 rm -rf $DIR $TARBALL
pascal@305 123