#! /bin/bash #---------------------------------------------------------------------- # Copyright(C) 2007 COD Technologies Ltd. All rights reserved. # Information on this script can be found at: # http://codtech.com/wiki/index.php/Citrix_ICA_Client_10_on_Ubuntu # # Author: Diego Torres Milano # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, # USA #---------------------------------------------------------------------- VERSION="0.9" function confirm() { read -p "${1:-Confirm} [y/N] ?: " REPLY case "$REPLY" in y|Y) return 0 ;; *) return 1 ;; esac } function check_deb() { local deb="$1" if [ -z "$deb" ] then echo "$PROGNAME: Missing argument for check_deb" >&2 exit 1 fi dpkg --status "$deb" >/dev/null } function citrix_icaclient_10_ubuntu_6_10() { local REQUIRED="libmotif3 libxp6 libxpm4 libsm6 libice6 libxmu6 libxt6 libxau6 libxdmcp6" local MISSING=0 for DEB in ${REQUIRED} do check_deb $DEB || MISSING=1 done if [ "$MISSING" -eq 1 ] then echo "$PROGNAME: Missing packages." >&2 echo "Install them and proceed again." >&2 exit 1 fi cd ${ICAROOT} || { echo "$PROGNAME: error changing directory to $ICAROOT"; exit 1; } echo "Using ICAROOT=$ICAROOT" WFCMGR=${ICAROOT}/nls/en/UTF-8/Wfcmgr if [ ! -r "$WFCMGR" ] then echo "$PROGNAME: cannot access '$WFCMGR'" >&2 exit 1 fi PATCH=$(which patch) if [ -z "$PATCH" ] then echo "$PROGNAME: cannot find 'patch'. You need to install it." echo ".i.e: apt-get install patch" exit 1 fi if file -b wfica | grep -q ELF then mv wfica wfica.bin fi $PATCH -b -p1 <<'EOF' --- ./nls/en/UTF-8/Wfcmgr.ORI 2007-04-10 10:06:04.000000000 +0200 +++ ./nls/en/UTF-8/Wfcmgr 2007-04-09 22:53:41.000000000 +0200 @@ -1561,19 +1561,35 @@ ! Font specification ! +! by DTM +! Mon Apr 9 22:48:10 CEST 2007 +! some lines removed following the comment in readme.txt file about +! Debian/Ubuntu systems +! (these are the preserved lines) +! +! Wfcmgr*fontList:\ +! -gnu-*-*-*-*-*-*-120-*-*-*-*-iso10646-1;\ +! -*-gothic-medium-r-normal-*-*-120-*-*-*-*-ksc5601.1987-0;\ +! -*-helvetica-medium-r-*-*-*-120-75-75-*-*-iso8859-1;\ +! -*-ming-*-*-*-*-*-140-*-*-*-*-big5-0;\ +! -isas-fangsong ti-medium-r-normal--16-160-72-72-c-160-gb2312.1980-0;\ +! -*-helvetica-medium-r-normal--0-*-75-75-p-*-koi8-r;\ +! -*-helvetica-medium-r-*-*-*-120-75-75-*-*-iso8859-6;\ +! -*-arial-medium-r-*-*-*-120-75-75-*-*-iso8859-6;\ +! -*-kacstbook-medium-r-*-*-*-120-75-75-*-*-iso8859-6;\ +! -*-helvetica-medium-r-*-*-*-120-75-75-*-*-*-*;\ +! -*-*-medium-r-*-*-*-120-75-75-*-*-*-*;\ +! -*-*-medium-r-*-*-*-120-*-*-*-*-*-*: + Wfcmgr*fontList:\ --gnu-*-*-*-*-*-*-120-*-*-*-*-iso10646-1;\ -*-gothic-medium-r-normal-*-*-120-*-*-*-*-ksc5601.1987-0;\ --*-helvetica-medium-r-*-*-*-120-75-75-*-*-iso8859-1;\ -*-ming-*-*-*-*-*-140-*-*-*-*-big5-0;\ -isas-fangsong ti-medium-r-normal--16-160-72-72-c-160-gb2312.1980-0;\ -*-helvetica-medium-r-normal--0-*-75-75-p-*-koi8-r;\ -*-helvetica-medium-r-*-*-*-120-75-75-*-*-iso8859-6;\ -*-arial-medium-r-*-*-*-120-75-75-*-*-iso8859-6;\ -*-kacstbook-medium-r-*-*-*-120-75-75-*-*-iso8859-6;\ --*-helvetica-medium-r-*-*-*-120-75-75-*-*-*-*;\ --*-*-medium-r-*-*-*-120-75-75-*-*-*-*;\ --*-*-medium-r-*-*-*-120-*-*-*-*-*-*: +-*-helvetica-medium-r-*-*-*-120-75-75-*-*-*-*: Wfcmgr*XmList.translations: #augment \n\ : ListPrevItem()\n\ --- ./desktop/wfcmgr.desktop.ORI 2007-04-09 22:21:22.000000000 +0200 +++ ./desktop/wfcmgr.desktop 2007-04-12 13:45:12.000000000 +0200 @@ -8,4 +8,4 @@ Categories=Application;Network;X-Red-Hat-Base;X-SuSE-Core-Internet; Icon=/usr/lib/ICAClient/icons/manager.xpm TryExec=/usr/lib/ICAClient/wfcmgr -Exec=/usr/lib/ICAClient/wfcmgr -icaroot /usr/lib/ICAClient +Exec=/bin/sh -c 'xset fp rehash; /usr/lib/ICAClient/wfcmgr -icaroot /usr/lib/ICAClient' --- ./wfica.sh.ORI 2007-04-09 22:21:22.000000000 +0200 +++ ./wfica.sh 2007-04-13 11:11:35.000000000 +0200 @@ -1,4 +1,9 @@ #!/bin/sh +# This file has been modified by citric-icaclient-10-ubuntu +# Information on this script can be found at: +# http://codtech.com/wiki/index.php/Citrix_ICA_Client_10_on_Ubuntu + ICAROOT=/usr/lib/ICAClient export ICAROOT +xset fp rehash >/dev/null 2>&1 $ICAROOT/wfica -file $1 --- ./wfica.ORI 2007-04-13 11:08:32.000000000 +0200 +++ ./wfica 2007-04-13 11:12:30.000000000 +0200 @@ -0,0 +1,7 @@ +#! /bin/sh +# This file has been modified by citric-icaclient-10-ubuntu +# Information on this script can be found at: +# http://codtech.com/wiki/index.php/Citrix_ICA_Client_10_on_Ubuntu + +xset fp rehash >/dev/null 2>&1 +exec ${0}.bin "$@" --- ./wfica_assoc.sh.ORI 2007-04-09 22:21:22.000000000 +0200 +++ ./wfica_assoc.sh 2007-04-13 11:12:03.000000000 +0200 @@ -1,4 +1,9 @@ #!/bin/sh +# This file has been modified by citric-icaclient-10-ubuntu +# Information on this script can be found at: +# http://codtech.com/wiki/index.php/Citrix_ICA_Client_10_on_Ubuntu + ICAROOT=/usr/lib/ICAClient export ICAROOT +xset fp rehash >/dev/null 2>&1 $ICAROOT/wfica -associate -fileparam $1 EOF if [ $? != 0 ] then echo "$PROGNAME: problems patching files." exit 1 fi xset fp rehash chmod a+rx wfica echo "DONE" } function citrix_icaclient_10_ubuntu_7_04() { local REQUIRED="libmotif3 libxp6 libxpm4 libsm6 libice6 libxmu6 libxt6 libxau6 libxdmcp6" local MISSING=0 for DEB in ${REQUIRED} do check_deb $DEB || MISSING=1 done if [ "$MISSING" -eq 1 ] then echo "$PROGNAME: Missing packages." >&2 echo "Install them and proceed again." >&2 exit 1 fi cd ${ICAROOT} || { echo "$PROGNAME: error changing directory to $ICAROOT"; exit 1; } echo "Using ICAROOT=$ICAROOT" WFCMGR=${ICAROOT}/nls/en/UTF-8/Wfcmgr if [ ! -r "$WFCMGR" ] then echo "$PROGNAME: cannot access '$WFCMGR'" >&2 exit 1 fi PATCH=$(which patch) if [ -z "$PATCH" ] then echo "$PROGNAME: cannot find 'patch'. You need to install it." echo ".i.e: apt-get install patch" exit 1 fi $PATCH -b -p1 <<'EOF' --- ./nls/en/UTF-8/Wfcmgr.ORI 2007-04-23 09:40:35.000000000 +0200 +++ ./nls/en/UTF-8/Wfcmgr 2007-04-23 10:04:58.000000000 +0200 @@ -1562,6 +1562,7 @@ ! Wfcmgr*fontList:\ +-adobe-helvetica-medium-r-normal--12-120-75-75-p-0-*-*;\ -gnu-*-*-*-*-*-*-120-*-*-*-*-iso10646-1;\ -*-gothic-medium-r-normal-*-*-120-*-*-*-*-ksc5601.1987-0;\ -*-helvetica-medium-r-*-*-*-120-75-75-*-*-iso8859-1;\ --- ./nls/en/Wfcmgr.ORI 2007-04-23 09:40:35.000000000 +0200 +++ ./nls/en/Wfcmgr 2007-04-23 10:10:16.000000000 +0200 @@ -1562,6 +1562,7 @@ ! Wfcmgr*fontList:\ +-adobe-helvetica-medium-r-normal--12-120-75-75-p-0-*-*;\ -gnu-*-*-*-*-*-*-120-*-*-*-*-iso10646-1;\ -*-gothic-medium-r-normal-*-*-120-*-*-*-*-ksc5601.1987-0;\ -*-helvetica-medium-r-*-*-*-120-75-75-*-*-iso8859-1;\ EOF echo "DONE" } function citrix_icaclient_10_ubuntu_7_10() { local REQUIRED="libmotif3 libxp6 libxpm4 libsm6 libice6 libxmu6 libxt6 libxau6 libxdmcp6" local MISSING=0 for DEB in ${REQUIRED} do check_deb $DEB || MISSING=1 done if [ "$MISSING" -eq 1 ] then echo "$PROGNAME: Missing packages." >&2 echo "Install them and proceed again." >&2 exit 1 fi cd ${ICAROOT} || { echo "$PROGNAME: error changing directory to $ICAROOT"; exit 1; } echo "Using ICAROOT=$ICAROOT" WFCMGR=${ICAROOT}/nls/en/UTF-8/Wfcmgr case "$ICACLIENTVERSION" in 10.0) if [ ! -r "$WFCMGR" ] then echo "$PROGNAME: cannot access '$WFCMGR'" >&2 exit 1 fi PATCH=$(which patch) if [ -z "$PATCH" ] then echo "$PROGNAME: cannot find 'patch'. You need to install it." echo ".i.e: apt-get install patch" exit 1 fi $PATCH -b -p1 <<'EOF' --- ./nls/en/UTF-8/Wfcmgr.ORI 2007-04-23 09:40:35.000000000 +0200 +++ ./nls/en/UTF-8/Wfcmgr 2007-04-23 10:04:58.000000000 +0200 @@ -1562,6 +1562,7 @@ ! Wfcmgr*fontList:\ +-adobe-helvetica-medium-r-normal--12-120-75-75-p-0-*-*;\ -gnu-*-*-*-*-*-*-120-*-*-*-*-iso10646-1;\ -*-gothic-medium-r-normal-*-*-120-*-*-*-*-ksc5601.1987-0;\ -*-helvetica-medium-r-*-*-*-120-75-75-*-*-iso8859-1;\ --- ./nls/en/Wfcmgr.ORI 2007-04-23 09:40:35.000000000 +0200 +++ ./nls/en/Wfcmgr 2007-04-23 10:10:16.000000000 +0200 @@ -1562,6 +1562,7 @@ ! Wfcmgr*fontList:\ +-adobe-helvetica-medium-r-normal--12-120-75-75-p-0-*-*;\ -gnu-*-*-*-*-*-*-120-*-*-*-*-iso10646-1;\ -*-gothic-medium-r-normal-*-*-120-*-*-*-*-ksc5601.1987-0;\ -*-helvetica-medium-r-*-*-*-120-75-75-*-*-iso8859-1;\ EOF ;; esac echo "DONE" } function citrix_icaclient_10_ubuntu_8_04() { local REQUIRED="libmotif3 libxp6 libxpm4 libsm6 libice6 libxmu6 libxt6 libxau6 libxdmcp6" local MISSING=0 MISSING_PACKAGES= for DEB in ${REQUIRED} do check_deb $DEB || { MISSING_PACKAGES+=" $DEB "; MISSING=1; } done if [ "$MISSING" -eq 1 ] then { echo "$PROGNAME: Missing packages:$MISSING_PACKAGES" echo "Install them and proceed again. Use:" echo " sudo apt-get install $MISSING_PACKAGES" } >&2 exit 1 fi cd ${ICAROOT} || { echo "$PROGNAME: error changing directory to $ICAROOT"; exit 1; } echo "Using ICAROOT=$ICAROOT" WFCMGR=${ICAROOT}/nls/en/UTF-8/Wfcmgr case "$ICACLIENTVERSION" in 10.0) if [ ! -r "$WFCMGR" ] then echo "$PROGNAME: cannot access '$WFCMGR'" >&2 exit 1 fi PATCH=$(which patch) if [ -z "$PATCH" ] then echo "$PROGNAME: cannot find 'patch'. You need to install it." echo ".i.e: apt-get install patch" exit 1 fi $PATCH -b -p1 <<'EOF' --- ./nls/en/UTF-8/Wfcmgr.ORI 2007-04-23 09:40:35.000000000 +0200 +++ ./nls/en/UTF-8/Wfcmgr 2007-04-23 10:04:58.000000000 +0200 @@ -1562,6 +1562,7 @@ ! Wfcmgr*fontList:\ +-adobe-helvetica-medium-r-normal--12-120-75-75-p-0-*-*;\ -gnu-*-*-*-*-*-*-120-*-*-*-*-iso10646-1;\ -*-gothic-medium-r-normal-*-*-120-*-*-*-*-ksc5601.1987-0;\ -*-helvetica-medium-r-*-*-*-120-75-75-*-*-iso8859-1;\ --- ./nls/en/Wfcmgr.ORI 2007-04-23 09:40:35.000000000 +0200 +++ ./nls/en/Wfcmgr 2007-04-23 10:10:16.000000000 +0200 @@ -1562,6 +1562,7 @@ ! Wfcmgr*fontList:\ +-adobe-helvetica-medium-r-normal--12-120-75-75-p-0-*-*;\ -gnu-*-*-*-*-*-*-120-*-*-*-*-iso10646-1;\ -*-gothic-medium-r-normal-*-*-120-*-*-*-*-ksc5601.1987-0;\ -*-helvetica-medium-r-*-*-*-120-75-75-*-*-iso8859-1;\ EOF ;; esac if [ "$(uname -a)" = x86_64 ] then libmotif3_32_fix fi echo "DONE" } function libmotif3_32_fix() { local vers=2.2.3-2 local mirror=mirror.kernel.org local pkg=libmotif3-${vers}_i386.deb wget -O /tmp/${pkg} http://${mirror}/ubuntu/pool/multiverse/o/openmotif/${pkg} dpkg-deb -X /tmp/${pkg} /usr/local/lib/libmotif3 ln -s /usr/local/lib/libmotif3/usr/lib/lib* /usr/lib32/ } function confirm_continue() { confirm "Patching Citrix ICAClient $ICACLIENTVERSION on $DISTRIB_ID $DISTRIB_RELEASE, continue" } ICAROOT=${ICAROOT:-/usr/lib/ICAClient} [ -e /etc/lsb-release ] && . /etc/lsb-release PROGNAME=$(basename $0) echo "$PROGNAME Version $VERSION" if [ ! -d "$ICAROOT" ] then echo "$PROGNAME: directory '$ICAROOT' doesn't exist" >&2 exit 1 fi VERFILE=${ICAROOT}/pkginf/Ver.core.linuxx86 if [ ! -r "${VERFILE}" ] then echo "$PROGNAME: cannot read version file '${VERFILE}'" >&2 exit 1 fi eval $(grep DISP_VERSION ${VERFILE}) ICACLIENTVERSION=$DISP_VERSION if [ -z "${ICACLIENTVERSION}" ] then echo "$PROGNAME: cannot determine ICA Client version" >&2 exit 1 fi case "$ICACLIENTVERSION" in 10\.[06]) : ;; *) echo "$PROGNAME: only versions 10.0 and 10.6 are supported by this program" >&2 echo "Found ${ICACLIENTVERSION}" >&2 exit 1 esac case "$DISTRIB_RELEASE" in 6.10) confirm_continue && citrix_icaclient_10_ubuntu_6_10 ;; 7.04) confirm_continue && citrix_icaclient_10_ubuntu_7_04 ;; 7.10) confirm_continue && citrix_icaclient_10_ubuntu_7_10 ;; 8.04) confirm_continue && citrix_icaclient_10_ubuntu_8_04 ;; *) echo "$PROGNAME: unsupported Ubuntu release $DISTRIB_RELEASE" exit 1 esac exit 0