wok-next view get-flash-plugin/stuff/get-flash-plugin @ rev 13206
fail2ban: update bdeps
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Aug 06 14:55:22 2012 +0200 (2012-08-06) |
parents | 1e63dfca3c69 |
children | a81b80118645 |
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 /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 status
90 }
92 post_remove()
93 {
94 echo -n "Processing post remove commands..."
95 rm -f /usr/lib/mozilla/plugins/libflashplayer.so
96 status
97 }
98 EOT
100 # Pack
101 tazpkg pack $PACKAGE-$VERSION
103 # Install pseudo package
104 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
105 case " $@ " in
106 *\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;;
107 esac
109 # Clean
110 cd $CUR_DIR
111 rm -rf $TMP_DIR