# HG changeset patch # User Pascal Bellard # Date 1469620114 -7200 # Node ID 798e77f8326009aab4de276b456e7f7923612310 # Parent 28fb754f302c0b83748e61bc088546a9af47009e Update get-flash-plugin diff -r 28fb754f302c -r 798e77f83260 get-flash-plugin/stuff/get-flash-plugin --- a/get-flash-plugin/stuff/get-flash-plugin Wed Mar 23 09:29:51 2016 +0100 +++ b/get-flash-plugin/stuff/get-flash-plugin Wed Jul 27 13:48:34 2016 +0200 @@ -1,7 +1,7 @@ #!/bin/sh -e -[ -f /etc/slitaz/slitaz.conf ] && . /etc/slitaz/slitaz.conf -[ $INSTALLED ] || INSTALLED=/var/lib/tazpkg/installed +[ -f '/etc/slitaz/slitaz.conf' ] && . /etc/slitaz/slitaz.conf +[ -z "$INSTALLED" ] && INSTALLED='/var/lib/tazpkg/installed' PACKAGE="flash-plugin" WEB_SITE="http://www.adobe.com/products/flash/" @@ -9,63 +9,48 @@ ROOT="$1" [ -d "$ROOT" ] || ROOT="" -if test $(id -u) != 0 ; then +if [ $(id -u) -ne 0 ]; then echo -e "\nYou must be root to run `basename $0`." echo -e "Please type 'su' and root password to become super-user.\n" exit 0 fi -if [ -d ${ROOT}${INSTALLED}/$PACKAGE ]; then - [ -n "$ROOT" ] && exit 1 - tazpkg remove $PACKAGE - [ -d $INSTALLED/$PACKAGE ] && exit 1 +if [ -d $ROOT$INSTALLED/$PACKAGE ]; then + [ -n "$ROOT" ] && exit 1 + tazpkg remove $PACKAGE + [ -d $INSTALLED/$PACKAGE ] && exit 1 fi -URL= -for i in $(seq 112 999); do - 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" | \ - sed "/gz/!d;s/.* '//;s/'.*//")" - [ -n "$n" ] && URL="$n" && continue - break -done -[ -z "$URL" ] && for i in $(seq 11 99); do - n="$(busybox wget -O - "http://get.adobe.com/fr/flashplayer/completion/?installer=Flash_Player_${i}_for_other_Linux_(.tar.gz)_32-bit" | \ - sed "/gz/!d;s/.* '//;s/'.*//")" - [ -n "$n" ] && URL="$n" && continue - break -done +TARBALL="install_flash_player_11_linux.i386.tar.gz" +URL="http://fpdownload.macromedia.com/get/flashplayer/current/licensing/linux/$TARBALL" +TMP_DIR="$(mktemp -d)" +CUR_DIR=$(pwd) +cd $TMP_DIR +busybox wget -O $TARBALL $URL -if [ -z "$URL" ]; then - echo "Could not find url. Exiting." - exit 1 -fi - -TMP_DIR=/tmp/get-$PACKAGE-$$-$RANDOM -CUR_DIR=$(pwd) -mkdir -p $TMP_DIR && cd $TMP_DIR -TARBALL="$(basename $URL)" -busybox wget -O $TARBALL $URL if [ ! -f $TARBALL ]; then echo "Could not download $TARBALL. Exiting." exit 1 fi tar xzf $TARBALL - -VERSION="$(strings libflashplayer.so | grep ^LNX | sed -e 's/LNX //' -e 's/,/./g')" +VERSION="$(strings libflashplayer.so | sed '/FlashPlayer_/!d;s/.*yer_\(.*\)_Flash.*/\1/;s/_/./g')" # Install files chmod 755 libflashplayer.so chown root.root libflashplayer.so -dir=$PACKAGE-$VERSION/fs/usr/share/flash -mkdir -p $dir -mv libflashplayer.so $dir +fs=$PACKAGE-$VERSION/fs +mkdir -p $fs/usr/share/flash +mv libflashplayer.so $fs/usr/share/flash +mv usr/bin $fs/usr +mv usr/share/icons $fs/usr/share +mv usr/share/pixmaps $fs/usr/share # Sanity Check: Reexport firefox libraries if they don't exist dir=$PACKAGE-$VERSION/fs/usr/lib mkdir -p $dir for i in /usr/lib/firefox/*.so ; do - [ -f $i ] && [ -z "`ls /usr/lib/$(basename $i)`" ] && ln -s $i $dir + [ -f $i ] && [ -z "$(ls /usr/lib/$(basename $i))" ] && ln -s $i $dir done # Create pseudo package @@ -76,24 +61,25 @@ SHORT_DESC="$SHORT_DESC" WEB_SITE="$WEB_SITE" DEPENDS="libfirefox curl atk cairo expat fontconfig freetype glib gtk+ libpng \ -pango pixman xorg-libICE xorg-libSM xorg-libX11 xorg-libXau xorg-libXcomposite \ +nss pango pixman xorg-libICE xorg-libSM xorg-libX11 xorg-libXau xorg-libXcomposite \ xorg-libXcursor xorg-libXdamage xorg-libXdmcp xorg-libXext xorg-libXfixes \ xorg-libXinerama xorg-libXrandr xorg-libXrender xorg-libXt zlib" post_install() { - echo -n "Processing post install commands..." - - [ -d /usr/lib/mozilla/plugins ] || mkdir -p \$1/usr/lib/mozilla/plugins + [ -d \$1/usr/lib/mozilla/plugins ] || mkdir -p \$1/usr/lib/mozilla/plugins ln -s /usr/share/flash/libflashplayer.so \$1/usr/lib/mozilla/plugins - status + [ -d \$1/opt/google/chrome/plugins ] || mkdir -p \$1/opt/google/chrome/plugins + ln -s /usr/share/flash/libflashplayer.so \$1/opt/google/chrome/plugins/libgcflashplayer.so + [ -d \$1/usr/lib/opera/plugins ] || mkdir -p \$1/usr/lib/opera/plugins + ln -s /usr/share/flash/libflashplayer.so \$1/usr/lib/opera/plugins/libflashplayer.so } post_remove() { - echo -n "Processing post remove commands..." - rm -f /usr/lib/mozilla/plugins/libflashplayer.so - status + rm -f \$1/usr/lib/mozilla/plugins/libflashplayer.so + rm -f \$1/opt/google/chrome/plugins/libgcflashplayer.so + rm -f \$1/usr/lib/opera/plugins/libflashplayer.so } EOT @@ -108,4 +94,4 @@ # Clean cd $CUR_DIR -rm -rf $TMP_DIR +rm -rf "$TMP_DIR"