wok diff get-flash-plugin/stuff/get-flash-plugin @ rev 1801

curl: update depends (again)
author Paul Issott <paul@slitaz.org>
date Mon Dec 01 23:24:52 2008 +0000 (2008-12-01)
parents 84614d77f18a
children 732e0480f6cb
line diff
     1.1 --- a/get-flash-plugin/stuff/get-flash-plugin	Sun Nov 09 23:08:30 2008 +0000
     1.2 +++ b/get-flash-plugin/stuff/get-flash-plugin	Mon Dec 01 23:24:52 2008 +0000
     1.3 @@ -1,13 +1,16 @@
     1.4  #!/bin/sh -e
     1.5  : ${DIALOG=tazdialog}
     1.6  
     1.7 +ROOT="$1"
     1.8 +
     1.9  if test $(id -u) != 0 ; then
    1.10  	echo -e "\nYou must be root to run `basename $0`."
    1.11  	echo -e "Please type 'su' and root password to become super-user.\n"
    1.12  	exit 0
    1.13  fi
    1.14  
    1.15 -if [ -d /var/lib/tazpkg/installed/flash-plugin ]; then
    1.16 +if [ -d $ROOT/var/lib/tazpkg/installed/flash-plugin ]; then
    1.17 +  [ -n "$ROOT" ] && exit 1
    1.18    tazpkg remove flash-plugin
    1.19    [ -d /var/lib/tazpkg/installed/flash-plugin ] && exit 1
    1.20  fi
    1.21 @@ -18,6 +21,7 @@
    1.22  VERSIONS=""; i=9; while true; do
    1.23    if wget -s ${URL}install_flash_player_${i}_linux.tar.gz 2> /dev/null; then
    1.24      VERSIONS="$VERSIONS $i"
    1.25 +    [ -n "$ROOT" ] && break
    1.26    elif [ -n "$VERSIONS" ]; then
    1.27      break
    1.28    elif [ $i -gt 20 ]; then
    1.29 @@ -52,29 +56,39 @@
    1.30  # Install files
    1.31  chmod 755 libflashplayer.so
    1.32  chown root.root libflashplayer.so
    1.33 -mv libflashplayer.so /usr/lib/firefox*/plugins
    1.34 +dir=flash-plugin-$VERSION/fs/usr/share/flash
    1.35 +mkdir -p $dir
    1.36 +mv libflashplayer.so $dir
    1.37  
    1.38  # Create pseudo package
    1.39 -while read file; do
    1.40 -	dest=flash-plugin-$VERSION/fs$(dirname $file)
    1.41 -	[ -d $dest ] || mkdir -p $dest
    1.42 -	cp -a $file $dest
    1.43 -done <<EOT
    1.44 -$(ls /usr/lib/firefox*/plugins/libflashplayer.so)
    1.45 -EOT
    1.46  cat > flash-plugin-$VERSION/receipt <<EOT
    1.47  PACKAGE="flash-plugin"
    1.48  VERSION="$VERSION"
    1.49  CATEGORY="non-free"
    1.50  SHORT_DESC="Adobe Flash Player."
    1.51  WEB_SITE="$WEB_SITE"
    1.52 +DEPENDS="firefox"
    1.53 +
    1.54 +post_install()
    1.55 +{
    1.56 +	echo -n "Processing post install commands..."
    1.57 +	ln -s /usr/share/flash/libflashplayer.so \$1/usr/lib/firefox*/plugins
    1.58 +	status
    1.59 +}
    1.60 +
    1.61 +post_remove()
    1.62 +{
    1.63 +	echo -n "Processing post remove commands..."
    1.64 +	rm -f /usr/lib/firefox*/plugins/libflashplayer.so
    1.65 +	status
    1.66 +}
    1.67  EOT
    1.68  
    1.69  # Pack
    1.70  tazpkg pack flash-plugin-$VERSION
    1.71  
    1.72  # Install pseudo package
    1.73 -tazpkg install flash-plugin-$VERSION.tazpkg
    1.74 +tazpkg install flash-plugin-$VERSION.tazpkg --root=$ROOT
    1.75  cd ..
    1.76  
    1.77  # Clean