wok-6.x view get-wfica/stuff/get-wfica @ rev 11598
dropbear/sshx: add screen support
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Jan 14 11:56:41 2012 +0100 (2012-01-14) |
parents | |
children | 80161a03ce21 |
line source
1 #!/bin/sh -e
3 PACKAGE="wfica"
4 WEB_SITE="http://www.citrix.com"
5 PROD="downloadId=2309164&productId=1689163&ntref=clientcenter"
6 INSTALL_USB=yes
8 ROOT="$1"
9 [ -d "$ROOT" ] || ROOT=""
11 if test $(id -u) != 0 ; then
12 echo -e "\nYou must be root to run `basename $0`."
13 echo -e "Please type 'su' and root password to become super-user.\n"
14 exit 0
15 fi
17 if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then
18 [ -n "$ROOT" ] && exit 1
19 tazpkg remove $PACKAGE
20 [ -d /var/lib/tazpkg/installed/$PACKAGE ] && exit 1
21 fi
23 TMP_DIR=/tmp/get-$PACKAGE-$$-$RANDOM
24 CUR_DIR=$(pwd)
25 mkdir -p $TMP_DIR && cd $TMP_DIR
27 URL="$WEB_SITE$(wget -O - "$WEB_SITE/English/ss/downloads/details.asp?$PROD" | \
28 sed "/Download/h;/\.deb/!dg;s/.*([\"']\([^\"']*\).*/\1/;q")"
30 wget -O $PACKAGE.deb "$URL"
31 mkdir $PACKAGE
32 dpkg-deb -e $PACKAGE.deb $PACKAGE/meta
33 dpkg-deb -x $PACKAGE.deb $PACKAGE/fs
34 rm -f $PACKAGE.deb
35 sed '/^Description:/,$!d;s/^Description://' \
36 < $PACKAGE/meta/control > $PACKAGE/description.txt
38 SHORT_DESC="$(sed '/^Description:/!d;s/.*: //' $PACKAGE/meta/control)"
39 MAINTAINER="$(sed '/^Maintainer:/!d;s/.*: //' $PACKAGE/meta/control)"
40 VERSION="$(sed '/^Version:/!d;s/.*: //' $PACKAGE/meta/control)"
41 mv $PACKAGE $PACKAGE-$VERSION
43 cd $PACKAGE-$VERSION/fs
44 mkdir -p usr/share/applications usr/bin
45 cat > usr/bin/wfica_assoc.sh <<EOT
46 #!/bin/sh
48 ICAROOT=/usr/lib/ICAClient
49 export ICAROOT
50 \$ICAROOT/wfica -associate -fileparam \$1
51 EOT
52 cat > usr/bin/wfica.sh <<EOT
53 #!/bin/sh
55 ICAROOT=/usr/lib/ICAClient
56 export ICAROOT
57 \$ICAROOT/wfica -file \$1
58 EOT
59 chmod +x usr/bin/wfica.sh usr/bin/wfica_assoc.sh
60 cat > usr/share/applications/wfcmgr.desktop <<EOT
61 [Desktop Entry]
62 Encoding=UTF-8
63 Version=1.0
64 Type=Application
65 Name=Citrix Receiver
66 Icon=/usr/lib/ICAClient/icons/manager.png
67 TryExec=/usr/lib/ICAClient/wfcmgr
68 Exec=/usr/lib/ICAClient/wfcmgr -icaroot /usr/lib/ICAClient
69 Terminal=false
70 Categories=Application;Network
71 EOT
72 ln -s ../lib/ICAClient/wfica usr/bin
73 ln -s ../lib/ICAClient/wfcmgr usr/bin
75 if [ "$INSTALL_USB" == "yes" ]; then
76 dpkg-deb -x usr/lib/ICAClient/ctxusb*.deb .
77 chmod 500 usr/lib/ICAClient/ctxusbd
78 chmod 4555 usr/lib/ICAClient/ctxusb
79 chmod 444 usr/lib/ICAClient/usb.conf
80 chmod 700 etc/init.d/ctxusbd
81 [ -s usr/lib/ICAClient/config/module.ini ] ||
82 cat > usr/lib/ICAClient/config/module.ini <<EOT
83 [File Type Associations]
84 [KeyboardLayout]
85 [KeyboardType]
86 EOT
87 sed -i -e 's/^[ \t]*VirtualDriver[ \t]*=.*$/&, GenericUSB/' \
88 -e '/\[ICA 3.0\]/a\GenericUSB=on' usr/lib/ICAClient/config/module.ini
89 cat >> usr/lib/ICAClient/config/module.ini <<EOT
90 [GenericUSB]
91 DriverName = VDGUSB.DLL
92 EOT
93 fi
95 cd ../..
97 cat > $PACKAGE-$VERSION/receipt <<EOT
98 # SliTaz package receipt.
100 PACKAGE="$PACKAGE"
101 VERSION="$VERSION"
102 CATEGORY="non-free"
103 SHORT_DESC="$SHORT_DESC"
104 MAINTAINER="$MAINTAINER"
105 DEPENDS="openmotif"
106 SUGGESTED="glib gstreamer speex libvorbis"
107 WEB_SITE="$WEB_SITE/"
108 CONFIG_FILES="/usr/lib/ICAClient/config /usr/lib/ICAClient/nls"
109 EOT
111 # Pack
112 tazpkg pack $PACKAGE-$VERSION
114 # Clean to save RAM memory
115 rm -rf $PACKAGE-$VERSION
117 # Install pseudo package
118 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
119 case " $@ " in
120 *\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;;
121 esac
123 # Clean
124 cd $CUR_DIR
125 rm -rf $TMP_DIR