wok annotate get-flash-plugin/stuff/get-flash-plugin @ rev 417

get-skype, get-flash-plugin: check we are root
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Mar 12 19:54:03 2008 +0000 (2008-03-12)
parents 50ae4849a222
children 510870ca891b
rev   line source
pascal@305 1 #!/bin/sh -e
pascal@305 2
pascal@417 3 if test $(id -u) != 0 ; then
pascal@417 4 echo -e "\nYou must be root to run `basename $0`."
pascal@417 5 echo -e "Please type 'su' and root password to become super-user.\n"
pascal@417 6 exit 0
pascal@417 7 fi
pascal@417 8
pascal@305 9 DIR=install_flash_player_9_linux
pascal@305 10 TARBALL=$DIR.tar.gz
pascal@305 11 WEB_SITE="http://www.adobe.com/products/flash/"
pascal@305 12
pascal@305 13 # Download tarball
pascal@305 14 wget http://fpdownload.macromedia.com/get/flashplayer/current/$TARBALL
pascal@305 15
pascal@305 16 # Extract
pascal@305 17 tar xzf $TARBALL
pascal@305 18
pascal@305 19 cd $DIR
pascal@305 20 VERSION=""
pascal@305 21 for i in MAJ MIN REV ; do
pascal@305 22 n=$(grep ^FPVERSION$i flashplayer-installer | cut -d= -f2)
pascal@305 23 [ -n "$VERSION" ] && VERSION=$VERSION.
pascal@305 24 VERSION=$VERSION$n
pascal@305 25 done
pascal@305 26
pascal@305 27 # Install files
pascal@305 28 cp libflashplayer.so /usr/lib/firefox*/plugins
pascal@305 29 chmod 755 /usr/lib/firefox*/plugins/libflashplayer.so
pascal@305 30
pascal@305 31 # Create pseudo package
pascal@305 32 mkdir -p fs/usr/bin
pascal@305 33 cp /usr/bin/get-flash-plugin fs/usr/bin
pascal@305 34 find fs | cpio -o -H newc | gzip -9 > fs.cpio.gz
pascal@305 35 ls /usr/lib/firefox*/plugins/libflashplayer.so > files.list
pascal@305 36 cat > receipt <<EOT
pascal@305 37 PACKAGE="flash-plugin"
pascal@305 38 VERSION="$VERSION"
pascal@305 39 CATEGORY="non-free"
pascal@305 40 SHORT_DESC="Adobe Flash Player."
pascal@305 41 WEB_SITE="$WEB_SITE"
pascal@305 42 EOT
pascal@305 43 cpio -o -H newc > flash-plugin-$VERSION.tazpkg <<EOT
pascal@305 44 receipt
pascal@305 45 files.list
pascal@305 46 fs.cpio.gz
pascal@305 47 EOT
pascal@305 48
pascal@305 49 # Install pseudo package
pascal@305 50 tazpkg install flash-plugin-$VERSION.tazpkg
pascal@305 51 cd ..
pascal@305 52
pascal@305 53 # Clean
pascal@305 54 rm -rf $DIR $TARBALL
pascal@305 55