updated on Wed Jan 18 12:20:32 UTC 2012
[aur-mirror.git] / citrix-client / PKGBUILD
blob04201580cc2b434f87742ffa715be4fca15b593c
1 # Maintainer: Vryali [vryali {at} gmail -dot- com]
2 # Former Maintainer: LeeF <leef (at) hushmail (dot) com
3 # Original Author  : Andrwe <lord-weber-andrwe (at) renona-studios (dot) org>
5 pkgname="citrix-client"
6 pkgver="12.0"
7 pkgrel="0"
8 pkgdesc="Provides XenApp(Citrix) for linux (x86_64 & i686)."
10 url="http://www.citrix.com"
11 source=('http://download.citrix.com.edgesuite.net/akdlm/6527/linuxx86-12.0.0.189834.tar.gz?__gda__=1321897125_2ee2fd1ec07c8aa513106fd80015c832&__dlmgda__=1321983225_fe34ab5440b7215ddeb18dd0a809b471&fileExt=.gz')
12 arch=('i686' 'x86_64')
13 license=('CAL')
14 md5sums=('d99029de72f8bb6ada8297d16f39ad90')
16 case ${CARCH} in
17     i686 )
18         depends=(
19             'gtk2'
20             'libx11'
21             'libxaw'
22             'libxext'
23             'libxft'
24             'libxmu'
25             'libxp'
26             'libxpm'
27             'libxt'
28             'openmotif'
29             'printproto'
30             'xextproto'
31             'alsa-lib'
32             'glib2'
33         )
34         instdir="/usr/lib/ICAClient"
35         ;;
36     x86_64 )
37         depends=(
38             'gtk2'
39             'lib32-gcc-libs'
40             'lib32-libjpeg'
41             'lib32-libpng'
42             'lib32-libvorbis'
43             'lib32-libx11'
44             'lib32-libxaw'
45             'lib32-libxext'
46             'lib32-libxft'
47             'lib32-libxinerama'
48             'lib32-libxmu'
49             'lib32-libxp'
50             'lib32-libxpm'
51             'lib32-libxt'
52             'lib32-openmotif'
53             'printproto'
54             'xextproto'
55             'lib32-alsa-lib'
56             'lib32-glib2'
57             'lib32-gtk2'
58         )
59         instdir="/usr/lib32/ICAClient"
60         ;;
61 esac
63 install=citrix-client.install
65 build() {
66     # Create folder structure
67     mkdir -p "${pkgdir}${instdir}"
68     mkdir -p "${pkgdir}/usr/lib/mozilla/plugins"
69     mkdir -p "${pkgdir}/usr/bin/"
71     # copy needed files
72     cp -r ./linuxx86/linuxx86.cor/* "${pkgdir}${instdir}"/
73     cp ./setupwfc "${pkgdir}${instdir}"/
75     # Go to package directory
76     cd "${pkgdir}${instdir}"/
77     
78     # Create symlinks for the Npica.ad binary
79     ln -s ./nls/en/Npica.ad ./Npica.ad
80     ln -s ./Npica.ad ./Npica
82     # Copy EULA to program root directory
83     cp ${srcdir}/linuxx86/linuxx86.cor/nls/en/eula.txt ./
85     # Copy default configuration files to config directory of the program and setting them readable
86     cp ./nls/en/{appsrv.ini,wfclient.ini,module.ini} ./config/
87     chmod 666 ./config/{appsrv.ini,wfclient.ini,module.ini}
88     chmod 777 ./config
90     # Go ahead and do the different operations pursiant with the architecture...
91     if [[ "${CARCH}" == "i686" ]]; then
92         # The installer works beautifully here, no reason to not just use that.
93         # I removed teh old script code that manually built the package, namely because
94         # it wasn't working and bothered the hell out of me, and then wrote a quick expect
95         # script to do the installation...
96 echo "#!/usr/bin/expect
97 spawn -noecho ./setupwfc
98 expect 'Enter option number 1-3'
99 send '1\r'
100 expect 'abandon the installation:'
101 send '/usr/lib/ICAClient\r'
102 expect 'Proceed with installation?' 
103 send 'y\r'
104 expect 'Enter option number 1-2'
105 send '1\r'
106 expect 'Do you want to integrate Citrix Receiver with KDE and GNOME'
107 send 'n\r'
108 expect 'Do you want GStreamer to use the plugin from this client'
109 send 'n\r'
110 expect 'Do you want to install USB support?'
111 send 'n\r'
112 expect 'Enter option number 1-3'
113 send '3\r'
114 exit 0" > citrix_install.sh
115         chmod 755 citrix_install.sh
116         cd "${pkgdir}${instdir}"/
117         # Remove the 64 bit plugins to prevent issues when stripping
118         find ${pkgdir} -iname "*64*" -exec rm {} \;
119     else
120         # We're 64 bit - Create executable wrapper for the binaries
121         echo -e "#!/bin/sh\nexport ICAROOT=${instdir}\nexport GCONV_PATH=/usr/lib32/gconv/\n\${ICAROOT}/wfica -file \"\$1\"" > ./wfica.sh
122         echo -e "#!/bin/sh\nexport ICAROOT=${instdir}\nexport GCONV_PATH=/usr/lib32/gconv/\n\${ICAROOT}/wfica -associate -fileparam \"\$1\"" > ./wfica_assoc.sh
123         cp ./wfica.sh "${pkgdir}"/usr/bin/wfica
124         cp ./wfica_assoc.sh "${pkgdir}"/usr/bin/wfica_assoc
125         chmod 755 ${pkgdir}/usr/bin/{wfica,wfica_assoc}
126         chmod 755 ./{wfica.sh,wfica_assoc.sh}
127     fi