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