updated on Thu Jan 19 16:10:29 UTC 2012
[aur-mirror.git] / citrix-client / citrix-client.install
blob826c7082c9986e31f65acc4062dbc40680cd007d
1 pre_install() {
2     ARCH="`uname -m`"
3     tmpdir="/tmp"
4     case ${ARCH} in
5     i686 )
6         instdir="/usr/lib/ICAClient"
7         ;;
8     x86_64 )
9         instdir="/usr/lib32/ICAClient"
10         ;;
11     esac
12     configdir="${instdir}/config"
14     # If we already have citrix installed, we want to preserve the config files for the post_install question.
15     [ -e "${configdir}"/appsrv.ini ] && cp "${configdir}"/appsrv.ini ${tmpdir}/
16     [ -e "${configdir}"/wfclient.ini ] && cp "${configdir}"/wfclient.ini ${tmpdir}/
17     [ -e "${configdir}"/module.ini ] && cp "${configdir}"/module.ini ${tmpdir}/
20 post_install() {
21     ARCH="`uname -m`"
22     case ${ARCH} in 
23     i686 )
24         instdir="/usr/lib/ICAClient"
25         firefox_command="citrix-client.sh"
26         ;;
27     x86_64 )
28         instdir="/usr/lib32/ICAClient"
29         firefox_command="/usr/bin/wfica"
30         ;;
31     esac
32     tmpdir="/tmp"
34     echo "Should old the configuration files be taken into new build (y|N)?" 
35     read choice
36     choice="`echo ${choice} | tr '[:upper:]' '[:lower:]'`"
38     if [[ "${choice}" == "y" ]]; then 
39         echo "Copying old config files ..."
40         [ -e "${tmpdir}"/appsrv.ini ] && mv "${tmpdir}"/appsrv.ini "${instdir}"/config/ && echo "  Copied 'appsrv.ini'"
41         [ -e "${tmpdir}"/wfclient.ini ] && mv "${tmpdir}"/wfclient.ini "${instdir}"/config/ && echo "  Copied 'wfclient.ini'"
42         [ -e "${tmpdir}"/module.ini ] && mv "${tmpdir}"/module.ini "${instdir}"/config/ && echo "  Copied 'module.ini'"
43     fi
44     chmod 666 "${instdir}"/config/{appsrv,wfclient,module}.ini
45     [ -d /usr/share/ca-certificates/mozilla ] && ln -s /usr/share/ca-certificates/mozilla/* ${instdir}/keystore/cacerts/ > /dev/null 2>&1 
46     echo "" 
47     echo "CA certs SymLinked for SSL support."
48     echo "All done."
50     echo -e "\e[1;31m\nYou have to create '\e[1;33m\$HOME/.ICAClient/cache\e[1;31m' for each user who uses this program and then populate it with the appropriate ini files.  Copy paste the below to do this easily:\n"
51     echo -e "\e[1;37mmkdir -p \$HOME/.ICAClient/cache"
52     echo -e "cp ${instdir}/config/{All_Regions,Trusted_Region,Unknown_Region,canonicalization,regions}.ini \$HOME/.ICAClient/\n"
53     echo -e "\e[1;37mFinally, set firefox to use the command '${firefox_command}' for .ICA files."
54     echo -e "\e[0m"
57 pre_upgrade()   { pre_install;  }  
58 post_upgrade()  { post_install; }