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