# HG changeset patch # User Hans-G?nter Theisgen # Date 1580223423 -3600 # Node ID 666b1da48c974e30aac94cee10d1bcebb505b0fa # Parent 72dc2894e87b20fe9a235957047a60259d8cbce9 updated get-algobox (1.00 -> 1.01) diff -r 72dc2894e87b -r 666b1da48c97 get-algobox/receipt --- a/get-algobox/receipt Tue Jan 28 10:03:39 2020 +0100 +++ b/get-algobox/receipt Tue Jan 28 15:57:03 2020 +0100 @@ -1,17 +1,19 @@ # SliTaz package receipt. PACKAGE="get-algobox" -VERSION="1.00" +VERSION="1.01" CATEGORY="misc" -SHORT_DESC="Get the Algorithm creation tool for education" -MAINTAINER="devel@slitaz.org" +SHORT_DESC="Get the Algorithm creation tool for education." +MAINTAINER="maintainer@slitaz.org" LICENSE="BSD" -WEB_SITE="http://www.xm1math.net/algobox/" +WEB_SITE="https://www.xm1math.net/algobox/" + +# fetches latest version only! +# available versions are amd64 only! # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { mkdir -p $fs/usr/bin - cp stuff/get-algobox $fs/usr/bin + cp stuff/get-algobox $fs/usr/bin } - diff -r 72dc2894e87b -r 666b1da48c97 get-algobox/stuff/get-algobox --- a/get-algobox/stuff/get-algobox Tue Jan 28 10:03:39 2020 +0100 +++ b/get-algobox/stuff/get-algobox Tue Jan 28 15:57:03 2020 +0100 @@ -1,82 +1,185 @@ -#!/bin/sh -e +#!/bin/sh +# +# get-package - create and install SliTaz package algobox +# +# (C) 2020 SliTaz - GNU General Public License v3. +# Author : unknown +# modified by HGT on 2020-01-28 +# +# === Initialisations === +PKGS_DB="/var/lib/tazpkg" # packages database directory PACKAGE="algobox" -WEB_SITE="http://www.xm1math.net/algobox/" +WEB_SITE="https://www.xm1math.net/algobox/" CATEGORY="misc" -SHORT_DESC="Algorithm creation tool for education" +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="" +# Declare functions check_root, status, ... +. /lib/libtaz.sh +# and make commandline options (if any) available as variables -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 +is_installed() +{ + if [ -d $ROOT$PKGS_DB/installed/$PACKAGE ] + then #package is deemed to be installed + return 0 + else + return 1 + fi +} + +# Show commandline options, if requested by --help +if [ "$help" == "yes" ] + then + echo "Commandline options: + $0 + --version= + --root= + --install=yes|no + --keep=no|yes + --tmpdir=" + exit 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 +# Check for system administrator privileges +check_root + +title "Package $PACKAGE will be build as SliTaz package and installed" + +# Fetch latest version, unless version is set by option --version +[ -z "$version" ] && version="latest" + +# Install SliTaz package, unless inhibited by option --install=no +[ -z "$install" ] && install="yes" + +# Delete SliTaz package file $PACKAGE-$VERSION.tazpkg after installation, +# unless option --keep=yes is given +[ -z "$keep" ] && keep="no" + +# Directory for temporary files +[ -z "$tempdir" ] && TMP_DIR="/tmp/get-$PACKAGE" + +# Logging file (unused by now) +LOG=$TMP_DIR/get-$PACKAGE.log + +cat < $PACKAGE/description.txt - SHORT_DESC="$(sed '/^Description:/!d;s/.*: //' $PACKAGE/meta/control)" -if +fi +SHORT_DESC="$(sed '/^Description:/!d; s/.*: //' $PACKAGE/meta/control)" +MAINTAINER="$(sed '/^Maintainer:/!d; s/.*: //' $PACKAGE/meta/control)" +VERSION="$( sed '/^Version:/!d; s/.*: //' $PACKAGE/meta/control)" -MAINTAINER="$(sed '/^Maintainer:/!d;s/.*: //' $PACKAGE/meta/control)" -VERSION="$(sed '/^Version:/!d;s/.*: //' $PACKAGE/meta/control)" +# rename build directory mv $PACKAGE $PACKAGE-$VERSION -cat > $PACKAGE-$VERSION/receipt < receipt <