wok-current rev 13707
Add get-algobox
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Dec 17 18:01:12 2012 +0100 (2012-12-17) |
parents | 05c57ff37237 |
children | d7887c01c6e3 |
files | get-algobox/receipt get-algobox/stuff/get-algobox |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/get-algobox/receipt Mon Dec 17 18:01:12 2012 +0100 1.3 @@ -0,0 +1,16 @@ 1.4 +# SliTaz package receipt. 1.5 + 1.6 +PACKAGE="get-algobox" 1.7 +VERSION="1.00" 1.8 +CATEGORY="misc" 1.9 +SHORT_DESC="Get the Algorithm creation tool for education" 1.10 +WEB_SITE="http://www.xm1math.net/algobox/" 1.11 +WEB_SITE="http://www.xm1math.net/algobox/" 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-algobox $fs/usr/bin 1.18 +} 1.19 +
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/get-algobox/stuff/get-algobox Mon Dec 17 18:01:12 2012 +0100 2.3 @@ -0,0 +1,82 @@ 2.4 +#!/bin/sh -e 2.5 + 2.6 +PACKAGE="algobox" 2.7 +WEB_SITE="http://www.xm1math.net/algobox/" 2.8 +CATEGORY="misc" 2.9 +SHORT_DESC="Algorithm creation tool for education" 2.10 +DEPENDS="libQtWebkit libQtXml libQtGui libQtCore gcc-lib-base" 2.11 +URL="${WEB_SITE}download.html" 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 +URL="$WEB_SITE$(wget -O - sed '/debian_wheezy_i386/!d;s/.*href=.\([^"]*\).*/\1/')" 2.33 +FILE="$(basename $URL)" 2.34 + 2.35 +# Download deb 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 $PACKAGE 2.46 +dpkg-deb -e $FILE $PACKAGE/meta 2.47 +dpkg-deb -x $FILE $PACKAGE/fs 2.48 +# extracted pkg can be removed: Save RAM 2.49 +rm -f $FILE 2.50 +if ! grep -q "insert long description" $PACKAGE/meta/control ; then 2.51 + sed '/^Description:/,$!d;s/^Description://' \ 2.52 + < $PACKAGE/meta/control > $PACKAGE/description.txt 2.53 + SHORT_DESC="$(sed '/^Description:/!d;s/.*: //' $PACKAGE/meta/control)" 2.54 +if 2.55 + 2.56 +MAINTAINER="$(sed '/^Maintainer:/!d;s/.*: //' $PACKAGE/meta/control)" 2.57 +VERSION="$(sed '/^Version:/!d;s/.*: //' $PACKAGE/meta/control)" 2.58 +mv $PACKAGE $PACKAGE-$VERSION 2.59 + 2.60 +cat > $PACKAGE-$VERSION/receipt <<EOT 2.61 +PACKAGE="$PACKAGE" 2.62 +VERSION="$VERSION" 2.63 +CATEGORY="$CATEGORY" 2.64 +SHORT_DESC="$SHORT_DESC" 2.65 +MAINTAINER="$MAINTAINER" 2.66 +DEPENDS="$DEPENDS" 2.67 +WEB_SITE="$WEB_SITE" 2.68 +EOT 2.69 + 2.70 +# Pack 2.71 +tazpkg pack $PACKAGE-$VERSION 2.72 + 2.73 +# Clean to save RAM memory 2.74 +rm -rf $PACKAGE-$VERSION 2.75 + 2.76 +# Install pseudo package 2.77 +tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT 2.78 +case " $@ " in 2.79 +*\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;; 2.80 +esac 2.81 + 2.82 +# Clean 2.83 +cd $CUR_DIR 2.84 +rm -rf $TMP_DIR 2.85 +