wok view get-unace/stuff/get-unace @ rev 12974

move from undigest umplayer-svn
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Jun 01 18:10:20 2012 +0200 (2012-06-01)
parents 32959e7975fc
children c07aaa614a02
line source
1 #!/bin/sh -e
3 ROOT="$1"
4 PACKAGE="unace"
5 WEB_SITE="http://www.winace.com/"
6 WGET_URL="${WEB_SITE}news.html"
9 if test $(id -u) != 0 ; then
10 echo -e "\nYou must be root to run `basename $0`."
11 echo -e "Please type 'su' and root password to become super-user.\n"
12 exit 0
13 fi
15 if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then
16 [ -n "$ROOT" ] && exit 1
17 tazpkg remove $PACKAGE
18 [ -d /var/lib/tazpkg/installed/$PACKAGE ] && exit 1
19 fi
21 WGET_URL=$(wget -O - $WGET_URL | grep 'linunace' | sed 's/.*href="\(.*z\)".*/\1/')
22 TARBALL=$(basename $WGET_URL || true)
23 VERSION=$(echo $TARBALL | sed 's/.*linunace\(.*\).t.*/\1/')
24 echo "Downloading $PACKAGE $VERSION from $WGET_URL..."
26 BASE=$PWD
27 DIR=/tmp/$0-$$
28 mkdir -p $DIR
29 cd $DIR
31 # Download tarball
32 wget $WGET_URL
33 if [ ! -f $TARBALL ]; then
34 cd $BASE
35 rm -rf $DIR
36 echo "Could not download $TARBALL. Exiting."
37 exit 1
38 fi
40 # Extract
41 tar xzf $TARBALL
43 # extracted pkg can be removed: Save RAM before packing
44 rm -rf $TARBALL
46 # Install files
47 dir=$PACKAGE-$VERSION/fs/usr/bin
48 mkdir -p $dir
49 mv unace $dir
51 # Create pseudo package
52 cat > $PACKAGE-$VERSION/receipt <<EOT
53 PACKAGE="$PACKAGE"
54 VERSION="$VERSION"
55 CATEGORY="non-free"
56 SHORT_DESC="An archive unpacker."
57 WEB_SITE="$WEB_SITE"
58 EOT
60 # Pack
61 tazpkg pack $PACKAGE-$VERSION
63 # Clean to save RAM memory
64 rm -rf $PACKAGE-$VERSION
66 # Install pseudo package
67 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
68 cd $BASE
70 # Clean
71 rm -rf $DIR