wok annotate get-flash-plugin/stuff/get-flash-plugin @ rev 13150
get-flash-plugin: be busybox/sed compatible
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Jul 11 11:13:01 2012 +0200 (2012-07-11) |
parents | 1e63dfca3c69 |
children | a81b80118645 |
rev | line source |
---|---|
pascal@305 | 1 #!/bin/sh -e |
pascal@305 | 2 |
slaxemulator@11351 | 3 [ -f /etc/slitaz/slitaz.conf ] && . /etc/slitaz/slitaz.conf |
slaxemulator@11351 | 4 [ $INSTALLED ] || INSTALLED=/var/lib/tazpkg/installed |
slaxemulator@11351 | 5 |
pascal@11350 | 6 PACKAGE="flash-plugin" |
pascal@11350 | 7 WEB_SITE="http://www.adobe.com/products/flash/" |
pascal@11350 | 8 SHORT_DESC="Adobe Flash Player." |
pascal@1713 | 9 ROOT="$1" |
pascal@11350 | 10 [ -d "$ROOT" ] || ROOT="" |
pascal@1713 | 11 |
pascal@417 | 12 if test $(id -u) != 0 ; then |
pascal@417 | 13 echo -e "\nYou must be root to run `basename $0`." |
pascal@417 | 14 echo -e "Please type 'su' and root password to become super-user.\n" |
pascal@417 | 15 exit 0 |
pascal@417 | 16 fi |
pascal@417 | 17 |
slaxemulator@11325 | 18 if [ -d ${ROOT}${INSTALLED}/$PACKAGE ]; then |
pascal@1713 | 19 [ -n "$ROOT" ] && exit 1 |
slaxemulator@11325 | 20 tazpkg remove $PACKAGE |
slaxemulator@11325 | 21 [ -d $INSTALLED/$PACKAGE ] && exit 1 |
pascal@446 | 22 fi |
pascal@305 | 23 |
pascal@11350 | 24 URL= |
pascal@13150 | 25 for i in $(seq 112 999); do |
pascal@13150 | 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" | \ |
pascal@13150 | 27 sed "/gz/!d;s/.* '//;s/'.*//")" |
pascal@13150 | 28 [ -n "$n" ] && URL="$n" && continue |
pascal@13150 | 29 break |
pascal@13150 | 30 done |
pascal@13150 | 31 [ -z "$URL" ] && for i in $(seq 11 99); do |
pascal@11350 | 32 n="$(busybox wget -O - "http://get.adobe.com/fr/flashplayer/completion/?installer=Flash_Player_${i}_for_other_Linux_(.tar.gz)_32-bit" | \ |
pascal@11350 | 33 sed "/gz/!d;s/.* '//;s/'.*//")" |
pascal@11350 | 34 [ -n "$n" ] && URL="$n" && continue |
pascal@11350 | 35 break |
pascal@1684 | 36 done |
pascal@1684 | 37 |
pascal@11350 | 38 if [ -z "$URL" ]; then |
pascal@11350 | 39 echo "Could not find url. Exiting." |
pascal@11350 | 40 exit 1 |
pascal@11350 | 41 fi |
pascal@11350 | 42 |
pascal@11350 | 43 TMP_DIR=/tmp/get-$PACKAGE-$$-$RANDOM |
pascal@11350 | 44 CUR_DIR=$(pwd) |
pascal@11350 | 45 mkdir -p $TMP_DIR && cd $TMP_DIR |
pascal@11350 | 46 TARBALL="$(basename $URL)" |
pascal@11350 | 47 busybox wget -O $TARBALL $URL |
pascal@3893 | 48 if [ ! -f $TARBALL ]; then |
pascal@3893 | 49 echo "Could not download $TARBALL. Exiting." |
pascal@3893 | 50 exit 1 |
pascal@3893 | 51 fi |
pascal@3893 | 52 |
pascal@11350 | 53 tar xzf $TARBALL |
pascal@305 | 54 |
pascal@1685 | 55 VERSION="$(strings libflashplayer.so | grep ^LNX | sed -e 's/LNX //' -e 's/,/./g')" |
pascal@305 | 56 |
pascal@305 | 57 # Install files |
pascal@1173 | 58 chmod 755 libflashplayer.so |
pascal@1174 | 59 chown root.root libflashplayer.so |
slaxemulator@11325 | 60 dir=$PACKAGE-$VERSION/fs/usr/share/flash |
pascal@1713 | 61 mkdir -p $dir |
pascal@1713 | 62 mv libflashplayer.so $dir |
pascal@305 | 63 |
jozee@5074 | 64 # Sanity Check: Reexport firefox libraries if they don't exist |
slaxemulator@11325 | 65 dir=$PACKAGE-$VERSION/fs/usr/lib |
jozee@5074 | 66 mkdir -p $dir |
slaxemulator@11325 | 67 for i in /usr/lib/firefox/*.so ; do |
jozee@5075 | 68 [ -f $i ] && [ -z "`ls /usr/lib/$(basename $i)`" ] && ln -s $i $dir |
jozee@5074 | 69 done |
jozee@5074 | 70 |
pascal@305 | 71 # Create pseudo package |
slaxemulator@11325 | 72 cat > $PACKAGE-$VERSION/receipt <<EOT |
slaxemulator@11325 | 73 PACKAGE="$PACKAGE" |
pascal@305 | 74 VERSION="$VERSION" |
pascal@305 | 75 CATEGORY="non-free" |
pascal@11350 | 76 SHORT_DESC="$SHORT_DESC" |
pascal@305 | 77 WEB_SITE="$WEB_SITE" |
jozee@5039 | 78 DEPENDS="libfirefox curl atk cairo expat fontconfig freetype glib gtk+ libpng \ |
pascal@2427 | 79 pango pixman xorg-libICE xorg-libSM xorg-libX11 xorg-libXau xorg-libXcomposite \ |
pascal@2427 | 80 xorg-libXcursor xorg-libXdamage xorg-libXdmcp xorg-libXext xorg-libXfixes \ |
pascal@2427 | 81 xorg-libXinerama xorg-libXrandr xorg-libXrender xorg-libXt zlib" |
pascal@1713 | 82 |
pascal@1713 | 83 post_install() |
pascal@1713 | 84 { |
pascal@1713 | 85 echo -n "Processing post install commands..." |
erjo@12184 | 86 |
erjo@12184 | 87 [ -d /usr/lib/mozilla/plugins ] || mkdir -p \$1/usr/lib/mozilla/plugins |
jozee@5039 | 88 ln -s /usr/share/flash/libflashplayer.so \$1/usr/lib/mozilla/plugins |
pascal@1713 | 89 status |
pascal@1713 | 90 } |
pascal@1713 | 91 |
pascal@1713 | 92 post_remove() |
pascal@1713 | 93 { |
pascal@1713 | 94 echo -n "Processing post remove commands..." |
jozee@5039 | 95 rm -f /usr/lib/mozilla/plugins/libflashplayer.so |
pascal@1713 | 96 status |
pascal@1713 | 97 } |
pascal@305 | 98 EOT |
pascal@1173 | 99 |
pascal@1173 | 100 # Pack |
slaxemulator@11325 | 101 tazpkg pack $PACKAGE-$VERSION |
pascal@305 | 102 |
pascal@305 | 103 # Install pseudo package |
slaxemulator@11325 | 104 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT |
pascal@11350 | 105 case " $@ " in |
pascal@11350 | 106 *\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;; |
pascal@11350 | 107 esac |
pascal@305 | 108 |
pascal@305 | 109 # Clean |
pascal@11350 | 110 cd $CUR_DIR |
pascal@11350 | 111 rm -rf $TMP_DIR |