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

Update get-flash-plugin
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Nov 29 13:36:45 2011 +0100 (2011-11-29)
parents aef77d974511
children 05ee700100bf
rev   line source
pascal@305 1 #!/bin/sh -e
pascal@305 2
pascal@11350 3 PACKAGE="flash-plugin"
pascal@11350 4 WEB_SITE="http://www.adobe.com/products/flash/"
pascal@11350 5 SHORT_DESC="Adobe Flash Player."
pascal@1713 6 ROOT="$1"
pascal@11350 7 [ -d "$ROOT" ] || ROOT=""
pascal@1713 8
pascal@417 9 if test $(id -u) != 0 ; then
pascal@417 10 echo -e "\nYou must be root to run `basename $0`."
pascal@417 11 echo -e "Please type 'su' and root password to become super-user.\n"
pascal@417 12 exit 0
pascal@417 13 fi
pascal@417 14
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
pascal@11350 21 URL=
pascal@11350 22 for i in $(seq 11 99); do
pascal@11350 23 n="$(busybox wget -O - "http://get.adobe.com/fr/flashplayer/completion/?installer=Flash_Player_${i}_for_other_Linux_(.tar.gz)_32-bit" | \
pascal@11350 24 sed "/gz/!d;s/.* '//;s/'.*//")"
pascal@11350 25 [ -n "$n" ] && URL="$n" && continue
pascal@11350 26 break
pascal@1684 27 done
pascal@1684 28
pascal@11350 29 if [ -z "$URL" ]; then
pascal@11350 30 echo "Could not find url. Exiting."
pascal@11350 31 exit 1
pascal@11350 32 fi
pascal@11350 33
pascal@11350 34 TMP_DIR=/tmp/get-$PACKAGE-$$-$RANDOM
pascal@11350 35 CUR_DIR=$(pwd)
pascal@11350 36 mkdir -p $TMP_DIR && cd $TMP_DIR
pascal@11350 37 TARBALL="$(basename $URL)"
pascal@11350 38 busybox wget -O $TARBALL $URL
pascal@3893 39 if [ ! -f $TARBALL ]; then
pascal@3893 40 echo "Could not download $TARBALL. Exiting."
pascal@3893 41 exit 1
pascal@3893 42 fi
pascal@3893 43
pascal@11350 44 tar xzf $TARBALL
pascal@305 45
pascal@1685 46 VERSION="$(strings libflashplayer.so | grep ^LNX | sed -e 's/LNX //' -e 's/,/./g')"
pascal@305 47
pascal@305 48 # Install files
pascal@1173 49 chmod 755 libflashplayer.so
pascal@1174 50 chown root.root libflashplayer.so
slaxemulator@11325 51 dir=$PACKAGE-$VERSION/fs/usr/share/flash
pascal@1713 52 mkdir -p $dir
pascal@1713 53 mv libflashplayer.so $dir
pascal@305 54
jozee@5074 55 # Sanity Check: Reexport firefox libraries if they don't exist
slaxemulator@11325 56 dir=$PACKAGE-$VERSION/fs/usr/lib
jozee@5074 57 mkdir -p $dir
slaxemulator@11325 58 for i in /usr/lib/firefox/*.so ; do
jozee@5075 59 [ -f $i ] && [ -z "`ls /usr/lib/$(basename $i)`" ] && ln -s $i $dir
jozee@5074 60 done
jozee@5074 61
pascal@305 62 # Create pseudo package
slaxemulator@11325 63 cat > $PACKAGE-$VERSION/receipt <<EOT
slaxemulator@11325 64 PACKAGE="$PACKAGE"
pascal@305 65 VERSION="$VERSION"
pascal@305 66 CATEGORY="non-free"
pascal@11350 67 SHORT_DESC="$SHORT_DESC"
pascal@305 68 WEB_SITE="$WEB_SITE"
jozee@5039 69 DEPENDS="libfirefox curl atk cairo expat fontconfig freetype glib gtk+ libpng \
pascal@2427 70 pango pixman xorg-libICE xorg-libSM xorg-libX11 xorg-libXau xorg-libXcomposite \
pascal@2427 71 xorg-libXcursor xorg-libXdamage xorg-libXdmcp xorg-libXext xorg-libXfixes \
pascal@2427 72 xorg-libXinerama xorg-libXrandr xorg-libXrender xorg-libXt zlib"
pascal@1713 73
pascal@1713 74 post_install()
pascal@1713 75 {
pascal@1713 76 echo -n "Processing post install commands..."
slaxemulator@11325 77 if [ -d \$1/$INSTALLED/firefox ] ; then
slaxemulator@11325 78 ln -s /usr/share/flash/libflashplayer.so \$1/usr/lib/firefox/plugins
jozee@5039 79 fi
jozee@5039 80 mkdir -p \$1/usr/lib/mozilla/plugins
jozee@5039 81 ln -s /usr/share/flash/libflashplayer.so \$1/usr/lib/mozilla/plugins
pascal@1713 82 status
pascal@1713 83 }
pascal@1713 84
pascal@1713 85 post_remove()
pascal@1713 86 {
pascal@1713 87 echo -n "Processing post remove commands..."
slaxemulator@11325 88 if [ -d $INSTALLED/firefox ] ; then
slaxemulator@11325 89 rm -f /usr/lib/firefox/plugins/libflashplayer.so
jozee@5039 90 fi
jozee@5039 91 rm -f /usr/lib/mozilla/plugins/libflashplayer.so
pascal@1713 92 status
pascal@1713 93 }
pascal@305 94 EOT
pascal@1173 95
pascal@1173 96 # Pack
slaxemulator@11325 97 tazpkg pack $PACKAGE-$VERSION
pascal@305 98
pascal@305 99 # Install pseudo package
slaxemulator@11325 100 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
pascal@11350 101 case " $@ " in
pascal@11350 102 *\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;;
pascal@11350 103 esac
pascal@305 104
pascal@305 105 # Clean
pascal@11350 106 cd $CUR_DIR
pascal@11350 107 rm -rf $TMP_DIR