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

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