wok annotate get-litecoin/stuff/get-litecoin @ rev 21803
created recipe for nnn 2.6
author | Hans-G?nter Theisgen |
---|---|
date | Sat Aug 10 20:59:16 2019 +0100 (2019-08-10) |
parents | |
children | c07aaa614a02 |
rev | line source |
---|---|
pascal@14503 | 1 #!/bin/sh -e |
pascal@14503 | 2 |
pascal@14503 | 3 PACKAGE="$(basename $0 | sed 's/get-//')" |
pascal@14503 | 4 CATEGORY="misc" |
pascal@14503 | 5 WEB_SITE="http://$PACKAGE.org/" |
pascal@14503 | 6 SHORT_DESC="New digital currency for instant payments to anyone, anywhere." |
pascal@14503 | 7 MAINTAINER="somebody@$PACKAGE.org" |
pascal@14503 | 8 DEPENDS="libQtGui bzlib" |
pascal@14503 | 9 |
pascal@14503 | 10 ROOT="$1" |
pascal@14503 | 11 [ -d "$ROOT" ] || ROOT="" |
pascal@14503 | 12 |
pascal@14503 | 13 if test $(id -u) != 0 ; then |
pascal@14503 | 14 echo -e "\nYou must be root to run `basename $0`." |
pascal@14503 | 15 echo -e "Please type 'su' and root password to become super-user.\n" |
pascal@14503 | 16 exit 0 |
pascal@14503 | 17 fi |
pascal@14503 | 18 |
pascal@14503 | 19 if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then |
pascal@14503 | 20 [ -n "$ROOT" ] && exit 1 |
pascal@14503 | 21 tazpkg remove $PACKAGE |
pascal@14503 | 22 [ -d /var/lib/tazpkg/installed/$PACKAGE ] && exit 1 |
pascal@14503 | 23 fi |
pascal@14503 | 24 |
pascal@14503 | 25 TMP_DIR=/tmp/get-$PACKAGE-$$-$RANDOM |
pascal@14503 | 26 CUR_DIR=$(pwd) |
pascal@14503 | 27 mkdir -p $TMP_DIR && cd $TMP_DIR |
pascal@14503 | 28 |
pascal@14503 | 29 # Download tarball |
pascal@14503 | 30 URL=$(wget -O - $WEB_SITE | sed '/linux.tar/!d;;s/.*href="\([^"]*\).*/\1/') |
pascal@14503 | 31 FILE="$(basename $URL)" |
pascal@14503 | 32 VERSION="$(echo $FILE | sed 's/.*coin-\(.*\)-linux.tar.*/\1/')" |
pascal@14503 | 33 wget -O $FILE "$URL" |
pascal@14503 | 34 |
pascal@14503 | 35 if [ ! -f $FILE ]; then |
pascal@14503 | 36 cd $CUR_DIR |
pascal@14503 | 37 rm -rf $TMP_DIR |
pascal@14503 | 38 echo "Could not download $FILE from $URL. Exiting." |
pascal@14503 | 39 exit 1 |
pascal@14503 | 40 fi |
pascal@14503 | 41 |
pascal@14503 | 42 mkdir -p $PACKAGE-$VERSION/fs/usr/bin |
pascal@14503 | 43 tar xzf $FILE |
pascal@14503 | 44 |
pascal@14503 | 45 mv $PACKAGE-$VERSION-linux/bin/32/* $PACKAGE-$VERSION/fs/usr/bin |
pascal@14503 | 46 rm -rf $PACKAGE-$VERSION-linux |
pascal@14503 | 47 |
pascal@14503 | 48 # extracted pkg can be removed: Save RAM |
pascal@14503 | 49 rm -f $FILE |
pascal@14503 | 50 |
pascal@14503 | 51 cd $PACKAGE-$VERSION/fs |
pascal@14503 | 52 |
pascal@14503 | 53 # Create menu |
pascal@14503 | 54 mkdir -p usr/share/applications |
pascal@14503 | 55 cat > usr/share/applications/$PACKAGE.desktop <<EOT |
pascal@14503 | 56 [Desktop Entry] |
pascal@14503 | 57 Version=1.0 |
pascal@14503 | 58 Encoding=UTF-8 |
pascal@14503 | 59 Name=$PACKAGE |
pascal@14503 | 60 Exec=/usr/bin/$PACKAGE-qt |
pascal@14503 | 61 Icon=stock_certificate.png |
pascal@14503 | 62 Terminal=false |
pascal@14503 | 63 Categories=Application |
pascal@14503 | 64 Comment=$SHORT_DESC |
pascal@14503 | 65 Type=Application |
pascal@14503 | 66 Categories=Office; |
pascal@14503 | 67 EOT |
pascal@14503 | 68 cd ../.. |
pascal@14503 | 69 |
pascal@14503 | 70 cat > $PACKAGE-$VERSION/receipt <<EOT |
pascal@14503 | 71 PACKAGE="$PACKAGE" |
pascal@14503 | 72 VERSION="$VERSION" |
pascal@14503 | 73 CATEGORY="$CATEGORY" |
pascal@14503 | 74 SHORT_DESC="$SHORT_DESC" |
pascal@14503 | 75 MAINTAINER="$MAINTAINER" |
pascal@14503 | 76 DEPENDS="$DEPENDS" |
pascal@14503 | 77 WEB_SITE="$WEB_SITE" |
pascal@14503 | 78 EOT |
pascal@14503 | 79 |
pascal@14503 | 80 # Pack |
pascal@14503 | 81 tazpkg pack $PACKAGE-$VERSION |
pascal@14503 | 82 |
pascal@14503 | 83 # Clean to save RAM memory |
pascal@14503 | 84 rm -rf $PACKAGE-$VERSION |
pascal@14503 | 85 |
pascal@14503 | 86 # Install pseudo package |
pascal@14503 | 87 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT |
pascal@14503 | 88 case " $@ " in |
pascal@14503 | 89 *\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;; |
pascal@14503 | 90 esac |
pascal@14503 | 91 |
pascal@14503 | 92 # Clean |
pascal@14503 | 93 cd $CUR_DIR |
pascal@14503 | 94 rm -rf $TMP_DIR |
pascal@14503 | 95 |