wok-6.x view get-skype/stuff/get-skype @ rev 17121
moc: update WGET_URL
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Sep 05 09:11:17 2014 +0200 (2014-09-05) |
parents | d00a8f87ab96 |
children | 0c85739e5ac3 |
line source
1 #!/bin/sh -e
3 ROOT="$1"
4 PACKAGE="skype"
6 if test $(id -u) != 0 ; then
7 echo -e "\nYou must be root to run `basename $0`."
8 echo -e "Please type 'su' and root password to become super-user.\n"
9 exit 0
10 fi
12 if [ -d $ROOT/var/lib/tazpkg/installed/skype ]; then
13 [ -n "$ROOT" ] && exit 1
14 tazpkg remove skype
15 [ -d /var/lib/tazpkg/installed/skype ] && exit 1
16 fi
17 [ -d $ROOT/usr/share/skype ] && rm -rf $ROOT/usr/share/skype
19 TMP_DIR=/tmp/$PACKAGE-$$
20 CUR_DIR=$(pwd)
21 mkdir -p $TMP_DIR && cd $TMP_DIR
23 # Download tarball
24 WEB_SITE="http://www.skype.com/"
25 TARBALL="getskype-linux-beta-dynamic"
26 wget ${WEB_SITE}go/$TARBALL
27 if [ ! -f $TARBALL ]; then
28 echo "Could not download $TARBALL. Exiting."
29 exit 1
30 fi
32 # Extract
33 TARBALL=$(ls $TARBALL skype*.tar.bz2 2> /dev/null || true)
34 tar xjf $TARBALL
35 VERSION=$(ls -d skype-*)
36 VERSION=${VERSION%/}
37 VERSION=${VERSION#skype-*}
39 # extracted pkg can be removed: Save RAM
40 rm -f $TARBALL
42 cd skype-$VERSION
44 # Install files
45 mkdir -p skype-$VERSION/fs/usr/share/skype skype-$VERSION/fs/usr/bin
46 mkdir -p skype-$VERSION/fs/etc skype-$VERSION/fs/usr/share/applications
47 mkdir -p skype-$VERSION/fs/usr/share/pixmaps
48 mkdir -p skype-$VERSION/fs/usr/share/skype
49 mv LICENSE README skype-$VERSION/fs/usr/share/skype
50 mv skype skype-$VERSION/fs/usr/bin
51 mv icons skype-$VERSION/fs/usr/share/skype
52 mv avatars skype-$VERSION/fs/usr/share/skype
53 mv sounds skype-$VERSION/fs/usr/share/skype
54 mv skype.conf skype-$VERSION/fs/etc
55 mv skype.desktop skype-$VERSION/fs/usr/share/applications
56 cd skype-$VERSION/fs/usr/share/pixmaps/
57 ln -s ../skype/icons/SkypeBlue_16x16.png skype.png ; cd -
60 # Create pseudo package
61 cat > skype-$VERSION/receipt <<EOT
62 PACKAGE="skype"
63 VERSION="$VERSION"
64 CATEGORY="non-free"
65 SHORT_DESC="Skype Internet Telephony."
66 WEB_SITE="$WEB_SITE"
67 DEPENDS="libsigc++ xorg-libXv xorg-libXss libv4l bzip2 tiff \
68 qt4-phonon libQtDBus libQtWebkit libQtGui libQtXml libQtCore \
69 gst-plugins-base"
70 CONFIG_FILES="/etc/skype.conf"
72 post_install()
73 {
74 [ -n "\$1" ] && return
76 [ -s /var/lib/dbus/machine-id ] ||
77 dbus-uuidgen > /var/lib/dbus/machine-id
79 # try to fix library versions
80 ldd /usr/bin/skype | sed '/not found/!d;s/ =>.*//' | while read lib; do
81 [ -e /usr/lib/\${lib%.*} ] &&
82 ln -s \${lib%.*} /usr/lib/\$lib &&
83 touch /usr/lib/\$lib-hack-for-skype
84 done
85 }
87 pre_remove()
88 {
89 for lib in /usr/lib/*-hack-by-skype ; do
90 rm -f \$lib \${lib%-hack-for-skype}
91 done
92 }
93 EOT
95 # Pack
96 tazpkg pack skype-$VERSION
98 # Clean to save RAM memory
99 rm -rf $PACKAGE-$VERSION
101 # Install pseudo package
102 tazpkg install skype-$VERSION.tazpkg --root=$ROOT
104 # Clean
105 cd $CUR_DIR
106 rm -rf $TMP_DIR