wok-next view get-unace/stuff/get-unace @ rev 4008
Up: libxcb (1.4) xcb-util (0.3.6) awesome (3.3.3)
author | Mallory Mollo <mallory@sweetpeople.org> |
---|---|
date | Tue Sep 01 20:54:14 2009 +0200 (2009-09-01) |
parents | 7ece4b878e10 |
children | 007b91d3da0b |
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 # Install files
44 dir=$PACKAGE-$VERSION/fs/usr/bin
45 mkdir -p $dir
46 mv unace $dir
48 # Create pseudo package
49 cat > $PACKAGE-$VERSION/receipt <<EOT
50 PACKAGE="$PACKAGE"
51 VERSION="$VERSION"
52 CATEGORY="non-free"
53 SHORT_DESC="An archive unpacker."
54 WEB_SITE="$WEB_SITE"
55 EOT
57 # Pack
58 tazpkg pack $PACKAGE-$VERSION
60 # Install pseudo package
61 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
62 cd $BASE
64 # Clean
65 rm -rf $DIR