wok view get-flash-plugin/stuff/get-flash-plugin @ rev 17557

Up: tzdata (2015a)
author Aleksej Bobylev <al.bobylev@gmail.com>
date Thu Feb 05 00:36:03 2015 +0200 (2015-02-05)
parents 0c6db931437a
children 6fab3264ba87
line source
1 #!/bin/sh -e
3 [ -f /etc/slitaz/slitaz.conf ] && . /etc/slitaz/slitaz.conf
4 [ $INSTALLED ] || INSTALLED=/var/lib/tazpkg/installed
6 PACKAGE="flash-plugin"
7 WEB_SITE="http://www.adobe.com/products/flash/"
8 SHORT_DESC="Adobe Flash Player."
9 ROOT="$1"
10 [ -d "$ROOT" ] || ROOT=""
12 if test $(id -u) != 0 ; then
13 echo -e "\nYou must be root to run `basename $0`."
14 echo -e "Please type 'su' and root password to become super-user.\n"
15 exit 0
16 fi
18 if [ -d ${ROOT}${INSTALLED}/$PACKAGE ]; then
19 [ -n "$ROOT" ] && exit 1
20 tazpkg remove $PACKAGE
21 [ -d $INSTALLED/$PACKAGE ] && exit 1
22 fi
24 TARBALL="install_flash_player_11_linux.i386.tar.gz"
25 URL=http://fpdownload.macromedia.com/get/flashplayer/current/licensing/linux/$TARBALL
26 TMP_DIR=/tmp/get-$PACKAGE-$$-$RANDOM
27 CUR_DIR=$(pwd)
28 mkdir -p $TMP_DIR && cd $TMP_DIR
29 busybox wget -O $TARBALL $URL
31 if [ ! -f $TARBALL ]; then
32 echo "Could not download $TARBALL. Exiting."
33 exit 1
34 fi
36 tar xzf $TARBALL
37 VERSION="$(strings libflashplayer.so | sed '/FlashPlayer_/!d;s/.*yer_\(.*\)_Flash.*/\1/;s/_/./g')"
39 # Install files
40 chmod 755 libflashplayer.so
41 chown root.root libflashplayer.so
42 dir=$PACKAGE-$VERSION/fs
43 mkdir -p $dir/usr/share/flash
44 mv libflashplayer.so $dir/usr/share/flash
45 mv usr/bin $dir/usr
46 mv usr/share/icons $dir/usr/share
47 mv usr/share/pixmaps $dir/usr/share
49 # Sanity Check: Reexport firefox libraries if they don't exist
50 dir=$PACKAGE-$VERSION/fs/usr/lib
51 mkdir -p $dir
52 for i in /usr/lib/firefox/*.so ; do
53 [ -f $i ] && [ -z "`ls /usr/lib/$(basename $i)`" ] && ln -s $i $dir
54 done
56 # Create pseudo package
57 cat > $PACKAGE-$VERSION/receipt <<EOT
58 PACKAGE="$PACKAGE"
59 VERSION="$VERSION"
60 CATEGORY="non-free"
61 SHORT_DESC="$SHORT_DESC"
62 WEB_SITE="$WEB_SITE"
63 DEPENDS="libfirefox curl atk cairo expat fontconfig freetype glib gtk+ libpng \
64 nss pango pixman xorg-libICE xorg-libSM xorg-libX11 xorg-libXau xorg-libXcomposite \
65 xorg-libXcursor xorg-libXdamage xorg-libXdmcp xorg-libXext xorg-libXfixes \
66 xorg-libXinerama xorg-libXrandr xorg-libXrender xorg-libXt zlib"
68 post_install()
69 {
70 echo -n "Processing post install commands..."
72 [ -d \$1/usr/lib/mozilla/plugins ] || mkdir -p \$1/usr/lib/mozilla/plugins
73 ln -s /usr/share/flash/libflashplayer.so \$1/usr/lib/mozilla/plugins
74 [ -d \$1/opt/google/chrome/plugins ] || mkdir -p \$1/opt/google/chrome/plugins
75 ln -s /usr/share/flash/libflashplayer.so \$1/opt/google/chrome/plugins/libgcflashplayer.so
76 [ -d \$1/usr/lib/opera/plugins ] || mkdir -p \$1/usr/lib/opera/plugins
77 ln -s /usr/share/flash/libflashplayer.so \$1/usr/lib/opera/plugins/libflashplayer.so
78 status
79 }
81 post_remove()
82 {
83 echo -n "Processing post remove commands..."
84 rm -f \$1/usr/lib/mozilla/plugins/libflashplayer.so
85 rm -f \$1/opt/google/chrome/plugins/libgcflashplayer.so
86 rm -f \$1/usr/lib/opera/plugins/libflashplayer.so
87 status
88 }
89 EOT
91 # Pack
92 tazpkg pack $PACKAGE-$VERSION
94 # Install pseudo package
95 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
96 case " $@ " in
97 *\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;;
98 esac
100 # Clean
101 cd $CUR_DIR
102 rm -rf $TMP_DIR