| 1 |
#!/bin/env tcsh -f |
| 2 |
# $Id: INSTALL.xclient,v 1.2 1998/04/17 18:20:28 mieg Exp $ |
| 3 |
|
| 4 |
echo ACEDB, graphic client installation |
| 5 |
echo Jean Thierry-Mieg, nov 1997 |
| 6 |
echo ' ' |
| 7 |
echo The graphic acedb client is part of the acedb system |
| 8 |
echo It will import the data transparently |
| 9 |
echo from the server, build progressivelly a database on |
| 10 |
echo your local disk, and refresh the data when needed. |
| 11 |
echo ' ' |
| 12 |
echo If you do not have it, you should first |
| 13 |
echo import the the acedb executable for your platform |
| 14 |
echo from say ftp://ncbi.nlm.nih.gov/pub/acedb |
| 15 |
echo and run the INSTALL script |
| 16 |
echo ' ' |
| 17 |
echo -n " Should we proceed? Please answer yes/no [yes]: " |
| 18 |
|
| 19 |
switch("$<") |
| 20 |
case "": |
| 21 |
case "yes": |
| 22 |
case "y": |
| 23 |
breaksw |
| 24 |
default: |
| 25 |
echo ' You did not answer yes, I quit' |
| 26 |
exit |
| 27 |
breaksw |
| 28 |
endsw |
| 29 |
|
| 30 |
setenv ici `pwd` |
| 31 |
echo ' ' |
| 32 |
|
| 33 |
chose_xclient_dir: |
| 34 |
echo Where do you want to install your client database |
| 35 |
echo I suggest the directory `pwd`/XCLIENT |
| 36 |
echo ' ' |
| 37 |
echo -n " Please answer ok, or give a directory name [ok]: " |
| 38 |
|
| 39 |
setenv toto $< |
| 40 |
setenv toto1 `echo $toto | nawk '{gsub (/ /,"",$1) ; print;}'` |
| 41 |
switch ("$toto1") |
| 42 |
case "": |
| 43 |
case "ok": |
| 44 |
case "o": |
| 45 |
setenv xclient_dir `pwd`/XCLIENT |
| 46 |
breaksw |
| 47 |
default: |
| 48 |
setenv xclient_dir $toto1 |
| 49 |
breaksw |
| 50 |
endsw |
| 51 |
if (-d $xclient_dir) then |
| 52 |
echo $xclient_dir already exist and contains |
| 53 |
ls $xclient_dir |
| 54 |
else |
| 55 |
echo $xclient_dir does not yet exists |
| 56 |
endif |
| 57 |
|
| 58 |
|
| 59 |
echo "Do you confirm $xclient_dir ?" |
| 60 |
echo ' ' |
| 61 |
echo -n " Please answer yes/no [yes]: " |
| 62 |
|
| 63 |
switch("$<") |
| 64 |
case "": |
| 65 |
case "yes": |
| 66 |
case "y": |
| 67 |
breaksw |
| 68 |
default: |
| 69 |
goto chose_xclient_dir |
| 70 |
breaksw |
| 71 |
endsw |
| 72 |
|
| 73 |
if !(-d $xclient_dir) mkdir $xclient_dir |
| 74 |
if !(-d $xclient_dir) then |
| 75 |
echo Sorry, i cannot create $xclient_dir |
| 76 |
exit 1 |
| 77 |
endif |
| 78 |
cd $xclient_dir |
| 79 |
setenv xclient_dir `pwd` #absolute path |
| 80 |
|
| 81 |
unsetenv xcl_exe |
| 82 |
echo ' ' |
| 83 |
echo "Where is your ACEDB installation directory: " |
| 84 |
echo ' ' |
| 85 |
chose_acedb_dir: |
| 86 |
cd $ici |
| 87 |
echo -n " Please give a directory name or quit [.]: " |
| 88 |
|
| 89 |
setenv toto $< |
| 90 |
if ($toto == "") then |
| 91 |
setenv toto `pwd` |
| 92 |
endif |
| 93 |
|
| 94 |
if ($toto == "quit") then |
| 95 |
exit 1 |
| 96 |
endif |
| 97 |
|
| 98 |
if !(-d $toto) then |
| 99 |
echo $toto does not exist |
| 100 |
goto chose_acedb_dir |
| 101 |
endif |
| 102 |
|
| 103 |
cd $toto |
| 104 |
setenv acedb_dir `pwd` |
| 105 |
cd $acedb_dir |
| 106 |
|
| 107 |
|
| 108 |
if !(-x $xclient_dir/xcl) then |
| 109 |
if (-e $acedb_dir/xcl) then |
| 110 |
cp $acedb_dir/xcl $xclient_dir |
| 111 |
else |
| 112 |
if (-e $acedb_dir/wtools/xcl) then |
| 113 |
cp $acedb_dir/wtools/xcl $xclient_dir |
| 114 |
else |
| 115 |
if !(-e $acedb_dir/bin/xcl) then |
| 116 |
echo I cannot locate the script $acedb_dir/bin/xcl |
| 117 |
echo "can you suggest another location ?" |
| 118 |
goto chose_acedb_dir |
| 119 |
else |
| 120 |
cp $acedb_dir/bin/xcl $xclient_dir |
| 121 |
endif |
| 122 |
endif |
| 123 |
chmod 755 $xclient_dir/xcl |
| 124 |
endif |
| 125 |
endif |
| 126 |
|
| 127 |
cd $acedb_dir |
| 128 |
if !(-l $xclient_dir/tace) then |
| 129 |
if (-e $acedb_dir/tace) then |
| 130 |
ln -s $acedb_dir/tace $xclient_dir/tace |
| 131 |
else |
| 132 |
if !(-e $acedb_dir/bin/tace) then |
| 133 |
echo I cannot locate the executable tace in `pwd` or `pwd`/bin |
| 134 |
echo "can you suggest another location ?" |
| 135 |
goto chose_acedb_dir |
| 136 |
else |
| 137 |
ln -s $acedb_dir/bin/tace $xclient_dir/tace |
| 138 |
endif |
| 139 |
endif |
| 140 |
endif |
| 141 |
|
| 142 |
if !(-l $xclient_dir/aceclient) then |
| 143 |
if (-e $acedb_dir/aceclient) then |
| 144 |
ln -s $acedb_dir/aceclient $xclient_dir/aceclient |
| 145 |
else |
| 146 |
if !(-e $acedb_dir/bin/aceclient) then |
| 147 |
echo I cannot locate the executable aceclient in `pwd` or `pwd`/bin |
| 148 |
echo "can you suggest another location ?" |
| 149 |
goto chose_acedb_dir |
| 150 |
else |
| 151 |
ln -s $acedb_dir/bin/aceclient $xclient_dir/aceclient |
| 152 |
endif |
| 153 |
endif |
| 154 |
endif |
| 155 |
|
| 156 |
if ( ! -l $xclient_dir/xaceclient) then |
| 157 |
if (-e $acedb_dir/xaceclient) then |
| 158 |
ln -s $acedb_dir/xaceclient $xclient_dir/xaceclient |
| 159 |
echo hi1 |
| 160 |
else |
| 161 |
if ( ! -e $acedb_dir/bin/xaceclient) then |
| 162 |
echo I cannot locate the executable xaceclient in `pwd` or `pwd`/bin |
| 163 |
echo "can you suggest another location ?" |
| 164 |
goto chose_acedb_dir |
| 165 |
else |
| 166 |
ln -s $acedb_dir/bin/xaceclient $xclient_dir/xaceclient |
| 167 |
endif |
| 168 |
endif |
| 169 |
endif |
| 170 |
|
| 171 |
if !(-l $xclient_dir/xace) then |
| 172 |
if (-e $acedb_dir/xace) then |
| 173 |
ln -s $acedb_dir/xace $xclient_dir/xace |
| 174 |
else |
| 175 |
if !(-e $acedb_dir/bin/xace) then |
| 176 |
echo I cannot locate the executable xace in `pwd` or `pwd`/bin |
| 177 |
echo "can you suggest another location ?" |
| 178 |
goto chose_acedb_dir |
| 179 |
else |
| 180 |
ln -s $acedb_dir/bin/xace $xclient_dir/xace |
| 181 |
endif |
| 182 |
endif |
| 183 |
endif |
| 184 |
|
| 185 |
if !(-l $xclient_dir/acediff) then |
| 186 |
if (-e $acedb_dir/acediff) then |
| 187 |
ln -s $acedb_dir/acediff $xclient_dir/acediff |
| 188 |
else |
| 189 |
if !(-e $acedb_dir/bin/acediff) then |
| 190 |
echo I cannot locate the executable acediff in `pwd` or `pwd`/bin |
| 191 |
echo "can you suggest another location ?" |
| 192 |
goto chose_acedb_dir |
| 193 |
else |
| 194 |
ln -s $acedb_dir/bin/acediff $xclient_dir/acediff |
| 195 |
endif |
| 196 |
endif |
| 197 |
endif |
| 198 |
|
| 199 |
echo ' ' |
| 200 |
echo 'Please specify the data server you will use' |
| 201 |
|
| 202 |
echo I suggest the C.elegans data server in Montpellier beta.crbm.cnrs-mop.fr |
| 203 |
echo ' ' |
| 204 |
chose_server: |
| 205 |
echo -n " Please answer ok, or give a server name or ip number [ok]: " |
| 206 |
|
| 207 |
setenv toto $< |
| 208 |
setenv toto1 `echo $toto | nawk '{gsub (/ /,"",$1) ; print;}'` |
| 209 |
switch ("$toto1") |
| 210 |
case "": |
| 211 |
case "ok": |
| 212 |
setenv server_name beta.crbm.cnrs-mop.fr |
| 213 |
goto server_ok |
| 214 |
breaksw |
| 215 |
default: |
| 216 |
setenv server_name $toto1 |
| 217 |
breaksw |
| 218 |
endsw |
| 219 |
|
| 220 |
echo "Do you confirm $server_name ?" |
| 221 |
echo ' ' |
| 222 |
echo -n " Please answer yes/no [yes]: " |
| 223 |
|
| 224 |
switch("$<") |
| 225 |
case "": |
| 226 |
case "yes": |
| 227 |
case "y": |
| 228 |
breaksw |
| 229 |
default: |
| 230 |
goto chose_server |
| 231 |
breaksw |
| 232 |
endsw |
| 233 |
|
| 234 |
server_ok: |
| 235 |
echo ' ' |
| 236 |
echo 'Please specify the port server you will use' |
| 237 |
|
| 238 |
echo I suggest the C.elegans port server in Montpellier 20000100 |
| 239 |
echo ' ' |
| 240 |
chose_port: |
| 241 |
echo -n " Please answer ok, or give a port number [ok]: " |
| 242 |
|
| 243 |
|
| 244 |
setenv toto $< |
| 245 |
setenv toto1 `echo $toto | nawk '{gsub (/ /,"",$1) ; print;}'` |
| 246 |
switch ("$toto1") |
| 247 |
case "": |
| 248 |
case "ok": |
| 249 |
setenv port_name 20000100 |
| 250 |
goto port_ok |
| 251 |
breaksw |
| 252 |
default: |
| 253 |
setenv port_name $toto1 |
| 254 |
breaksw |
| 255 |
endsw |
| 256 |
|
| 257 |
echo "Do you confirm $server_name $port_name?" |
| 258 |
echo ' ' |
| 259 |
echo -n " Please answer yes/no [yes]: " |
| 260 |
|
| 261 |
switch("$<") |
| 262 |
case "": |
| 263 |
case "yes": |
| 264 |
case "y": |
| 265 |
breaksw |
| 266 |
default: |
| 267 |
goto chose_port |
| 268 |
breaksw |
| 269 |
endsw |
| 270 |
|
| 271 |
port_ok: |
| 272 |
|
| 273 |
cd $xclient_dir |
| 274 |
echo '#\!/bin/csh -f' >! go |
| 275 |
echo "cd $xclient_dir" >> go |
| 276 |
echo 'set path = (. $path)' >> go |
| 277 |
echo "./xcl $server_name $port_name" >> go |
| 278 |
|
| 279 |
chmod 755 go |
| 280 |
|
| 281 |
echo Testing the connection to the aceserver: $server_name $port_name |
| 282 |
|
| 283 |
./aceclient $server_name -port $port_name << END >! ___getserver___ || goto noconnect |
| 284 |
status |
| 285 |
END |
| 286 |
|
| 287 |
setenv SERVER_DIR `grep directory ___getserver___ | awk '{dd=$4; i = length(dd); print substr(dd,1,i-2);}'` |
| 288 |
\rm -rf ___getserver___ |
| 289 |
echo Successful connection to aceserver $server_name $port_name |
| 290 |
|
| 291 |
echo "installation is complete, to run the client type the command $xclient_dir/go" |
| 292 |
exit 0 |
| 293 |
|
| 294 |
noconnect: |
| 295 |
\rm -rf ___getserver___ |
| 296 |
echo Sorry, i cannot connect to the server, retry later or try a differnet address |
| 297 |
echo "To run the client type the command $xclient_dir/go" |