Initial version of donated sources by Avertec, 3.4p5.
[tas-yagle.git] / distrib / script / Install
1 #!/bin/sh
2 #
3 # Install Script for HiTas and Yagle tools distribution
4 #
5 # Copyright (c)1999-2005, Avertec
6 # All Rights Reserved
7 #
8 ##########################################################################
9
10 ##########################################################################
11 echonl()
12 {
13 if [ `echo "x\c"` = "x" ] ; then
14 echo "$1\c"
15 else
16 echo -n "$1"
17 fi
18 }
19
20 ##########################################################################
21 exit_install()
22 {
23 echo "Exit installation..."
24 echo " "
25 exit 1
26 }
27
28 ##########################################################################
29 abort_install()
30 {
31 if readinlist "Abort installation y/n? [n]:" "$YESNOLIST" n ; then
32 if readinlist "Are you sure? y/n [n]:" "$YESNOLIST" n ; then
33 exit_install
34 fi
35 fi
36 }
37
38 ##########################################################################
39 is_yes_no()
40 {
41 anstotest="$1"
42 case "$anstotest" in
43 y|Y|yes|YES|accept)
44 return 0
45 ;;
46 n|N|no|NO|decline)
47 return 1
48 ;;
49 *)
50 return 2
51 ;;
52 esac
53 }
54
55 ##########################################################################
56 is_in_list()
57 {
58 arginlist="$1"
59 listofarg="$2"
60
61 for arg in $arginlist ; do
62 ok=0
63 for available in $listofarg ; do
64 if [ "$arg" = "$available" ] ; then
65 ok=1
66 fi
67 done
68 if [ $ok = 0 ] ; then
69 return 1
70 fi
71 done
72
73 return 0
74 }
75
76 ##########################################################################
77 not_in_os()
78 {
79 file="$1"
80 in_os=0
81 is_os=0
82
83 osinfile=`echo "$file" | grep Solaris_2.8 | grep -v Solaris_2.8_64`
84 if [ "$osinfile" ] ; then
85 is_os=1
86 for os in $OSTOINSTALL ; do
87 if [ "$os" = "S2.8" ] ; then
88 in_os=1
89 fi
90 done
91 fi
92
93 osinfile=`echo "$file" | grep Solaris_2.8_64`
94 if [ "$osinfile" ] ; then
95 is_os=1
96 for os in $OSTOINSTALL ; do
97 if [ "$os" = "S2.8_64" ] ; then
98 in_os=1
99 fi
100 done
101 fi
102
103 osinfile=`echo "$file" | grep Solaris_10 | grep -v Solaris_10_64`
104 if [ "$osinfile" ] ; then
105 is_os=1
106 for os in $OSTOINSTALL ; do
107 if [ "$os" = "S10" ] ; then
108 in_os=1
109 fi
110 done
111 fi
112
113 osinfile=`echo "$file" | grep Solaris_10_64`
114 if [ "$osinfile" ] ; then
115 is_os=1
116 for os in $OSTOINSTALL ; do
117 if [ "$os" = "S10_64" ] ; then
118 in_os=1
119 fi
120 done
121 fi
122
123 osinfile=`echo "$file" | grep RHEL_3.0`
124 if [ "$osinfile" ] ; then
125 is_os=1
126 for os in $OSTOINSTALL ; do
127 if [ "$os" = "RHEL3.0" ] ; then
128 in_os=1
129 fi
130 done
131 fi
132
133 osinfile=`echo "$file" | grep RHEL_3.0_64`
134 if [ "$osinfile" ] ; then
135 is_os=1
136 for os in $OSTOINSTALL ; do
137 if [ "$os" = "RHEL3.0_64" ] ; then
138 in_os=1
139 fi
140 done
141 fi
142
143 if [ $in_os -eq 1 -o $is_os -eq 0 ] ; then
144 return 1;
145 else
146 return 0;
147 fi
148 }
149 ##########################################################################
150 read_answer()
151 {
152 message="$1"
153 defaultvalue="$2"
154 while true ; do
155 echonl "$message"
156 echonl " "
157 read answer
158 echo " "
159 if [ ! "$answer" ] ; then
160 answer="$defaultvalue"
161 fi
162 if is_yes_no "$answer" ; then
163 return 0
164 else
165 return 1
166 fi
167 done
168 }
169
170 ##########################################################################
171 readinlist()
172 {
173 question="$1"
174 listofarg="$2"
175 defaultvalue="$3"
176 returnvalue=true
177
178 while true ; do
179 if read_answer "$question" "$defaultvalue" ; then
180 returnvalue=true
181 else
182 returnvalue=false
183 fi
184 if is_in_list "$answer" "$listofarg" ; then
185 break ;
186 else
187 echo "ERROR: Invalid response... try again"
188 echo " "
189 fi
190 done
191
192 if [ "$returnvalue" = "true" ] ; then
193 return 0
194 else
195 return 1
196 fi
197 }
198
199 ##########################################################################
200 printlicense()
201 {
202 licensefile="$1"
203
204 if [ -f "/bin/more" ] ; then
205 cattool="/bin/more"
206 elif [ -f "/usr/bin/more" ] ; then
207 cattool="/usr/bin/more"
208 elif [ -f "/usr/ucb/more" ] ; then
209 cattool="/usr/ucb/more"
210 else
211 cattool=cat
212 fi
213
214 echo "You must accept the following license agreement before installation"
215 echo " "
216 echo "Press return to continue"
217 echo " "
218 read dummy
219 $cattool "$licensefile"
220 echo " "
221 }
222 ##########################################################################
223
224 ##########################################################################
225 create_dir()
226 {
227 dir="$1"
228 if [ ! -d "$dir" ] ; then
229 echo "Directory $INSTALLDIR does not exist..."
230 echo " "
231 if readinlist "Do you want to create it now y/n? [y]:" "$YESNOLIST" y ; then
232 if mkdir -p "$INSTALLDIR" > /dev/null 2>&1 ; then
233 echo "Creating installation directory..."
234 echo " "
235 return 0
236 else
237 echo "Can not create directory $INSTALLDIR..."
238 echo " "
239 abort_install
240 return 1
241 fi
242 else
243 abort_install
244 return 1
245 fi
246 else
247 echo "Directory $INSTALLDIR already exists..."
248 echo " "
249 if readinlist "Do you want to overwrite it now y/n? [n]:" "$YESNOLIST" n ; then
250 echo "All data will be destroyed..."
251 echo " "
252 if readinlist "Are you sure y/n? [n]:" "$YESNOLIST" n ; then
253 if rm -rf $INSTALLDIR/* > /dev/null 2>&1 ; then
254 echo "Creating installation directory..."
255 echo " "
256 return 0
257 else
258 echo "Can not overwrite directory $INSTALLDIR..."
259 echo " "
260 abort_install
261 return 1
262 fi
263 else
264 abort_install
265 return 1
266 fi
267 else
268 abort_install
269 return 1
270 fi
271 fi
272 }
273 ##########################################################################
274
275 ##########################################################################
276 setinstallinfo()
277 {
278 echo " "
279
280 while true ; do
281 read_answer "Enter the source directory [${INSTALLTOOLSDIR}]: " "$INSTALLTOOLSDIR"
282 INSTALLTOOLSDIR="$answer"
283 if [ -f "$INSTALLTOOLSDIR/license_terms/license.txt" ] ; then
284 printlicense "$INSTALLTOOLSDIR/license_terms/license.txt"
285 while true ; do
286 echo "To accept the terms and conditions of this agreement enter accept"
287 echo " "
288 echo "To decline the terms and conditions of this agreement enter decline"
289 echo " "
290 if readinlist "Do you accept the terms and conditions? [accept]:" "accept decline" accept ; then
291 break ;
292 else
293 abort_install
294 echo "You must accept the terms and conditions license agreement to continue..."
295 echo " "
296 fi
297 done
298 break ;
299 else
300 echo "Bad source directory..."
301 echo " "
302 abort_install
303 fi
304 done
305
306 while true ; do
307 read_answer "Enter the destination directory [${INSTALLDIR}]: " "$INSTALLDIR"
308 INSTALLDIR="$answer"
309 if create_dir "$INSTALLDIR" ; then
310 break ;
311 fi
312 done
313
314 echo "Enter the OS to install"
315 echo " S2.8 : Solaris 2.8"
316 echo " S2.8_64 : Solaris 2.8 64bits"
317 echo " S10 : Solaris 10"
318 echo " S10_64 : Solaris 10 64bits"
319 echo " RHEL3.0 : Red Hat Enterprise Linux 3.0"
320 echo " RHEL3.0_64 : Red Hat Enterprise Linux 3.0 64bits"
321 readinlist "OS [${OSTOINSTALL}]: " "$OSTOINSTALL all" "all"
322 OSTOINSTALL=$answer
323 if [ "$OSTOINSTALL" = "all" ] ; then
324 OSTOINSTALL="S2.8 S2.8_64 S10 S10_64 RHEL3.0 RHEL3.0_64"
325 fi
326 }
327 ##########################################################################
328 copy_file()
329 {
330 sourcedirfile="$1"
331
332 echo "Copying common distribution files..."
333 echo " "
334 for line in `awk '/^common/ {printf "%s ",$0}' $sourcedirfile/etc/avttools.dtb`; do
335 file=`echo "$line"|sed 's/.*://g'`
336 if not_in_os "$file" ; then
337 continue
338 fi
339 scefullname="$sourcedirfile/$file"
340 dstfullname="$INSTALLDIR/$file"
341 if [ -d "$scefullname" ] ; then
342 if [ ! -d "$dstfullname" ] ; then
343 if mkdir -p "$dstfullname" > /dev/null 2>&1 ; then
344 echonl "*"
345 else
346 echo "Can not write in the destination directory..."
347 echo " "
348 exit_install
349 fi
350 fi
351 elif [ -f "$scefullname" ] ; then
352 if cp -f "$scefullname" "$dstfullname" > /dev/null 2>&1 ; then
353 echonl "*"
354 else
355 echo "Can not write in the destination directory..."
356 echo " "
357 exit_install
358 fi
359 else
360 basename=`basename "$file"`
361 if [ "$basename" = "*r" ] ; then
362 dirname=`dirname "$file"`
363 if cp -rf $sourcedirfile/$dirname/* $INSTALLDIR/$dirname/. > /dev/null 2>&1 ; then
364 echonl "*"
365 fi
366 elif [ "$basename" = "*" ] ; then
367 dirname=`dirname "$file"`
368 if cp -f $sourcedirfile/$dirname/* $INSTALLDIR/$dirname/. > /dev/null 2>&1 ; then
369 echonl "*"
370 fi
371 fi
372 fi
373 done
374 echo " "
375 echo " "
376
377 echo "Copying HITAS distribution files..."
378 echo " "
379 for line in `awk '/^hitas/ {printf "%s ",$0}' $sourcedirfile/etc/avttools.dtb`; do
380 file=`echo "$line"|sed 's/.*://g'`
381 if not_in_os "$file" ; then
382 continue
383 fi
384 scefullname="$sourcedirfile/$file"
385 dstfullname="$INSTALLDIR/$file"
386 if [ -d "$scefullname" ] ; then
387 if [ ! -d "$dstfullname" ] ; then
388 if mkdir -p "$dstfullname" > /dev/null 2>&1 ; then
389 echonl "*"
390 else
391 echo "Can not write in the destination directory..."
392 echo " "
393 exit_install
394 fi
395 fi
396 elif [ -f "$scefullname" ] ; then
397 if cp -f "$scefullname" "$dstfullname" > /dev/null 2>&1 ; then
398 echonl "*"
399 else
400 echo "Can not write in the destination directory..."
401 echo " "
402 exit_install
403 fi
404 else
405 basename=`basename "$file"`
406 if [ "$basename" = "*r" ] ; then
407 dirname=`dirname "$file"`
408 if cp -rf $sourcedirfile/$dirname/* $INSTALLDIR/$dirname/. > /dev/null 2>&1 ; then
409 echonl "*"
410 fi
411 elif [ "$basename" = "*" ] ; then
412 dirname=`dirname "$file"`
413 if cp -f $sourcedirfile/$dirname/* $INSTALLDIR/$dirname/. > /dev/null 2>&1 ; then
414 echonl "*"
415 fi
416 fi
417 fi
418 done
419 echo " "
420 echo " "
421
422 echo "Copying YAGLE distribution files..."
423 echo " "
424 for line in `awk '/^yagle/ {printf "%s ",$0}' $sourcedirfile/etc/avttools.dtb`; do
425 file=`echo "$line"|sed 's/.*://g'`
426 if not_in_os "$file" ; then
427 continue
428 fi
429 scefullname="$sourcedirfile/$file"
430 dstfullname="$INSTALLDIR/$file"
431 if [ -d "$scefullname" ] ; then
432 if [ ! -d "$dstfullname" ] ; then
433 if mkdir -p "$dstfullname" > /dev/null 2>&1 ; then
434 echonl "*"
435 else
436 echo "Can not write in the destination directory..."
437 echo " "
438 exit_install
439 fi
440 fi
441 elif [ -f "$scefullname" ] ; then
442 if cp -f "$scefullname" "$dstfullname" > /dev/null 2>&1 ; then
443 echonl "*"
444 else
445 echo "Can not write in the destination directory..."
446 echo " "
447 exit_install
448 fi
449 else
450 basename=`basename "$file"`
451 if [ "$basename" = "*r" ] ; then
452 dirname=`dirname "$file"`
453 if cp -rf $sourcedirfile/$dirname/* $INSTALLDIR/$dirname/. > /dev/null 2>&1 ; then
454 echonl "*"
455 fi
456 elif [ "$basename" = "*" ] ; then
457 dirname=`dirname "$file"`
458 if cp -f $sourcedirfile/$dirname/* $INSTALLDIR/$dirname/. > /dev/null 2>&1 ; then
459 echonl "*"
460 fi
461 fi
462 fi
463 done
464 echo " "
465 echo " "
466
467 }
468 ##########################################################################
469
470 ##########################################################################
471 installdistrib()
472 {
473 if [ -f "$INSTALLDIR/etc/avttools.dtb" ] ; then
474 if rm -f $INSTALLDIR/etc/avttools.dtb > /dev/null 2>&1 ; then
475 echo "Remove the old distribution database..."
476 echo " "
477 else
478 echo "Can not remove the old database..."
479 echo " "
480 exit_install
481 fi
482 else
483 if [ ! -d "$INSTALLDIR/etc" ] ; then
484 if mkdir -p "$INSTALLDIR/etc" > /dev/null 2>&1 ; then
485 echo "Creating the new distribution database..."
486 echo " "
487 else
488 echo "Can not write in the destination directory..."
489 echo " "
490 exit_install
491 fi
492 fi
493 fi
494
495 copy_file $INSTALLTOOLSDIR
496 }
497 ##########################################################################
498 ##########################################################################
499 create_env()
500 {
501 destfile="$INSTALLDIR/etc/avt_env.csh"
502 server=`hostname`
503 read_answer "Enter the license server name [${server}]: " "$server"
504 server="$answer"
505 SERVER="$server"
506
507 if [ -d "$INSTALLTOOLSDIR/tools/Linux_demo" ] ; then
508 echo "setenv AVTOS Linux_demo" >> "$destfile"
509 else
510 echo "switch (\`uname\`)" >> "$destfile"
511 echo " case Linux*:" >> "$destfile"
512 echo " switch (\$1)" >> "$destfile"
513 echo " case 64:" >> "$destfile"
514 echo " setenv AVTOS RHEL_3.0_64" >> "$destfile"
515 echo " breaksw" >> "$destfile"
516 echo " default" >> "$destfile"
517 echo " setenv AVTOS RHEL_3.0" >> "$destfile"
518 echo " breaksw" >> "$destfile"
519 echo " endsw" >> "$destfile"
520 echo " breaksw" >> "$destfile"
521 echo " case SunOS*:" >> "$destfile"
522 echo " switch (\`uname -r\`)" >> "$destfile"
523 echo " case 5.8*:" >> "$destfile"
524 echo " case 5.9*:" >> "$destfile"
525 echo " switch (\$1)" >> "$destfile"
526 echo " case 64:" >> "$destfile"
527 echo " setenv AVTOS Solaris_2.8_64" >> "$destfile"
528 echo " breaksw" >> "$destfile"
529 echo " default" >> "$destfile"
530 echo " setenv AVTOS Solaris_2.8" >> "$destfile"
531 echo " breaksw" >> "$destfile"
532 echo " endsw" >> "$destfile"
533 echo " breaksw" >> "$destfile"
534 echo " case 5.10*:" >> "$destfile"
535 echo " switch (\$1)" >> "$destfile"
536 echo " case 64:" >> "$destfile"
537 echo " setenv AVTOS Solaris_10_64" >> "$destfile"
538 echo " breaksw" >> "$destfile"
539 echo " default" >> "$destfile"
540 echo " setenv AVTOS Solaris_10" >> "$destfile"
541 echo " breaksw" >> "$destfile"
542 echo " endsw" >> "$destfile"
543 echo " breaksw" >> "$destfile"
544 echo " default :" >> "$destfile"
545 echo " setenv AVTOS Solaris_2.8" >> "$destfile"
546 echo " breaksw" >> "$destfile"
547 echo " endsw" >> "$destfile"
548 echo " breaksw" >> "$destfile"
549 echo " default :" >> "$destfile"
550 echo " setenv AVTOS Solaris_2.8" >> "$destfile"
551 echo " breaksw" >> "$destfile"
552 echo "endsw" >> "$destfile"
553 fi
554
555 echo "setenv AVT_FLEX_LICENSE yes" >> "$destfile"
556 echo "setenv AVT_LICENSE_FILE $INSTALLDIR/etc/avtlicense.lic" >> "$destfile"
557
558 echo "setenv AVT_TOOLS_DIR $AVT_TOOLS_DIR" >> "$destfile"
559 echo "if \$?PATH then" >> "$destfile"
560 echo " setenv PATH \$AVT_TOOLS_DIR/tools/\$AVTOS/bin:\$AVT_TOOLS_DIR/tcl:\${PATH}" >> "$destfile"
561 echo "else" >> "$destfile"
562 echo " setenv PATH \$AVT_TOOLS_DIR/tools/\$AVTOS/bin:\$AVT_TOOLS_DIR/tcl" >> "$destfile"
563 echo "endif" >> "$destfile"
564 echo "if \$?LD_LIBRARY_PATH then" >> "$destfile"
565 echo " setenv LD_LIBRARY_PATH \$AVT_TOOLS_DIR/tools/\$AVTOS/api_lib:\${LD_LIBRARY_PATH}" >> "$destfile"
566 echo "else" >> "$destfile"
567 echo " setenv LD_LIBRARY_PATH \$AVT_TOOLS_DIR/tools/\$AVTOS/api_lib" >> "$destfile"
568 echo "endif" >> "$destfile"
569 echo "if \$?MANPATH then" >> "$destfile"
570 echo " setenv MANPATH \$AVT_TOOLS_DIR/man:\${MANPATH}" >> "$destfile"
571 echo "else" >> "$destfile"
572 echo " setenv MANPATH \$AVT_TOOLS_DIR/man" >> "$destfile"
573 echo "endif" >> "$destfile"
574 echo "setenv AVT_LICENSE_SERVER $server" >> "$destfile"
575
576
577 destfilesh="$INSTALLDIR/etc/avt_env.sh"
578
579 if [ -d "$INSTALLTOOLSDIR/tools/Linux_demo" ] ; then
580 echo "AVTOS=Linux_demo" >> "$destfilesh"
581 echo "export $AVTOS" >> "$destfilesh"
582 else
583 echo "case \`uname\` in" >> "$destfilesh"
584 echo " Linux*)" >> "$destfilesh"
585 echo " case \${1:-32} in" >> "$destfilesh"
586 echo " 64)" >> "$destfilesh"
587 echo " AVTOS=RHEL_3.0_64" >> "$destfilesh"
588 echo " export AVTOS;;" >> "$destfilesh"
589 echo " *)" >> "$destfilesh"
590 echo " AVTOS=RHEL_3.0" >> "$destfilesh"
591 echo " export AVTOS;;" >> "$destfilesh"
592 echo " esac;;" >> "$destfilesh"
593 echo " SunOS*)" >> "$destfilesh"
594 echo " case \`uname -r\` in" >> "$destfilesh"
595 echo " 5.8*)" >> "$destfilesh"
596 echo " case \${1:-32} in" >> "$destfilesh"
597 echo " 64)" >> "$destfilesh"
598 echo " AVTOS=Solaris_2.8_64" >> "$destfilesh"
599 echo " export AVTOS;;" >> "$destfilesh"
600 echo " *)" >> "$destfilesh"
601 echo " AVTOS=Solaris_2.8" >> "$destfilesh"
602 echo " export AVTOS;;" >> "$destfilesh"
603 echo " esac;;" >> "$destfilesh"
604 echo " 5.9*)" >> "$destfilesh"
605 echo " case \${1:-32} in" >> "$destfilesh"
606 echo " 64)" >> "$destfilesh"
607 echo " AVTOS=Solaris_2.8_64" >> "$destfilesh"
608 echo " export AVTOS;;" >> "$destfilesh"
609 echo " *)" >> "$destfilesh"
610 echo " AVTOS=Solaris_2.8" >> "$destfilesh"
611 echo " export AVTOS;;" >> "$destfilesh"
612 echo " esac;;" >> "$destfilesh"
613 echo " 5.10*)" >> "$destfilesh"
614 echo " case \${1:-32} in" >> "$destfilesh"
615 echo " 64)" >> "$destfilesh"
616 echo " AVTOS=Solaris_10_64" >> "$destfilesh"
617 echo " export AVTOS;;" >> "$destfilesh"
618 echo " *)" >> "$destfilesh"
619 echo " AVTOS=Solaris_10" >> "$destfilesh"
620 echo " export AVTOS;;" >> "$destfilesh"
621 echo " esac;;" >> "$destfilesh"
622 echo " *)" >> "$destfilesh"
623 echo " AVTOS=Solaris_2.8" >> "$destfilesh"
624 echo " export AVTOS;;" >> "$destfilesh"
625 echo " esac;;" >> "$destfilesh"
626 echo " *)" >> "$destfilesh"
627 echo " AVTOS=Solaris_2.8" >> "$destfilesh"
628 echo " export AVTOS;;" >> "$destfilesh"
629 echo "esac" >> "$destfilesh"
630 fi
631
632 echo "AVT_FLEX_LICENSE=yes" >> "$destfilesh"
633 echo "export AVT_FLEX_LICENSE" >> "$destfilesh"
634 echo "AVT_LICENSE_FILE=$INSTALLDIR/etc/avtlicense.lic" >> "$destfilesh"
635 echo "export AVT_LICENSE_FILE" >> "$destfilesh"
636 echo "AVT_TOOLS_DIR=$AVT_TOOLS_DIR" >> "$destfilesh"
637 echo "export AVT_TOOLS_DIR" >> "$destfilesh"
638 echo "if [ \${PATH:-notset} = notset ]" >> "$destfilesh"
639 echo "then" >> "$destfilesh"
640 echo " PATH=\$AVT_TOOLS_DIR/tools/\$AVTOS/bin:\$AVT_TOOLS_DIR/tcl" >> "$destfilesh"
641 echo " export PATH" >> "$destfilesh"
642 echo "else" >> "$destfilesh"
643 echo " PATH=\$AVT_TOOLS_DIR/tools/\$AVTOS/bin:\$AVT_TOOLS_DIR/tcl:\${PATH}" >> "$destfilesh"
644 echo " export PATH" >> "$destfilesh"
645 echo "fi" >> "$destfilesh"
646 echo "if [ \${LD_LIBRARY_PATH:-notset} = notset ]" >> "$destfilesh"
647 echo "then" >> "$destfilesh"
648 echo " LD_LIBRARY_PATH=\$AVT_TOOLS_DIR/tools/\$AVTOS/api_lib" >> "$destfilesh"
649 echo " export LD_LIBRARY_PATH" >> "$destfilesh"
650 echo "else" >> "$destfilesh"
651 echo " LD_LIBRARY_PATH=\$AVT_TOOLS_DIR/tools/\$AVTOS/api_lib:\${LD_LIBRARY_PATH}" >> "$destfilesh"
652 echo " export LD_LIBRARY_PATH" >> "$destfilesh"
653 echo "fi" >> "$destfilesh"
654 echo "if [ \${MANPATH:-notset} = notset ]" >> "$destfilesh"
655 echo "then" >> "$destfilesh"
656 echo " MANPATH=\$AVT_TOOLS_DIR/man" >> "$destfilesh"
657 echo " export MANPATH" >> "$destfilesh"
658 echo "else" >> "$destfilesh"
659 echo " MANPATH=\$AVT_TOOLS_DIR/man:\${MANPATH}" >> "$destfilesh"
660 echo " export MANPATH" >> "$destfilesh"
661 echo "fi" >> "$destfilesh"
662 echo "AVT_LICENSE_SERVER=$server" >> "$destfilesh"
663 echo "export AVT_LICENSE_SERVER" >> "$destfilesh"
664
665
666 }
667
668 ##########################################################################
669
670 INSTALLTOOLS=`basename $0`
671 INSTALLTOOLSDIR=`dirname $0`
672 CURRENTDIR=`pwd`
673 if [ "$AVT_TOOLS_DIR" ] ; then
674 INSTALLDIR="$AVT_TOOLS_DIR"
675 else
676 INSTALLDIR="$CURRENTDIR/AvtTools"
677 fi
678
679 OSTOINSTALL="S2.8 S2.8_64 S10 S10_64 RHEL3.0 RHEL3.0_64"
680
681 YESNOLIST="y Y yes YES n N no NO"
682
683 umask 022
684 if [ "$1" = "-help" ] || [ "$1" = "-h" ] || [ "$1" = "--help" ] ; then
685 echo "usage: Install [source directory] [destination directory]"
686 echo " "
687 exit 1
688 fi
689
690 if [ "$1" ] ; then
691 INSTALLTOOLSDIR="$1"
692 fi
693
694 if [ "$2" ] ; then
695 INSTALLDIR="$2"
696 fi
697 setinstallinfo
698
699 cd "$INSTALLDIR"
700 AVT_TOOLS_DIR=`pwd`
701
702 cd "$CURRENTDIR"
703 installdistrib
704 create_env
705
706 echo "Installation successful"
707 echo " "
708 exit 0