wok-stable rev 12456

Update get-flash-plugin
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Jul 27 13:48:34 2016 +0200 (2016-07-27)
parents 28fb754f302c
children d4e29f7d8c7c
files get-flash-plugin/stuff/get-flash-plugin
line diff
     1.1 --- a/get-flash-plugin/stuff/get-flash-plugin	Wed Mar 23 09:29:51 2016 +0100
     1.2 +++ b/get-flash-plugin/stuff/get-flash-plugin	Wed Jul 27 13:48:34 2016 +0200
     1.3 @@ -1,7 +1,7 @@
     1.4  #!/bin/sh -e
     1.5  
     1.6 -[ -f /etc/slitaz/slitaz.conf ] && . /etc/slitaz/slitaz.conf
     1.7 -[ $INSTALLED ] || INSTALLED=/var/lib/tazpkg/installed
     1.8 +[ -f '/etc/slitaz/slitaz.conf' ] && . /etc/slitaz/slitaz.conf
     1.9 +[ -z "$INSTALLED" ] && INSTALLED='/var/lib/tazpkg/installed'
    1.10  
    1.11  PACKAGE="flash-plugin"
    1.12  WEB_SITE="http://www.adobe.com/products/flash/"
    1.13 @@ -9,63 +9,48 @@
    1.14  ROOT="$1"
    1.15  [ -d "$ROOT" ] || ROOT=""
    1.16  
    1.17 -if test $(id -u) != 0 ; then
    1.18 +if [ $(id -u) -ne 0 ]; then
    1.19  	echo -e "\nYou must be root to run `basename $0`."
    1.20  	echo -e "Please type 'su' and root password to become super-user.\n"
    1.21  	exit 0
    1.22  fi
    1.23  
    1.24 -if [ -d ${ROOT}${INSTALLED}/$PACKAGE ]; then
    1.25 -  [ -n "$ROOT" ] && exit 1
    1.26 -  tazpkg remove $PACKAGE
    1.27 -  [ -d $INSTALLED/$PACKAGE ] && exit 1
    1.28 +if [ -d $ROOT$INSTALLED/$PACKAGE ]; then
    1.29 +	[ -n "$ROOT" ] && exit 1
    1.30 +	tazpkg remove $PACKAGE
    1.31 +	[ -d $INSTALLED/$PACKAGE ] && exit 1
    1.32  fi
    1.33  
    1.34 -URL=
    1.35 -for i in $(seq 112 999); do
    1.36 -	n="$(busybox wget -O - "http://get.adobe.com/fr/flashplayer/completion/?installer=Flash_Player_${i:0:2}.${i:2:1}_for_other_Linux_(.tar.gz)_32-bit" | \
    1.37 -	     sed "/gz/!d;s/.* '//;s/'.*//")"
    1.38 -	[ -n "$n" ] && URL="$n" && continue
    1.39 -	break
    1.40 -done
    1.41 -[ -z "$URL" ] && for i in $(seq 11 99); do
    1.42 -	n="$(busybox wget -O - "http://get.adobe.com/fr/flashplayer/completion/?installer=Flash_Player_${i}_for_other_Linux_(.tar.gz)_32-bit" | \
    1.43 -	     sed "/gz/!d;s/.* '//;s/'.*//")"
    1.44 -	[ -n "$n" ] && URL="$n" && continue
    1.45 -	break
    1.46 -done
    1.47 +TARBALL="install_flash_player_11_linux.i386.tar.gz"
    1.48 +URL="http://fpdownload.macromedia.com/get/flashplayer/current/licensing/linux/$TARBALL"
    1.49 +TMP_DIR="$(mktemp -d)"
    1.50 +CUR_DIR=$(pwd)
    1.51 +cd $TMP_DIR
    1.52 +busybox wget -O $TARBALL $URL
    1.53  
    1.54 -if [ -z "$URL" ]; then
    1.55 -	echo "Could not find url. Exiting."
    1.56 -	exit 1
    1.57 -fi
    1.58 -
    1.59 -TMP_DIR=/tmp/get-$PACKAGE-$$-$RANDOM
    1.60 -CUR_DIR=$(pwd)
    1.61 -mkdir -p $TMP_DIR && cd $TMP_DIR
    1.62 -TARBALL="$(basename $URL)"
    1.63 -busybox wget -O $TARBALL $URL
    1.64  if [ ! -f $TARBALL ]; then
    1.65  	echo "Could not download $TARBALL. Exiting."
    1.66  	exit 1
    1.67  fi
    1.68  
    1.69  tar xzf $TARBALL
    1.70 -
    1.71 -VERSION="$(strings libflashplayer.so | grep ^LNX | sed -e 's/LNX //' -e 's/,/./g')"
    1.72 +VERSION="$(strings libflashplayer.so | sed '/FlashPlayer_/!d;s/.*yer_\(.*\)_Flash.*/\1/;s/_/./g')"
    1.73  
    1.74  # Install files
    1.75  chmod 755 libflashplayer.so
    1.76  chown root.root libflashplayer.so
    1.77 -dir=$PACKAGE-$VERSION/fs/usr/share/flash
    1.78 -mkdir -p $dir
    1.79 -mv libflashplayer.so $dir
    1.80 +fs=$PACKAGE-$VERSION/fs
    1.81 +mkdir -p $fs/usr/share/flash
    1.82 +mv libflashplayer.so $fs/usr/share/flash
    1.83 +mv usr/bin $fs/usr
    1.84 +mv usr/share/icons $fs/usr/share
    1.85 +mv usr/share/pixmaps $fs/usr/share
    1.86  
    1.87  # Sanity Check: Reexport firefox libraries if they don't exist
    1.88  dir=$PACKAGE-$VERSION/fs/usr/lib
    1.89  mkdir -p $dir
    1.90  for i in /usr/lib/firefox/*.so ; do
    1.91 -  	[ -f $i ] && [ -z "`ls /usr/lib/$(basename $i)`" ] && ln -s $i $dir	
    1.92 +	[ -f $i ] && [ -z "$(ls /usr/lib/$(basename $i))" ] && ln -s $i $dir
    1.93  done
    1.94  
    1.95  # Create pseudo package
    1.96 @@ -76,24 +61,25 @@
    1.97  SHORT_DESC="$SHORT_DESC"
    1.98  WEB_SITE="$WEB_SITE"
    1.99  DEPENDS="libfirefox curl atk cairo expat fontconfig freetype glib gtk+ libpng \
   1.100 -pango pixman xorg-libICE xorg-libSM xorg-libX11 xorg-libXau xorg-libXcomposite \
   1.101 +nss pango pixman xorg-libICE xorg-libSM xorg-libX11 xorg-libXau xorg-libXcomposite \
   1.102  xorg-libXcursor xorg-libXdamage xorg-libXdmcp xorg-libXext xorg-libXfixes \
   1.103  xorg-libXinerama xorg-libXrandr xorg-libXrender xorg-libXt zlib"
   1.104  
   1.105  post_install()
   1.106  {
   1.107 -	echo -n "Processing post install commands..."
   1.108 - 
   1.109 -	[ -d /usr/lib/mozilla/plugins ] || mkdir -p \$1/usr/lib/mozilla/plugins
   1.110 +	[ -d \$1/usr/lib/mozilla/plugins ] || mkdir -p \$1/usr/lib/mozilla/plugins
   1.111  	ln -s /usr/share/flash/libflashplayer.so \$1/usr/lib/mozilla/plugins
   1.112 -	status
   1.113 +	[ -d \$1/opt/google/chrome/plugins ] || mkdir -p \$1/opt/google/chrome/plugins
   1.114 +	ln -s /usr/share/flash/libflashplayer.so \$1/opt/google/chrome/plugins/libgcflashplayer.so
   1.115 +	[ -d \$1/usr/lib/opera/plugins ] || mkdir -p \$1/usr/lib/opera/plugins
   1.116 +	ln -s /usr/share/flash/libflashplayer.so \$1/usr/lib/opera/plugins/libflashplayer.so
   1.117  }
   1.118  
   1.119  post_remove()
   1.120  {
   1.121 -	echo -n "Processing post remove commands..."
   1.122 -	rm -f /usr/lib/mozilla/plugins/libflashplayer.so
   1.123 -	status
   1.124 +	rm -f \$1/usr/lib/mozilla/plugins/libflashplayer.so
   1.125 +	rm -f \$1/opt/google/chrome/plugins/libgcflashplayer.so
   1.126 +	rm -f \$1/usr/lib/opera/plugins/libflashplayer.so
   1.127  }
   1.128  EOT
   1.129  
   1.130 @@ -108,4 +94,4 @@
   1.131  
   1.132  # Clean
   1.133  cd $CUR_DIR
   1.134 -rm -rf $TMP_DIR
   1.135 +rm -rf "$TMP_DIR"