# HG changeset patch # User Pascal Bellard # Date 1355763672 -3600 # Node ID fbcef2e7a3e30c6dbb7c747f871c85ecdc90ffaa # Parent 05c57ff37237c65f8f3d1e4d2c5ac2e0991fdc08 Add get-algobox diff -r 05c57ff37237 -r fbcef2e7a3e3 get-algobox/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/get-algobox/receipt Mon Dec 17 18:01:12 2012 +0100 @@ -0,0 +1,16 @@ +# SliTaz package receipt. + +PACKAGE="get-algobox" +VERSION="1.00" +CATEGORY="misc" +SHORT_DESC="Get the Algorithm creation tool for education" +WEB_SITE="http://www.xm1math.net/algobox/" +WEB_SITE="http://www.xm1math.net/algobox/" + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr/bin + cp stuff/get-algobox $fs/usr/bin +} + diff -r 05c57ff37237 -r fbcef2e7a3e3 get-algobox/stuff/get-algobox --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/get-algobox/stuff/get-algobox Mon Dec 17 18:01:12 2012 +0100 @@ -0,0 +1,82 @@ +#!/bin/sh -e + +PACKAGE="algobox" +WEB_SITE="http://www.xm1math.net/algobox/" +CATEGORY="misc" +SHORT_DESC="Algorithm creation tool for education" +DEPENDS="libQtWebkit libQtXml libQtGui libQtCore gcc-lib-base" +URL="${WEB_SITE}download.html" + +ROOT="$1" +[ -d "$ROOT" ] || ROOT="" + +if test $(id -u) != 0 ; then + echo -e "\nYou must be root to run `basename $0`." + echo -e "Please type 'su' and root password to become super-user.\n" + exit 0 +fi + +if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then + [ -n "$ROOT" ] && exit 1 + tazpkg remove $PACKAGE + [ -d /var/lib/tazpkg/installed/$PACKAGE ] && exit 1 +fi + +TMP_DIR=/tmp/get-$PACKAGE-$$-$RANDOM +CUR_DIR=$(pwd) +mkdir -p $TMP_DIR && cd $TMP_DIR + +URL="$WEB_SITE$(wget -O - sed '/debian_wheezy_i386/!d;s/.*href=.\([^"]*\).*/\1/')" +FILE="$(basename $URL)" + +# Download deb +wget -O $FILE $URL + +if [ ! -f $FILE ]; then + cd $CUR_DIR + rm -rf $TMP_DIR + echo "Could not download $FILE from $URL. Exiting." + exit 1 +fi + +mkdir $PACKAGE +dpkg-deb -e $FILE $PACKAGE/meta +dpkg-deb -x $FILE $PACKAGE/fs +# extracted pkg can be removed: Save RAM +rm -f $FILE +if ! grep -q "insert long description" $PACKAGE/meta/control ; then + sed '/^Description:/,$!d;s/^Description://' \ + < $PACKAGE/meta/control > $PACKAGE/description.txt + SHORT_DESC="$(sed '/^Description:/!d;s/.*: //' $PACKAGE/meta/control)" +if + +MAINTAINER="$(sed '/^Maintainer:/!d;s/.*: //' $PACKAGE/meta/control)" +VERSION="$(sed '/^Version:/!d;s/.*: //' $PACKAGE/meta/control)" +mv $PACKAGE $PACKAGE-$VERSION + +cat > $PACKAGE-$VERSION/receipt <