# HG changeset patch # User Hans-G?nter Theisgen # Date 1617616245 -3600 # Node ID 5baa35df2fab239513e8d0e1198fedeb38e6d3f8 # Parent 1049482a1a193ed173ed8ddad37e00f922dbe502 updated get-teamviewer (1.00 -> 1.01) diff -r 1049482a1a19 -r 5baa35df2fab get-teamviewer/receipt --- a/get-teamviewer/receipt Thu Mar 25 08:56:08 2021 +0100 +++ b/get-teamviewer/receipt Mon Apr 05 10:50:45 2021 +0100 @@ -1,17 +1,16 @@ # SliTaz package receipt. PACKAGE="get-teamviewer" -VERSION="1.00" +VERSION="1.01" CATEGORY="non-free" SHORT_DESC="Get TeamViewer (Remote Control Application)." MAINTAINER="pascal.bellard@slitaz.org" LICENSE="BSD" -WEB_SITE="http://www.teamviewer.com/" +WEB_SITE="https://www.teamviewer.com/" # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { mkdir -p $fs/usr/bin - cp stuff/$PACKAGE $fs/usr/bin + cp stuff/$PACKAGE $fs/usr/bin } - diff -r 1049482a1a19 -r 5baa35df2fab get-teamviewer/stuff/get-teamviewer --- a/get-teamviewer/stuff/get-teamviewer Thu Mar 25 08:56:08 2021 +0100 +++ b/get-teamviewer/stuff/get-teamviewer Mon Apr 05 10:50:45 2021 +0100 @@ -1,45 +1,138 @@ #!/bin/sh -e +# get-teamviewer - create and install SliTaz package teamviewer +# +# (C) 2021 SliTaz - GNU General Public License v3. +# +# Author : +# modified by HGT on 2021-04-05 +# +# === Initialisations === + +PKGS_DB="/var/lib/tazpkg" # packages database directory PACKAGE="teamviewer" -WEB_SITE="http://www.$PACKAGE.com/" -URL=${WEB_SITE}en/download/linux.aspx -DEPENDS="bash alsa-lib zlib xorg-libXext" -ROOT="$1" -[ -d "$ROOT" ] || ROOT="" +CATEGORY="non-free" +WEB_SITE="https://www.teamviewer.com/" +DEPENDS="alsa-lib bash xorg-libXext zlib" -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 +# 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 -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=##x +[ -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 +[ -z "$logfile" ] && LOG=$TMP_DIR/get-$PACKAGE.log + +cat < $PACKAGE/description.txt @@ -51,12 +144,15 @@ cd $PACKAGE-$VERSION/fs [ -e usr/bin/$PACKAGE ] || -ln -s $(cd usr/bin ; ls $PACKAGE* 2> /dev/null) \ + ln -s $(cd usr/bin ; ls $PACKAGE* 2> /dev/null) \ usr/bin/$PACKAGE 2> /dev/null || true mkdir -p usr/share/applications -sed "s|EXEC|/usr/bin/$PACKAGE|g;s!ICON!/$(find opt | grep $PACKAGE.png)!g" \ - < $(find opt | grep -E '(desktop.template|\.desktop$)') \ - > usr/share/applications/$PACKAGE.desktop + +# removed because failing, to be repaired by somebody else: +#sed "s|EXEC|/usr/bin/$PACKAGE|g;s!ICON!/$(find opt | grep $PACKAGE.png)!g" \ +# < $(find opt | grep -E '(desktop.template|\.desktop$)') \ +# > usr/share/applications/$PACKAGE.desktop + sed -i 's/readlink -e/readlink $0 || echo /' \ $(find opt -type f | grep /$PACKAGE$) cd ../.. @@ -66,7 +162,7 @@ PACKAGE="$PACKAGE" VERSION="$VERSION" -CATEGORY="non-free" +CATEGORY="$CATEGORY" SHORT_DESC="$SHORT_DESC" MAINTAINER="$MAINTAINER" DEPENDS="$DEPENDS" @@ -80,19 +176,19 @@ } EOT -# Pack +# === Create the SliTaz package === tazpkg pack $PACKAGE-$VERSION -# Clean to save RAM memory -rm -rf $PACKAGE-$VERSION +# === Install the SliTaz package === +[ "$install" == "yes" ] && +tazpkg install $PACKAGE-$VERSION.tazpkg --root="$root" -# Install pseudo package -tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT -case " $@ " in -*\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;; -esac +# === Cleanup === +# Preserve package file, if requested +[ "$keep" == "yes" ] && +( mv $PACKAGE-$VERSION.tazpkg $CUR_DIR && + echo "Saved $PACKAGE-$VERSION.tazpkg to $CUR_DIR" ) -# Clean +# Remove temporary build directory cd $CUR_DIR rm -rf $TMP_DIR -