wok-next view get-teamviewer/stuff/get-teamviewer @ rev 19742
Up alsaplayer and alsa-lib to v2.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Mon Jun 05 19:31:24 2017 +0000 (2017-06-05) |
parents | 7ae80fa5a40a |
children |
line source
1 #!/bin/sh -e
3 PACKAGE="teamviewer"
4 WEB_SITE="http://www.$PACKAGE.com/"
5 URL=${WEB_SITE}en/download/linux.aspx
6 DEPENDS="bash alsa-lib zlib xorg-libXext"
7 ROOT="$1"
8 [ -d "$ROOT" ] || ROOT=""
10 if test $(id -u) != 0 ; then
11 echo -e "\nYou must be root to run `basename $0`."
12 echo -e "Please type 'su' and root password to become super-user.\n"
13 exit 0
14 fi
16 if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then
17 [ -n "$ROOT" ] && exit 1
18 tazpkg remove $PACKAGE
19 [ -d /var/lib/tazpkg/installed/$PACKAGE ] && exit 1
20 fi
22 TMP_DIR=/tmp/get-$PACKAGE-$$-$RANDOM
23 CUR_DIR=$(pwd)
24 mkdir -p $TMP_DIR && cd $TMP_DIR
26 # Download deb
27 URL=$(wget -O - $URL | sed '/i386/!d;s/.*"\([^"]*i386[^"]*\).*/\1/')
28 wget $URL
29 FILE=$(basename $URL)
31 if [ ! -f $FILE ]; then
32 cd $CUR_DIR
33 rm -rf $TMP_DIR
34 echo "Could not download $FILE from $URL. Exiting."
35 exit 1
36 fi
38 mkdir $PACKAGE
39 dpkg-deb -e $FILE $PACKAGE/meta
40 dpkg-deb -x $FILE $PACKAGE/fs
41 # extracted pkg can be removed: Save RAM
42 rm -f $FILE
43 sed '/^Description:/,$!d;s/^Description://' \
44 < $PACKAGE/meta/control > $PACKAGE/description.txt
46 SHORT_DESC="$(sed '/^Description:/!d;s/.*: //' $PACKAGE/meta/control)"
47 MAINTAINER="$(sed '/^Maintainer:/!d;s/.*: //' $PACKAGE/meta/control)"
48 VERSION="$(sed '/^Version:/!d;s/.*: //' $PACKAGE/meta/control)"
49 mv $PACKAGE $PACKAGE-$VERSION
51 cd $PACKAGE-$VERSION/fs
52 [ -e usr/bin/$PACKAGE ] ||
53 ln -s $(cd usr/bin ; ls $PACKAGE* 2> /dev/null) \
54 usr/bin/$PACKAGE 2> /dev/null || true
55 mkdir -p usr/share/applications
56 sed "s|EXEC|/usr/bin/$PACKAGE|g;s!ICON!/$(find opt | grep $PACKAGE.png)!g" \
57 < $(find opt | grep -E '(desktop.template|\.desktop$)') \
58 > usr/share/applications/$PACKAGE.desktop
59 sed -i 's/readlink -e/readlink $0 || echo /' \
60 $(find opt -type f | grep /$PACKAGE$)
61 cd ../..
63 cat > $PACKAGE-$VERSION/receipt <<EOT
64 # SliTaz package receipt.
66 PACKAGE="$PACKAGE"
67 VERSION="$VERSION"
68 CATEGORY="non-free"
69 SHORT_DESC="$SHORT_DESC"
70 MAINTAINER="$MAINTAINER"
71 DEPENDS="$DEPENDS"
72 WEB_SITE="$WEB_SITE"
74 post_install()
75 {
76 cat <<EOF
77 Web viewer (needs flash): https://go.teamviewer.com/v${VERSION%%.*}/
78 EOF
79 }
80 EOT
82 # Pack
83 tazpkg pack $PACKAGE-$VERSION
85 # Clean to save RAM memory
86 rm -rf $PACKAGE-$VERSION
88 # Install pseudo package
89 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
90 case " $@ " in
91 *\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;;
92 esac
94 # Clean
95 cd $CUR_DIR
96 rm -rf $TMP_DIR