wok view get-teamviewer/stuff/get-teamviewer @ rev 20255

firefox, thunderbird: try to force i686
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Mar 13 21:40:37 2018 +0100 (23 months ago)
parents d11fd3e3b9d3
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/;q')
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 find $PACKAGE/fs | grep /script/ | xargs sed -i 's|--append|-a|'
42 # extracted pkg can be removed: Save RAM
43 rm -f $FILE
44 sed '/^Description:/,$!d;s/^Description://' \
45 < $PACKAGE/meta/control > $PACKAGE/description.txt
47 SHORT_DESC="$(sed '/^Description:/!d;s/.*: //' $PACKAGE/meta/control)"
48 MAINTAINER="$(sed '/^Maintainer:/!d;s/.*: //' $PACKAGE/meta/control)"
49 VERSION="$(sed '/^Version:/!d;s/.*: //' $PACKAGE/meta/control)"
50 mv $PACKAGE $PACKAGE-$VERSION
52 cd $PACKAGE-$VERSION/fs
53 [ -e usr/bin/$PACKAGE ] ||
54 ln -s $(cd usr/bin ; ls $PACKAGE* 2> /dev/null) \
55 usr/bin/$PACKAGE 2> /dev/null || true
56 mkdir -p usr/share/applications
57 sed "s|EXEC|/usr/bin/$PACKAGE|g;s!ICON!/$(find opt | grep $PACKAGE.png)!g" \
58 < $(find opt | grep -E '(desktop.template|\.desktop$)') \
59 > usr/share/applications/$PACKAGE.desktop
60 sed -i 's/readlink -e/readlink $0 || echo /' \
61 $(find opt -type f | grep /$PACKAGE$)
62 cd ../..
64 cat > $PACKAGE-$VERSION/receipt <<EOT
65 # SliTaz package receipt.
67 PACKAGE="$PACKAGE"
68 VERSION="$VERSION"
69 CATEGORY="non-free"
70 SHORT_DESC="$SHORT_DESC"
71 MAINTAINER="$MAINTAINER"
72 DEPENDS="$DEPENDS"
73 WEB_SITE="$WEB_SITE"
75 post_install()
76 {
77 cat <<EOF
78 Web viewer (needs flash): https://go.teamviewer.com/v${VERSION%%.*}/
79 EOF
80 }
81 EOT
83 # Pack
84 tazpkg pack $PACKAGE-$VERSION
86 # Clean to save RAM memory
87 rm -rf $PACKAGE-$VERSION
89 # Install pseudo package
90 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
91 case " $@ " in
92 *\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;;
93 esac
95 # Clean
96 cd $CUR_DIR
97 rm -rf $TMP_DIR