# HG changeset patch # User Hans-G?nter Theisgen # Date 1595931616 -3600 # Node ID 2ca805ec78e8ffe07286742ab067c3bfebc42330 # Parent 6475d1dc2a4d42646a43f69c860044c5bb871abe created get-anydesk diff -r 6475d1dc2a4d -r 2ca805ec78e8 get-anydesk/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/get-anydesk/receipt Tue Jul 28 11:20:16 2020 +0100 @@ -0,0 +1,20 @@ +# SliTaz package receipt v2. + +PACKAGE="get-anydesk" +VERSION="1.00" +CATEGORY="non-free" +TAGS="rdp" +SHORT_DESC="Feature rich multi-platform remote desktop application" +MAINTAINER="nobody@slitaz.org" +LICENSE="custom" +WEB_SITE="https://anydesk.com/" + +compile_rules() +{ + install -Dm755 $stuff/get-anydesk $install/usr/bin +} + +genpkg_rules() +{ + copy @std +} diff -r 6475d1dc2a4d -r 2ca805ec78e8 get-anydesk/stuff/get-anydesk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/get-anydesk/stuff/get-anydesk Tue Jul 28 11:20:16 2020 +0100 @@ -0,0 +1,159 @@ +#!/bin/sh +# +# get-anydesk - create and install SliTaz package anydesk +# +# (C) 2020 SliTaz - GNU General Public License v3. +# Author : HGT +# + +# === Initialisations === + +PKGS_DB="/var/lib/tazpkg" # packages database directory +PACKAGE="anydesk" +CATEGORY="non-free" +SHORT=DESC="remote access" +MAINTAINER="nobody@slitaz.org" +LICENSE="non-free" +WEB_SITE="https://anydesk.com/packagename/" +#DEPENDS="libglu-mesa" + +# Declare functions check_root, status, ... +. /lib/libtaz.sh +# and make commandline options (if any) available as variables + +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= + --logfile=" + exit +fi + +# 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 +TMP_DIR="$tmpdir" +[ -z "$tmpdir" ] && TMP_DIR="/tmp/get-$PACKAGE" + +# Logging file (unused by now) +LOG="$logfile" +[ -z "$logfile" ] && LOG=$TMP_DIR/get-$PACKAGE.log + +cat <.*option/p' | sed 's|.*_\(.*\)_.*|\1|' )" + FILE="${PACKAGE}_${VERSION}_i386.deb" + WGET_URL="https://download.anydesk.com/linux/$FILE" + else + VERSION=$version + FILE="${PACKAGE}_${VERSION}_i386.deb" + WGET_URL="https://download.anydesk.com/linux/deb/$FILE" +fi + +CUR_DIR=$(pwd) +mkdir -p $TMP_DIR +cd $TMP_DIR +if [ -f $FILE ] + then + echo "Using existing archive file $FILE" + else + action "Fetching the archive" + newline + wget --no-check-certificate $WGET_URL + if [ ! -f $FILE ] + then + cd $CUR_DIR + rm -rf $TMP_DIR + echo "Could not transfer $FILE from $WGET_URL. Exiting." + exit 1 + fi +fi + +# === Convert Debian package to SliTaz package === +action "Converting the package" +newline + +tazpkg convert $FILE +status +VERSION=${VERSION%-*} + +# Remove archive file +rm -f $FILE + +# === Install the SliTaz package === +[ "$install" == "yes" ] && +tazpkg install $PACKAGE-$VERSION.tazpkg --root="$root" + +# === Cleanup === +# Preserve package file, if requested +[ "$keep" == "yes" ] && +( mv $PACKAGE-$VERSION.tazpkg $CUR_DIR && + echo "Saved $PACKAGE-$VERSION.tazpkg to $CUR_DIR" ) + +# Remove temporary build directory +cd $CUR_DIR +rm -rf $TMP_DIR