wok 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 e3c22d144bcf
children 417fb4d5aca5
files get-wfica/receipt get-wfica/stuff/get-wfica
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/get-wfica/receipt	Wed Oct 12 17:56:40 2011 +0200
     1.3 @@ -0,0 +1,16 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="get-wfica"
     1.7 +VERSION="1.00"
     1.8 +CATEGORY="non-free"
     1.9 +SHORT_DESC="Get Citrix ICA Client."
    1.10 +MAINTAINER="pascal.bellard@slitaz.org"
    1.11 +WEB_SITE="http://www.citrix.com/"
    1.12 +
    1.13 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.14 +genpkg_rules()
    1.15 +{
    1.16 +	mkdir -p $fs/usr/bin
    1.17 +	cp $stuff/$PACKAGE $fs/usr/bin
    1.18 +}
    1.19 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/get-wfica/stuff/get-wfica	Wed Oct 12 17:56:40 2011 +0200
     2.3 @@ -0,0 +1,126 @@
     2.4 +#!/bin/sh -e
     2.5 +
     2.6 +PACKAGE="wfica"
     2.7 +WEB_SITE="http://www.citrix.com"
     2.8 +PROD="downloadId=2309164&productId=1689163&ntref=clientcenter"
     2.9 +INSTALL_USB=yes
    2.10 +
    2.11 +ROOT="$1"
    2.12 +[ -d "$ROOT" ] || ROOT=""
    2.13 +
    2.14 +if test $(id -u) != 0 ; then
    2.15 +        echo -e "\nYou must be root to run `basename $0`."
    2.16 +        echo -e "Please type 'su' and root password to become super-user.\n"
    2.17 +        exit 0
    2.18 +fi
    2.19 +
    2.20 +if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then
    2.21 +	[ -n "$ROOT" ] && exit 1
    2.22 +	tazpkg remove $PACKAGE
    2.23 +	[ -d /var/lib/tazpkg/installed/$PACKAGE ] && exit 1
    2.24 +fi
    2.25 +
    2.26 +TMP_DIR=/tmp/get-$PACKAGE-$$-$RANDOM
    2.27 +CUR_DIR=$(pwd)
    2.28 +mkdir -p $TMP_DIR && cd $TMP_DIR
    2.29 +
    2.30 +URL="$WEB_SITE$(wget -O - "$WEB_SITE/English/ss/downloads/details.asp?$PROD" | \
    2.31 +		sed "/Download/h;/\.deb/!dg;s/.*([\"']\([^\"']*\).*/\1/;q")"
    2.32 +
    2.33 +wget -O $PACKAGE.deb "$URL"
    2.34 +mkdir $PACKAGE
    2.35 +dpkg-deb -e $PACKAGE.deb $PACKAGE/meta
    2.36 +dpkg-deb -x $PACKAGE.deb $PACKAGE/fs
    2.37 +rm -f $PACKAGE.deb
    2.38 +sed '/^Description:/,$!d;s/^Description://' \
    2.39 +	< $PACKAGE/meta/control > $PACKAGE/description.txt
    2.40 +
    2.41 +SHORT_DESC="$(sed '/^Description:/!d;s/.*: //' $PACKAGE/meta/control)"
    2.42 +MAINTAINER="$(sed '/^Maintainer:/!d;s/.*: //' $PACKAGE/meta/control)"
    2.43 +VERSION="$(sed '/^Version:/!d;s/.*: //' $PACKAGE/meta/control)"
    2.44 +mv $PACKAGE $PACKAGE-$VERSION
    2.45 +
    2.46 +cd $PACKAGE-$VERSION/fs
    2.47 +mkdir -p usr/share/applications usr/bin
    2.48 +cat > usr/bin/wfica_assoc.sh <<EOT
    2.49 +#!/bin/sh
    2.50 +
    2.51 +ICAROOT=/usr/lib/ICAClient
    2.52 +export ICAROOT
    2.53 +\$ICAROOT/wfica -associate -fileparam \$1
    2.54 +EOT
    2.55 +cat > usr/bin/wfica.sh <<EOT
    2.56 +#!/bin/sh
    2.57 +
    2.58 +ICAROOT=/usr/lib/ICAClient
    2.59 +export ICAROOT
    2.60 +\$ICAROOT/wfica -file \$1
    2.61 +EOT
    2.62 +chmod +x usr/bin/wfica.sh usr/bin/wfica_assoc.sh
    2.63 +cat > usr/share/applications/wfcmgr.desktop <<EOT
    2.64 +[Desktop Entry]
    2.65 +Encoding=UTF-8
    2.66 +Version=1.0
    2.67 +Type=Application
    2.68 +Name=Citrix Receiver
    2.69 +Icon=/usr/lib/ICAClient/icons/manager.png
    2.70 +TryExec=/usr/lib/ICAClient/wfcmgr
    2.71 +Exec=/usr/lib/ICAClient/wfcmgr -icaroot /usr/lib/ICAClient
    2.72 +Terminal=false
    2.73 +Categories=Application;Network
    2.74 +EOT
    2.75 +ln -s ../lib/ICAClient/wfica usr/bin
    2.76 +ln -s ../lib/ICAClient/wfcmgr usr/bin
    2.77 +
    2.78 +if [ "$INSTALL_USB" == "yes" ]; then
    2.79 +	dpkg-deb -x usr/lib/ICAClient/ctxusb*.deb .
    2.80 +	chmod 500 usr/lib/ICAClient/ctxusbd
    2.81 +	chmod 4555 usr/lib/ICAClient/ctxusb
    2.82 +	chmod 444 usr/lib/ICAClient/usb.conf
    2.83 +	chmod 700 etc/init.d/ctxusbd
    2.84 +	[ -s usr/lib/ICAClient/config/module.ini ] ||
    2.85 +	cat > usr/lib/ICAClient/config/module.ini <<EOT
    2.86 +[File Type Associations]
    2.87 +[KeyboardLayout]
    2.88 +[KeyboardType]
    2.89 +EOT
    2.90 +	sed -i  -e 's/^[ \t]*VirtualDriver[ \t]*=.*$/&, GenericUSB/' \
    2.91 +	  -e '/\[ICA 3.0\]/a\GenericUSB=on' usr/lib/ICAClient/config/module.ini
    2.92 +	cat >> usr/lib/ICAClient/config/module.ini <<EOT
    2.93 +[GenericUSB]
    2.94 +DriverName = VDGUSB.DLL
    2.95 +EOT
    2.96 +fi
    2.97 +
    2.98 +cd ../..
    2.99 +
   2.100 +cat > $PACKAGE-$VERSION/receipt <<EOT
   2.101 +# SliTaz package receipt.
   2.102 +
   2.103 +PACKAGE="$PACKAGE"
   2.104 +VERSION="$VERSION"
   2.105 +CATEGORY="non-free"
   2.106 +SHORT_DESC="$SHORT_DESC"
   2.107 +MAINTAINER="$MAINTAINER"
   2.108 +DEPENDS="openmotif"
   2.109 +SUGGESTED="glib gstreamer speex libvorbis"
   2.110 +WEB_SITE="$WEB_SITE/"
   2.111 +CONFIG_FILES="/usr/lib/ICAClient/config /usr/lib/ICAClient/nls"
   2.112 +EOT
   2.113 +
   2.114 +# Pack
   2.115 +tazpkg pack $PACKAGE-$VERSION
   2.116 +
   2.117 +# Clean to save RAM memory
   2.118 +rm -rf $PACKAGE-$VERSION
   2.119 +
   2.120 +# Install pseudo package
   2.121 +tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
   2.122 +case " $@ " in
   2.123 +*\ --k*) mv $PACKAGE-$VERSION.tazpkg $CUR_DIR ;;
   2.124 +esac
   2.125 +
   2.126 +# Clean
   2.127 +cd $CUR_DIR
   2.128 +rm -rf $TMP_DIR
   2.129 +