wok-6.x rev 14503

Add get-litecoin
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat May 11 23:41:18 2013 +0200 (2013-05-11)
parents a9d47aecad2c
children b8f782e7c45e
files get-litecoin/receipt get-litecoin/stuff/get-litecoin
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/get-litecoin/receipt	Sat May 11 23:41:18 2013 +0200
     1.3 @@ -0,0 +1,16 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="get-litecoin"
     1.7 +VERSION="1.00"
     1.8 +CATEGORY="misc"
     1.9 +SHORT_DESC="Get digital currency tool for instant payments to anyone, anywhere."
    1.10 +MAINTAINER="pascal.bellard@slitaz.org"
    1.11 +WEB_SITE="http://litecoin.org/"
    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-litecoin $fs/usr/bin
    1.18 +}
    1.19 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/get-litecoin/stuff/get-litecoin	Sat May 11 23:41:18 2013 +0200
     2.3 @@ -0,0 +1,95 @@
     2.4 +#!/bin/sh -e
     2.5 +
     2.6 +PACKAGE="$(basename $0 | sed 's/get-//')"
     2.7 +CATEGORY="misc"
     2.8 +WEB_SITE="http://$PACKAGE.org/"
     2.9 +SHORT_DESC="New digital currency for instant payments to anyone, anywhere."
    2.10 +MAINTAINER="somebody@$PACKAGE.org"
    2.11 +DEPENDS="libQtGui bzlib"
    2.12 +
    2.13 +ROOT="$1"
    2.14 +[ -d "$ROOT" ] || ROOT=""
    2.15 +
    2.16 +if test $(id -u) != 0 ; then
    2.17 +        echo -e "\nYou must be root to run `basename $0`."
    2.18 +        echo -e "Please type 'su' and root password to become super-user.\n"
    2.19 +        exit 0
    2.20 +fi
    2.21 +
    2.22 +if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then
    2.23 +	[ -n "$ROOT" ] && exit 1
    2.24 +	tazpkg remove $PACKAGE
    2.25 +	[ -d /var/lib/tazpkg/installed/$PACKAGE ] && exit 1
    2.26 +fi
    2.27 +
    2.28 +TMP_DIR=/tmp/get-$PACKAGE-$$-$RANDOM
    2.29 +CUR_DIR=$(pwd)
    2.30 +mkdir -p $TMP_DIR && cd $TMP_DIR
    2.31 +
    2.32 +# Download tarball
    2.33 +URL=$(wget -O - $WEB_SITE | sed '/linux.tar/!d;;s/.*href="\([^"]*\).*/\1/')
    2.34 +FILE="$(basename $URL)"
    2.35 +VERSION="$(echo $FILE | sed 's/.*coin-\(.*\)-linux.tar.*/\1/')"
    2.36 +wget -O $FILE "$URL"
    2.37 +
    2.38 +if [ ! -f $FILE ]; then
    2.39 +	cd $CUR_DIR
    2.40 +	rm -rf $TMP_DIR
    2.41 +	echo "Could not download $FILE from $URL. Exiting."
    2.42 +	exit 1
    2.43 +fi
    2.44 +
    2.45 +mkdir -p $PACKAGE-$VERSION/fs/usr/bin
    2.46 +tar xzf $FILE
    2.47 +
    2.48 +mv $PACKAGE-$VERSION-linux/bin/32/* $PACKAGE-$VERSION/fs/usr/bin
    2.49 +rm -rf $PACKAGE-$VERSION-linux
    2.50 +
    2.51 +# extracted pkg can be removed: Save RAM
    2.52 +rm -f $FILE
    2.53 +
    2.54 +cd $PACKAGE-$VERSION/fs
    2.55 +
    2.56 +# Create menu
    2.57 +mkdir -p usr/share/applications
    2.58 +cat > usr/share/applications/$PACKAGE.desktop <<EOT
    2.59 +[Desktop Entry]
    2.60 +Version=1.0
    2.61 +Encoding=UTF-8
    2.62 +Name=$PACKAGE
    2.63 +Exec=/usr/bin/$PACKAGE-qt
    2.64 +Icon=stock_certificate.png
    2.65 +Terminal=false
    2.66 +Categories=Application
    2.67 +Comment=$SHORT_DESC
    2.68 +Type=Application
    2.69 +Categories=Office;
    2.70 +EOT
    2.71 +cd ../..
    2.72 +
    2.73 +cat > $PACKAGE-$VERSION/receipt <<EOT
    2.74 +PACKAGE="$PACKAGE"
    2.75 +VERSION="$VERSION"
    2.76 +CATEGORY="$CATEGORY"
    2.77 +SHORT_DESC="$SHORT_DESC"
    2.78 +MAINTAINER="$MAINTAINER"
    2.79 +DEPENDS="$DEPENDS"
    2.80 +WEB_SITE="$WEB_SITE"
    2.81 +EOT
    2.82 +
    2.83 +# Pack
    2.84 +tazpkg pack $PACKAGE-$VERSION
    2.85 +
    2.86 +# Clean to save RAM memory
    2.87 +rm -rf $PACKAGE-$VERSION
    2.88 +
    2.89 +# Install pseudo package
    2.90 +tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
    2.91 +case " $@ " in
    2.92 +*\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;;
    2.93 +esac
    2.94 +
    2.95 +# Clean
    2.96 +cd $CUR_DIR
    2.97 +rm -rf $TMP_DIR
    2.98 +