wok-current rev 2644
Add get-unace
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Apr 17 22:19:51 2009 +0200 (2009-04-17) |
parents | c9c0ed1272f2 |
children | 38d36643bb08 |
files | get-unace/receipt get-unace/stuff/get-unace |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/get-unace/receipt Fri Apr 17 22:19:51 2009 +0200 1.3 @@ -0,0 +1,16 @@ 1.4 +# SliTaz package receipt. 1.5 + 1.6 +PACKAGE="get-unace" 1.7 +VERSION="1.00" 1.8 +CATEGORY="non-free" 1.9 +SHORT_DESC="Get UNACE unpacker." 1.10 +MAINTAINER="pascal.bellard@slitaz.org" 1.11 +WEB_SITE="http://www.winace.com/" 1.12 + 1.13 +# Rules to gen a SliTaz package suitable for Tazpkg. 1.14 +genpkg_rules() 1.15 +{ 1.16 + mkdir -p $fs/usr/bin 1.17 + cp stuff/get-unace $fs/usr/bin 1.18 +} 1.19 +
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/get-unace/stuff/get-unace Fri Apr 17 22:19:51 2009 +0200 2.3 @@ -0,0 +1,60 @@ 2.4 +#!/bin/sh -e 2.5 + 2.6 +ROOT="$1" 2.7 +PACKAGE="unace" 2.8 +WEB_SITE="http://www.winace.com/" 2.9 +WGET_URL="${WEB_SITE}news.html" 2.10 + 2.11 + 2.12 +if test $(id -u) != 0 ; then 2.13 + echo -e "\nYou must be root to run `basename $0`." 2.14 + echo -e "Please type 'su' and root password to become super-user.\n" 2.15 + exit 0 2.16 +fi 2.17 + 2.18 +if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then 2.19 + [ -n "$ROOT" ] && exit 1 2.20 + tazpkg remove $PACKAGE 2.21 + [ -d /var/lib/tazpkg/installed/$PACKAGE ] && exit 1 2.22 +fi 2.23 + 2.24 +WGET_URL=$(wget -O - $WGET_URL | grep 'linunace' | sed 's/.*href="\(.*z\)".*/\1/') 2.25 +TARBALL=$(basename $WGET_URL || true) 2.26 +VERSION=$(echo $TARBALL | sed 's/.*linunace\(.*\).t.*/\1/') 2.27 +echo "Downloading $PACKAGE $VERSION from $WGET_URL..." 2.28 + 2.29 +BASE=$PWD 2.30 +DIR=/tmp/$0-$$ 2.31 +mkdir -p $DIR 2.32 +cd $DIR 2.33 + 2.34 +# Download tarball 2.35 +wget $WGET_URL 2.36 + 2.37 +# Extract 2.38 +tar xzf $TARBALL 2.39 + 2.40 +# Install files 2.41 +dir=$PACKAGE-$VERSION/fs/usr/bin 2.42 +mkdir -p $dir 2.43 +mv unace $dir 2.44 + 2.45 +# Create pseudo package 2.46 +cat > $PACKAGE-$VERSION/receipt <<EOT 2.47 +PACKAGE="$PACKAGE" 2.48 +VERSION="$VERSION" 2.49 +CATEGORY="non-free" 2.50 +SHORT_DESC="An archive unpacker." 2.51 +WEB_SITE="$WEB_SITE" 2.52 +EOT 2.53 + 2.54 +# Pack 2.55 +tazpkg pack $PACKAGE-$VERSION 2.56 + 2.57 +# Install pseudo package 2.58 +tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT 2.59 +cd $BASE 2.60 + 2.61 +# Clean 2.62 +rm -rf $DIR 2.63 +