wok-stable view get-sjphone/stuff/get-sjphone @ rev 7840

Up: libmicrohttpd to 0.9.4.
author Christopher Rogers <slaxemulator@gmail.com>
date Mon Dec 27 18:56:48 2010 +0000 (2010-12-27)
parents 32959e7975fc
children 80161a03ce21
line source
1 #!/bin/sh -e
3 ROOT="$1"
5 if test $(id -u) != 0 ; then
6 echo -e "\nYou must be root to run `basename $0`."
7 echo -e "Please type 'su' and root password to become super-user.\n"
8 exit 0
9 fi
11 if [ -d $ROOT/var/lib/tazpkg/installed/sjphone ]; then
12 [ -n "$ROOT" ] && exit 1
13 tazpkg remove sjphone
14 [ -d /var/lib/tazpkg/installed/sjphone ] && exit 1
15 fi
17 WEB_SITE="http://www.sjlabs.com/"
18 VERSION="1.60.299"
19 TARBALL="SJphoneLnx-299a.tar.gz"
20 URL="http://www.sjphone.org/softphone/$TARBALL"
22 TMP_DIR=/tmp/get-sjphone-$$-$RANDOM
23 CUR_DIR=$(pwd)
24 mkdir -p $TMP_DIR && cd $TMP_DIR
26 # Download tarball
27 wget $URL
28 if [ ! -f $TARBALL ]; then
29 cd $CUR_DIR
30 rm -rf $TMP_DIR
31 echo "Could not download $TARBALL. Exiting."
32 exit 1
33 fi
35 # Extract
36 tar xzf $TARBALL
38 # extracted pkg can be removed: Save RAM before packing
39 rm -rf $TARBALL
41 # Install files
42 dir=sjphone-$VERSION/fs
43 mkdir -p $dir/usr/bin $dir/usr/share/applications $dir/etc/sjphone
44 mv SJ*/lib $dir/usr/share/sjphone
45 mv SJ*/sjphone $dir/usr/bin
46 ln -s /etc/sjphone/defaults.ini $dir/usr/share/sjphone/defaults.ini
47 sed -i -e 's|WD=.*|WD=/usr/share/sjphone|' -e 's|WD/lib|WD|' \
48 -e 's|ldd|#ldd|' $dir/usr/bin/sjphone
49 cat > $dir/usr/share/applications/sjphone.desktop <<EOT
50 [Desktop Entry]
51 Encoding=UTF-8
52 Name=Softphone SJphone
53 Comment=SIP/H323 softphone (VoIP)
54 Exec=sjphone
55 Icon=/usr/share/sjphone/sjphone.png
56 Type=Application
57 Categories=Application;Network;
58 EOT
60 # Create pseudo package
61 cat > sjphone-$VERSION/receipt <<EOT
62 PACKAGE="sjphone"
63 VERSION="$VERSION"
64 CATEGORY="non-free"
65 SHORT_DESC="SIP/H323 soft phone."
66 WEB_SITE="$WEB_SITE"
67 CONFIG_FILES="/etc/sjphone"
68 DEPENDS="xorg-libICE xorg-libSM xorg-libX11 xorg-libXau xorg-libXdmcp \
69 xorg-libXext"
70 EOT
72 # Pack
73 tazpkg pack sjphone-$VERSION
75 # Clean to save RAM memory
76 rm -rf sjphone-$VERSION
78 # Install pseudo package
79 tazpkg install sjphone-$VERSION.tazpkg --root=$ROOT
81 # Clean
82 cd $CUR_DIR
83 rm -rf $TMP_DIR