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

Up: testdisk (6.14)
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Tue Oct 09 16:11:30 2012 +0200 (2012-10-09)
parents b8d05cb39bd5
children 4f73469d334e
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 URL=
25 for i in $(seq 112 999); do
26 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" | \
27 sed "/gz/!d;s/.* '//;s/'.*//")"
28 [ -n "$n" ] && URL="$n" && continue
29 break
30 done
31 [ -z "$URL" ] && for i in $(seq 11 99); do
32 n="$(busybox wget -O - "http://get.adobe.com/fr/flashplayer/completion/?installer=Flash_Player_${i}_for_other_Linux_(.tar.gz)_32-bit" | \
33 sed "/gz/!d;s/.* '//;s/'.*//")"
34 [ -n "$n" ] && URL="$n" && continue
35 break
36 done
38 if [ -z "$URL" ]; then
39 echo "Could not find url. Exiting."
40 exit 1
41 fi
43 TMP_DIR=/tmp/get-$PACKAGE-$$-$RANDOM
44 CUR_DIR=$(pwd)
45 mkdir -p $TMP_DIR && cd $TMP_DIR
46 TARBALL="$(basename $URL)"
47 busybox wget -O $TARBALL $URL
48 if [ ! -f $TARBALL ]; then
49 echo "Could not download $TARBALL. Exiting."
50 exit 1
51 fi
53 tar xzf $TARBALL
55 VERSION="$(strings libflashplayer.so | grep ^LNX | sed -e 's/LNX //' -e 's/,/./g')"
57 # Install files
58 chmod 755 libflashplayer.so
59 chown root.root libflashplayer.so
60 dir=$PACKAGE-$VERSION/fs/usr/share/flash
61 mkdir -p $dir
62 mv libflashplayer.so $dir
64 # Sanity Check: Reexport firefox libraries if they don't exist
65 dir=$PACKAGE-$VERSION/fs/usr/lib
66 mkdir -p $dir
67 for i in /usr/lib/firefox/*.so ; do
68 [ -f $i ] && [ -z "`ls /usr/lib/$(basename $i)`" ] && ln -s $i $dir
69 done
71 # Create pseudo package
72 cat > $PACKAGE-$VERSION/receipt <<EOT
73 PACKAGE="$PACKAGE"
74 VERSION="$VERSION"
75 CATEGORY="non-free"
76 SHORT_DESC="$SHORT_DESC"
77 WEB_SITE="$WEB_SITE"
78 DEPENDS="libfirefox curl atk cairo expat fontconfig freetype glib gtk+ libpng \
79 pango pixman xorg-libICE xorg-libSM xorg-libX11 xorg-libXau xorg-libXcomposite \
80 xorg-libXcursor xorg-libXdamage xorg-libXdmcp xorg-libXext xorg-libXfixes \
81 xorg-libXinerama xorg-libXrandr xorg-libXrender xorg-libXt zlib"
83 post_install()
84 {
85 echo -n "Processing post install commands..."
87 [ -d \$1/usr/lib/mozilla/plugins ] || mkdir -p \$1/usr/lib/mozilla/plugins
88 ln -s /usr/share/flash/libflashplayer.so \$1/usr/lib/mozilla/plugins
89 [ -d \$1/opt/google/chrome/plugins ] || mkdir -p \$1/opt/google/chrome/plugins
90 ln -s /usr/share/flash/libflashplayer.so \$1/opt/google/chrome/plugins/libgcflashplayer.so
91 [ -d \$1/usr/lib/opera/plugins ] || mkdir -p \$1/usr/lib/opera/plugins
92 ln -s /usr/share/flash/libflashplayer.so \$1/usr/lib/opera/plugins/libflashplayer.so
93 status
94 }
96 post_remove()
97 {
98 echo -n "Processing post remove commands..."
99 rm -f \$1/usr/lib/mozilla/plugins/libflashplayer.so
100 rm -f \$1/opt/google/chrome/plugins/libgcflashplayer.so
101 rm -f \$1/usr/lib/opera/plugins/libflashplayer.so
102 status
103 }
104 EOT
106 # Pack
107 tazpkg pack $PACKAGE-$VERSION
109 # Install pseudo package
110 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
111 case " $@ " in
112 *\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;;
113 esac
115 # Clean
116 cd $CUR_DIR
117 rm -rf $TMP_DIR