wok diff get-wfica/stuff/get-wfica @ rev 10969

Add get-wfica
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Oct 12 17:56:40 2011 +0200 (2011-10-12)
parents
children 80161a03ce21
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/get-wfica/stuff/get-wfica	Wed Oct 12 17:56:40 2011 +0200
     1.3 @@ -0,0 +1,126 @@
     1.4 +#!/bin/sh -e
     1.5 +
     1.6 +PACKAGE="wfica"
     1.7 +WEB_SITE="http://www.citrix.com"
     1.8 +PROD="downloadId=2309164&productId=1689163&ntref=clientcenter"
     1.9 +INSTALL_USB=yes
    1.10 +
    1.11 +ROOT="$1"
    1.12 +[ -d "$ROOT" ] || ROOT=""
    1.13 +
    1.14 +if test $(id -u) != 0 ; then
    1.15 +        echo -e "\nYou must be root to run `basename $0`."
    1.16 +        echo -e "Please type 'su' and root password to become super-user.\n"
    1.17 +        exit 0
    1.18 +fi
    1.19 +
    1.20 +if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then
    1.21 +	[ -n "$ROOT" ] && exit 1
    1.22 +	tazpkg remove $PACKAGE
    1.23 +	[ -d /var/lib/tazpkg/installed/$PACKAGE ] && exit 1
    1.24 +fi
    1.25 +
    1.26 +TMP_DIR=/tmp/get-$PACKAGE-$$-$RANDOM
    1.27 +CUR_DIR=$(pwd)
    1.28 +mkdir -p $TMP_DIR && cd $TMP_DIR
    1.29 +
    1.30 +URL="$WEB_SITE$(wget -O - "$WEB_SITE/English/ss/downloads/details.asp?$PROD" | \
    1.31 +		sed "/Download/h;/\.deb/!dg;s/.*([\"']\([^\"']*\).*/\1/;q")"
    1.32 +
    1.33 +wget -O $PACKAGE.deb "$URL"
    1.34 +mkdir $PACKAGE
    1.35 +dpkg-deb -e $PACKAGE.deb $PACKAGE/meta
    1.36 +dpkg-deb -x $PACKAGE.deb $PACKAGE/fs
    1.37 +rm -f $PACKAGE.deb
    1.38 +sed '/^Description:/,$!d;s/^Description://' \
    1.39 +	< $PACKAGE/meta/control > $PACKAGE/description.txt
    1.40 +
    1.41 +SHORT_DESC="$(sed '/^Description:/!d;s/.*: //' $PACKAGE/meta/control)"
    1.42 +MAINTAINER="$(sed '/^Maintainer:/!d;s/.*: //' $PACKAGE/meta/control)"
    1.43 +VERSION="$(sed '/^Version:/!d;s/.*: //' $PACKAGE/meta/control)"
    1.44 +mv $PACKAGE $PACKAGE-$VERSION
    1.45 +
    1.46 +cd $PACKAGE-$VERSION/fs
    1.47 +mkdir -p usr/share/applications usr/bin
    1.48 +cat > usr/bin/wfica_assoc.sh <<EOT
    1.49 +#!/bin/sh
    1.50 +
    1.51 +ICAROOT=/usr/lib/ICAClient
    1.52 +export ICAROOT
    1.53 +\$ICAROOT/wfica -associate -fileparam \$1
    1.54 +EOT
    1.55 +cat > usr/bin/wfica.sh <<EOT
    1.56 +#!/bin/sh
    1.57 +
    1.58 +ICAROOT=/usr/lib/ICAClient
    1.59 +export ICAROOT
    1.60 +\$ICAROOT/wfica -file \$1
    1.61 +EOT
    1.62 +chmod +x usr/bin/wfica.sh usr/bin/wfica_assoc.sh
    1.63 +cat > usr/share/applications/wfcmgr.desktop <<EOT
    1.64 +[Desktop Entry]
    1.65 +Encoding=UTF-8
    1.66 +Version=1.0
    1.67 +Type=Application
    1.68 +Name=Citrix Receiver
    1.69 +Icon=/usr/lib/ICAClient/icons/manager.png
    1.70 +TryExec=/usr/lib/ICAClient/wfcmgr
    1.71 +Exec=/usr/lib/ICAClient/wfcmgr -icaroot /usr/lib/ICAClient
    1.72 +Terminal=false
    1.73 +Categories=Application;Network
    1.74 +EOT
    1.75 +ln -s ../lib/ICAClient/wfica usr/bin
    1.76 +ln -s ../lib/ICAClient/wfcmgr usr/bin
    1.77 +
    1.78 +if [ "$INSTALL_USB" == "yes" ]; then
    1.79 +	dpkg-deb -x usr/lib/ICAClient/ctxusb*.deb .
    1.80 +	chmod 500 usr/lib/ICAClient/ctxusbd
    1.81 +	chmod 4555 usr/lib/ICAClient/ctxusb
    1.82 +	chmod 444 usr/lib/ICAClient/usb.conf
    1.83 +	chmod 700 etc/init.d/ctxusbd
    1.84 +	[ -s usr/lib/ICAClient/config/module.ini ] ||
    1.85 +	cat > usr/lib/ICAClient/config/module.ini <<EOT
    1.86 +[File Type Associations]
    1.87 +[KeyboardLayout]
    1.88 +[KeyboardType]
    1.89 +EOT
    1.90 +	sed -i  -e 's/^[ \t]*VirtualDriver[ \t]*=.*$/&, GenericUSB/' \
    1.91 +	  -e '/\[ICA 3.0\]/a\GenericUSB=on' usr/lib/ICAClient/config/module.ini
    1.92 +	cat >> usr/lib/ICAClient/config/module.ini <<EOT
    1.93 +[GenericUSB]
    1.94 +DriverName = VDGUSB.DLL
    1.95 +EOT
    1.96 +fi
    1.97 +
    1.98 +cd ../..
    1.99 +
   1.100 +cat > $PACKAGE-$VERSION/receipt <<EOT
   1.101 +# SliTaz package receipt.
   1.102 +
   1.103 +PACKAGE="$PACKAGE"
   1.104 +VERSION="$VERSION"
   1.105 +CATEGORY="non-free"
   1.106 +SHORT_DESC="$SHORT_DESC"
   1.107 +MAINTAINER="$MAINTAINER"
   1.108 +DEPENDS="openmotif"
   1.109 +SUGGESTED="glib gstreamer speex libvorbis"
   1.110 +WEB_SITE="$WEB_SITE/"
   1.111 +CONFIG_FILES="/usr/lib/ICAClient/config /usr/lib/ICAClient/nls"
   1.112 +EOT
   1.113 +
   1.114 +# Pack
   1.115 +tazpkg pack $PACKAGE-$VERSION
   1.116 +
   1.117 +# Clean to save RAM memory
   1.118 +rm -rf $PACKAGE-$VERSION
   1.119 +
   1.120 +# Install pseudo package
   1.121 +tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
   1.122 +case " $@ " in
   1.123 +*\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;;
   1.124 +esac
   1.125 +
   1.126 +# Clean
   1.127 +cd $CUR_DIR
   1.128 +rm -rf $TMP_DIR
   1.129 +