wok-next view get-unace/stuff/get-unace @ rev 2937
Add: imagination (lightweight slideshow maker)
author | Rohit Joshi <jozee@slitaz.org> |
---|---|
date | Thu May 07 12:34:46 2009 +0000 (2009-05-07) |
parents | |
children | 32959e7975fc |
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
34 # Extract
35 tar xzf $TARBALL
37 # Install files
38 dir=$PACKAGE-$VERSION/fs/usr/bin
39 mkdir -p $dir
40 mv unace $dir
42 # Create pseudo package
43 cat > $PACKAGE-$VERSION/receipt <<EOT
44 PACKAGE="$PACKAGE"
45 VERSION="$VERSION"
46 CATEGORY="non-free"
47 SHORT_DESC="An archive unpacker."
48 WEB_SITE="$WEB_SITE"
49 EOT
51 # Pack
52 tazpkg pack $PACKAGE-$VERSION
54 # Install pseudo package
55 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
56 cd $BASE
58 # Clean
59 rm -rf $DIR