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

Add pulseaudio
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Aug 12 13:55:28 2014 +0200 (2014-08-12)
parents 6f23be282ae6
children 6f9c3a54a7eb
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 VERSION=11.2.202.350
26 URL=http://fpdownload.macromedia.com/get/flashplayer/pdc/$VERSION/install_flash_player_11_linux.i386.tar.gz
27 TMP_DIR=/tmp/get-$PACKAGE-$$-$RANDOM
28 CUR_DIR=$(pwd)
29 mkdir -p $TMP_DIR && cd $TMP_DIR
30 TARBALL="install_flash_player_11_linux.i386.tar.gz"
31 busybox wget -O $TARBALL $URL
33 if [ ! -f $TARBALL ]; then
34 echo "Could not download $TARBALL. Exiting."
35 exit 1
36 fi
38 tar xzf $TARBALL
40 # Install files
41 chmod 755 libflashplayer.so
42 chown root.root libflashplayer.so
43 dir=$PACKAGE-$VERSION/fs
44 mkdir -p $dir/usr/share/flash
45 mv libflashplayer.so $dir/usr/share/flash
46 mv usr/bin $dir/usr
47 mv usr/share/icons $dir/usr/share
48 mv usr/share/pixmaps $dir/usr/share
50 # Sanity Check: Reexport firefox libraries if they don't exist
51 dir=$PACKAGE-$VERSION/fs/usr/lib
52 mkdir -p $dir
53 for i in /usr/lib/firefox/*.so ; do
54 [ -f $i ] && [ -z "`ls /usr/lib/$(basename $i)`" ] && ln -s $i $dir
55 done
57 # Create pseudo package
58 cat > $PACKAGE-$VERSION/receipt <<EOT
59 PACKAGE="$PACKAGE"
60 VERSION="$VERSION"
61 CATEGORY="non-free"
62 SHORT_DESC="$SHORT_DESC"
63 WEB_SITE="$WEB_SITE"
64 DEPENDS="libfirefox curl atk cairo expat fontconfig freetype glib gtk+ libpng \
65 nss pango pixman xorg-libICE xorg-libSM xorg-libX11 xorg-libXau xorg-libXcomposite \
66 xorg-libXcursor xorg-libXdamage xorg-libXdmcp xorg-libXext xorg-libXfixes \
67 xorg-libXinerama xorg-libXrandr xorg-libXrender xorg-libXt zlib"
69 post_install()
70 {
71 echo -n "Processing post install commands..."
73 [ -d \$1/usr/lib/mozilla/plugins ] || mkdir -p \$1/usr/lib/mozilla/plugins
74 ln -s /usr/share/flash/libflashplayer.so \$1/usr/lib/mozilla/plugins
75 [ -d \$1/opt/google/chrome/plugins ] || mkdir -p \$1/opt/google/chrome/plugins
76 ln -s /usr/share/flash/libflashplayer.so \$1/opt/google/chrome/plugins/libgcflashplayer.so
77 [ -d \$1/usr/lib/opera/plugins ] || mkdir -p \$1/usr/lib/opera/plugins
78 ln -s /usr/share/flash/libflashplayer.so \$1/usr/lib/opera/plugins/libflashplayer.so
79 status
80 }
82 post_remove()
83 {
84 echo -n "Processing post remove commands..."
85 rm -f \$1/usr/lib/mozilla/plugins/libflashplayer.so
86 rm -f \$1/opt/google/chrome/plugins/libgcflashplayer.so
87 rm -f \$1/usr/lib/opera/plugins/libflashplayer.so
88 status
89 }
90 EOT
92 # Pack
93 tazpkg pack $PACKAGE-$VERSION
95 # Install pseudo package
96 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
97 case " $@ " in
98 *\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;;
99 esac
101 # Clean
102 cd $CUR_DIR
103 rm -rf $TMP_DIR