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