wok rev 10968
Add get-teamviewer
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Oct 12 17:41:12 2011 +0200 (2011-10-12) |
parents | bacf9313d933 |
children | cf2c63e03e4e |
files | get-teamviewer/receipt get-teamviewer/stuff/get-teamviewer |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/get-teamviewer/receipt Wed Oct 12 17:41:12 2011 +0200 1.3 @@ -0,0 +1,16 @@ 1.4 +# SliTaz package receipt. 1.5 + 1.6 +PACKAGE="get-teamviewer" 1.7 +VERSION="1.00" 1.8 +CATEGORY="non-free" 1.9 +SHORT_DESC="Get TeamViewer (Remote Control Application)." 1.10 +MAINTAINER="pascal.bellard@slitaz.org" 1.11 +WEB_SITE="http://www.teamviewer.com/" 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/$PACKAGE $fs/usr/bin 1.18 +} 1.19 +
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/get-teamviewer/stuff/get-teamviewer Wed Oct 12 17:41:12 2011 +0200 2.3 @@ -0,0 +1,85 @@ 2.4 +#!/bin/sh -e 2.5 + 2.6 +PACKAGE="teamviewer" 2.7 +WEB_SITE="http://www.$PACKAGE.com/" 2.8 +URL=${WEB_SITE}download/${PACKAGE}_linux.deb 2.9 +DEPENDS="bash alsa-lib zlib xorg-libXext" 2.10 +ROOT="$1" 2.11 +[ -d "$ROOT" ] || ROOT="" 2.12 + 2.13 +if test $(id -u) != 0 ; then 2.14 + echo -e "\nYou must be root to run `basename $0`." 2.15 + echo -e "Please type 'su' and root password to become super-user.\n" 2.16 + exit 0 2.17 +fi 2.18 + 2.19 +if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then 2.20 + [ -n "$ROOT" ] && exit 1 2.21 + tazpkg remove $PACKAGE 2.22 + [ -d /var/lib/tazpkg/installed/$PACKAGE ] && exit 1 2.23 +fi 2.24 + 2.25 +TMP_DIR=/tmp/get-$PACKAGE-$$-$RANDOM 2.26 +CUR_DIR=$(pwd) 2.27 +mkdir -p $TMP_DIR && cd $TMP_DIR 2.28 + 2.29 +# Download deb 2.30 +wget $URL 2.31 +FILE=$(basename $URL) 2.32 + 2.33 +if [ ! -f $FILE ]; then 2.34 + cd $CUR_DIR 2.35 + rm -rf $TMP_DIR 2.36 + echo "Could not download $FILE from $URL. Exiting." 2.37 + exit 1 2.38 +fi 2.39 + 2.40 +mkdir $PACKAGE 2.41 +dpkg-deb -e $FILE $PACKAGE/meta 2.42 +dpkg-deb -x $FILE $PACKAGE/fs 2.43 +# extracted pkg can be removed: Save RAM 2.44 +rm -f $FILE 2.45 +sed '/^Description:/,$!d;s/^Description://' \ 2.46 + < $PACKAGE/meta/control > $PACKAGE/description.txt 2.47 + 2.48 +SHORT_DESC="$(sed '/^Description:/!d;s/.*: //' $PACKAGE/meta/control)" 2.49 +MAINTAINER="$(sed '/^Maintainer:/!d;s/.*: //' $PACKAGE/meta/control)" 2.50 +VERSION="$(sed '/^Version:/!d;s/.*: //' $PACKAGE/meta/control)" 2.51 +mv $PACKAGE $PACKAGE-$VERSION 2.52 + 2.53 +cd $PACKAGE-$VERSION/fs 2.54 +ln -s $(cd usr/bin ; ls $PACKAGE*) usr/bin/$PACKAGE 2.55 +mkdir -p usr/share/applications 2.56 +sed "s|EXEC|/usr/bin/$PACKAGE|g;s!ICON!/$(find opt | grep $PACKAGE.png)!g" \ 2.57 + < $(find opt | grep desktop.template) \ 2.58 + > usr/share/applications/$PACKAGE.desktop 2.59 +cd ../.. 2.60 + 2.61 +cat > $PACKAGE-$VERSION/receipt <<EOT 2.62 +# SliTaz package receipt. 2.63 + 2.64 +PACKAGE="$PACKAGE" 2.65 +VERSION="$VERSION" 2.66 +CATEGORY="non-free" 2.67 +SHORT_DESC="$SHORT_DESC" 2.68 +MAINTAINER="$MAINTAINER" 2.69 +DEPENDS="$DEPENDS" 2.70 +WEB_SITE="$WEB_SITE" 2.71 +EOT 2.72 + 2.73 +# Pack 2.74 +tazpkg pack $PACKAGE-$VERSION 2.75 + 2.76 +# Clean to save RAM memory 2.77 +rm -rf $PACKAGE-$VERSION 2.78 + 2.79 +# Install pseudo package 2.80 +tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT 2.81 +case " $@ " in 2.82 +*\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;; 2.83 +esac 2.84 + 2.85 +# Clean 2.86 +cd $CUR_DIR 2.87 +rm -rf $TMP_DIR 2.88 +