home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 12 / Silicon_Graphics_Developer_Magic_Soft_Dev_812-8101-012.iso / .all / demos / ICS / loadepak20 < prev    next >
Encoding:
Text File  |  1995-11-01  |  46.2 KB  |  2,325 lines

  1. #!/bin/sh -f
  2. PATH=/bin:/usr/bin:/usr/ucb:/usr/etc:$PATH
  3. CLEARCMD='clear'
  4. WHOAMI='whoami'
  5. HOSTNAME='hostname'
  6. MV='mv -f'
  7. LN='ln -s'
  8. CD='cd'
  9. RM='rm'
  10. RMDIR='rmdir'
  11. MKDIR='mkdir -p'
  12. TOUCH='touch'
  13. CHMOD='chmod 777'
  14. TMPD=${TMPDIR-/tmp}
  15. MP='\NULL'
  16. TD='\NULL'
  17. KEY=''
  18. DTD='/ICS/EPAK20' #default installation directory
  19. ED='\NULL'
  20. EV='\NULL'
  21. ERR='0'
  22. MVER='0'
  23. RMER='0'
  24. MKDER='0'
  25. CHMODER='0'
  26. ZCATER='0'
  27. TARER='0'
  28. FOUNDDIR="0"
  29. OFLEXLMV='3.0'
  30. REV='2.0'
  31. OREV='2.0'
  32. AREV='20'
  33. CGXREV='35'
  34. BXREV='3.5'
  35. EVERS='3\.5' #this is used by grep that's why there's the \ in it
  36. LDN='ICS Motif Enhancement Pak '$REV''
  37. AN='EPAK'
  38. ABN='EPAK'
  39. LAN='epak'
  40. SN=$ABN' '$REV
  41. ADN=$AN$AREV
  42. LS='loadepak'$AREV
  43. MLS='make'$LAN'links'
  44. RLS='remove'$LAN'links'
  45. DEBUG='1'
  46. LIB='usr/lib/libepak.a'
  47. LOG=$TMPD/$ADN'_DISTLOAD_LOG.'`date '+%m.%d.%y'`
  48. MT='cd' #mediatype : cd or tape
  49. REQDECRYPTIONKEY='1' #if 1 the software loaded needs a decrypt key
  50. REQLMINSTALLATION='0' #if 1 the software needs to install flexlm
  51. IFLXLM='0'
  52. IFLXLMKEY='0'
  53. REQLMKEY='0' #if 1 the software needs an flexlm key
  54. MULTIPLESETS='0' #if 1 the software is comprised of lib,doc,& demo sets
  55. MODIFYIMAKE='0' #if 1 the software needs to modify the imake config directory
  56. MODIMAKE='0'
  57. MAKELINKS='1' #if 1 we need to run the makelinks script
  58. DOCSIZE='[ ~4 megabyte(s) ]'
  59. DOCSET=$SN' man pages                '$DOCSIZE
  60. LIBSIZE='[ ~2 megabyte(s) ]'
  61. LIBSET=$SN' libraries and include files    '$LIBSIZE
  62. DEMOSIZE='[ ~1 megabyte(s) ]'
  63. DEMOSET=$SN' examples and/or demos source code    '$DEMOSIZE
  64. TOTALSIZE='            [ ~7 megabyte(s) ]'
  65. LOADDOC='0'
  66. LOADLIB='1'
  67. LOADDEMO='0'
  68. LINKDOC='0'
  69. LINKLIB='0'
  70. SPECIALLINKS='0' #if 1 we need to make some default links (lmstuff)
  71. SPECIALSCRIPTS='0' #if 1 we need to make the bx, dx or cgx scripts
  72. APPDEFPROCESSING='0' #if 1 we need process app-defaults files
  73.  
  74. case $# in
  75. 0);;
  76. 1) MP=$1;;
  77. 2) MP=$1; TD=$2;;
  78. 3) MP=$1; TD=$2; KEY=$3;;
  79. 7) MP=$1; TD=$2; KEY=$3; ED=$4; EV=$5; LOG=$6; TDLOG=$7;;
  80. *) case $MT in
  81.     "cd" ) echo "Usage: $LS {CD_MOUNT_POINT} {LOAD_DIRECTORY}"; exit 0 ;;
  82.     "tape" ) echo "Usage: $LS {TAPE_DEVICE} {LOAD_DIRECTORY}"; exit 0 ;;
  83.    esac ;;
  84. esac
  85.  
  86. SetCDN()
  87. {
  88. case $CASE in
  89. "any" | "upper" ) CDN='ICSMEP' ;;
  90. "lower" ) CDN='icsmep' ;;
  91. esac
  92. }
  93.  
  94. Clear()
  95. {
  96. eval $CLEARCMD
  97. if [ $EV = "\NULL" ]
  98. then
  99. echo "Distribution loading of the $LDN"
  100. echo "on `hostname` at `date`."
  101. else
  102. echo "Distribution loading of the $ED $EV"
  103. echo "on `hostname` at `date`."
  104. fi
  105. }
  106.  
  107. DetectArch()
  108. {
  109. OSNAME=`uname | awk '{print $1}'`
  110. if [ "$OSNAME" = "SunOS" ] 
  111. then
  112.         OSTYPE=`/bin/uname -r | awk -F. '{print $1}'`
  113.         if [ "$OSTYPE" = "4" ]
  114.         then
  115.                 OSNAME='SOL1'
  116.         else
  117.                 OSNAME='SOL2'
  118.         fi
  119. fi
  120.  
  121. SetCase
  122. SetCDN
  123. SetTarFiles
  124. ExamineDefaults
  125.  
  126. if [ $EV = "\NULL" ]
  127. then
  128.     Greeting
  129. fi
  130. }
  131.  
  132. Message()
  133. {
  134. Echo ""
  135. Echo "Thank you for choosing the $LDN."
  136. Echo "We hope this product stands to serve your engineering requirements."
  137. Echo "Please direct comments & questions to ICS support at 617-621-0060"
  138. Echo "or support@ics.com. Thank You."
  139.  
  140. }
  141.  
  142. DXMessage()
  143. {
  144. if [ $AN = "DXORA" ] || [ $AN = "DXSYB" ]
  145. then
  146. Echo ""
  147. Echo "IMPORTANT : The $LDN distribution can"
  148. Echo "only be loaded into an existing BX $BXREV distribution. If you do not"
  149. Echo "have BX $BXREV already loaded on to the machine you are loading the"
  150. Echo "$LDN, please install BX $BXREV before"
  151. Echo "continuing. Thank You."
  152. fi
  153. }
  154.  
  155. Greeting()
  156. {
  157. Clear
  158. Message
  159. DetermineUID
  160. AwaitEnter
  161. }
  162.  
  163. ExamineDefaults()
  164. {
  165. if [ $MP = "\NULL" ]
  166. then
  167.     SetMP
  168. fi
  169.  
  170. if [ $TD = "\NULL" ]
  171. then
  172.     TD=$DTD
  173.     DIRPASSEDIN='0'
  174. else
  175.     DIRPASSEDIN='1'
  176. fi
  177.  
  178. #debug "MP : $MP"
  179. #debug "TD : $DTD"
  180. }
  181.  
  182. SetMP()
  183. {
  184. case $MT in
  185. "cd" )    case $OSNAME in 
  186.     "SOL2" ) MP='/cdrom/icsmep' ;;
  187.     "IRIX" ) MP='/CDROM' ;;
  188.     * ) MP='/cdrom' ;;
  189.     esac ;;
  190. "tape" ) case $OSNAME in 
  191.     "SOL1" ) MP='/dev/rst0' ;;
  192.     "SOL2" ) MP='/dev/rst0' ;;
  193.     "HP_UX" ) MP='/dev/rmt/0m';;
  194.     "OSF1" ) MP='' ;;
  195.     "IRIX" ) MP='' ;; 
  196.     "AIX" ) MP='' ;;
  197.     "Linux" ) MP='' ;;
  198.     esac ;;
  199. esac
  200. }
  201.  
  202. SetTarFiles()
  203. {
  204. #FOR SRC DISTRIBUTIONS LET $LIBTAR BE THE TAR FILE THE SOURCES RESIDE IN !!!
  205. case $MT in
  206. "cd" ) case $CASE in
  207.     "any" | "upper" ) LIBTAR="EP20.Z" ; DLIBTAR='EP20D.Z' ; DOCTAR='' ;
  208.          DEMOTAR='' ;;
  209.     "lower" ) LIBTAR="ep20.z" ; DLIBTAR='ep20d.z' ; DOCTAR='' ;
  210.          DEMOTAR='' ;;
  211.     esac ;;
  212. "tape" ) LIBTAR="EP20" ; DLIBTAR='' ; DOCTAR='' DEMOTAR='' ;;
  213. esac
  214. }
  215.  
  216. SetCase()
  217. {
  218. case $OSNAME in 
  219. "SOL1" )  CASE='any' ;;
  220. "SOL2" ) CASE='any' ;;
  221. "HP-UX" ) CASE='upper' ; OSNAME='HP_UX' ;;
  222. "OSF1" ) CASE='upper' ;;
  223. "IRIX" )  CASE='lower' ;;
  224. "AIX" ) CASE='lower' ;;
  225. "Linux" ) CASE='any' ;;
  226. esac
  227. }
  228.  
  229. debug()
  230. {
  231. if [ $DEBUG = "1" ]
  232. then
  233. echo "$1"
  234. fi
  235. }
  236.  
  237. DetermineUID()
  238. {
  239. if [ `$WHOAMI` != "root" ]
  240. then
  241.     Log ""
  242.     Log "Warning: You are not logged in as root but as user `$WHOAMI`."
  243.     Log "You need write access to the directory you wish to place"
  244.     if [ $EV != "\NULL" ]
  245.     then
  246.         Log "the $LDN distribution piece of the $ED $EV"
  247.         Log "distribution. Otherwise the $LDN"
  248.         Log "distribution loading of $ED $EV will fail."
  249.     else
  250.         Log "the $LDN distribution in. Otherwise"
  251.         Log "the $LDN distribution load will fail."
  252.     fi
  253. fi
  254. }
  255.  
  256. AwaitEnterHelp()
  257. {
  258. Clear
  259.  
  260. echo ""
  261. echo "Press <return> to continue."
  262.  
  263. echo ""
  264. echo "Press 'h' followed by return to access this help screen."
  265.  
  266. if [ $EV != "\NULL" ]
  267. then
  268.     echo ""
  269.     echo "Press 'q' to quit when prompted. The $ED $EV install will go on to load"
  270.     echo "the next piece of the $ED $EV distribution."
  271.     echo ""
  272.     echo "Press 'a' to exit $ED $EV distribution loading."
  273. else
  274.     echo ""
  275.     echo "Press 'q' to exit the $LS script."
  276. fi
  277.  
  278. AwaitEnter
  279. }
  280.  
  281. ######################################
  282. # AwaitEnter
  283. # Waits for a carraige return or abort
  284. ######################################
  285. AwaitEnter()
  286. {
  287. echo ""
  288. if [ $EV != "\NULL" ]
  289. then
  290. echo "Press [RETURN] to continue, [Q]uit loading the $LDN"
  291. Echon "distribution, [A]bort loading $ED $EV, or [H]elp : "
  292. else
  293. Echon "Press [RETURN] to continue, [Q]uit, or [H]elp : "
  294. fi
  295. read INPUT
  296.  
  297. if [ $EV != "\NULL" ]
  298. then
  299.     case $INPUT in
  300.     [aA] ) Terminated 1 ;;
  301.     [qQ] ) Terminated 2 ;;
  302.     [hH] ) AwaitEnterHelp ;;
  303.     * ) ;;
  304.     esac
  305. else
  306.     case $INPUT in
  307.     [qQ] ) Terminated 2 ;;
  308.     [hH] ) AwaitEnterHelp ;;
  309.     * ) ;;
  310.     esac
  311. fi
  312. }
  313.  
  314. Logn()
  315. {
  316. if [ $EV = "\NULL" ]
  317. then
  318.     OUTPUT=$1
  319.     echo $OUTPUT >> $LOG
  320.     case $OSNAME in
  321.     "Linux" ) echo -n "$OUTPUT" ;;
  322.     "AIX" ) echo -n "$OUTPUT" ;;
  323.     "OSF1" ) echo -n "$OUTPUT" ;;
  324.     "SOL1" ) echo -n "$OUTPUT" ;;
  325.     "SOL2" ) echo "$OUTPUT\c" ;;
  326.     "HP_UX" ) echo "$OUTPUT\c" ;;
  327.     "IRIX" ) echo "$OUTPUT\c" ;;
  328.     esac
  329. fi
  330. }
  331.  
  332. Log()
  333. {
  334. if [ $EV = "\NULL" ]
  335. then
  336.     OUTPUT=$1
  337.     echo $OUTPUT >> $LOG
  338.     echo $OUTPUT
  339. fi
  340. }
  341.  
  342. Echo()
  343. {
  344. if [ $EV = "\NULL" ]
  345. then
  346.     OUTPUT=$1
  347.     echo $OUTPUT
  348. fi
  349. }
  350.  
  351. Echon()
  352. {
  353. OUTPUT=$1
  354. case $OSNAME in
  355. "Linux" ) echo -n "$OUTPUT" ;;
  356. "AIX" ) echo -n "$OUTPUT" ;;
  357. "OSF1" ) echo -n "$OUTPUT" ;;
  358. "SOL1" ) echo -n "$OUTPUT" ;;
  359. "SOL2" ) echo "$OUTPUT\c" ;;
  360. "HP_UX" ) echo "$OUTPUT\c" ;;
  361. "IRIX" ) echo "$OUTPUT\c" ;;
  362. esac
  363. }
  364.  
  365. CheckLogFile()
  366. {
  367. if [ -f $LOG'.old' ]
  368. then
  369.     RemoveFileNo $LOG'.old'
  370. fi
  371.  
  372. if [ -f $LOG ]
  373. then
  374.     MoveFileNo $LOG $LOG'.old'
  375. fi
  376. }
  377.  
  378. LocateMedia()
  379. {
  380. case $MT in
  381. "cd" ) case $CASE in
  382.      "any" | "upper" ) case "$OSNAME" in 
  383.             "SOL1" )  DNME='SOL1' ;;
  384.             "SOL2" ) DNME='SOL2' ;;
  385.             "HP_UX" ) DNME='HP_UX' ;;
  386.             "OSF1" ) DNME='OSF1' ;;
  387.             "IRIX" ) DNME='IRIX' ;;
  388.             "AIX" ) DNME='AIX' ;;
  389.             "Linux" ) DNME='LINUX' ;;
  390.             esac
  391.             CDDIR=$MP'/'$CDN'/'$DNME'P20' ;;
  392.        "lower" ) case $OSNAME in
  393.                "SOL1" )  DNME='sol1' ;;
  394.                "SOL2" ) DNME='sol2' ;;
  395.                "HP_UX" ) DNME='hp_ux' ;;
  396.                "OSF1" ) DNME='osf1' ;;
  397.                "IRIX" ) DNME='irix' ;;
  398.                "AIX" ) DNME='aix' ;;
  399.                "Linux" ) DNME='linux' ;;
  400.                esac
  401.                CDDIR=$MP'/'$CDN'/'$DNME'p20' ;;
  402.     esac ;;
  403. "tape" ) CDDIR=$MP ;;
  404. esac
  405.  
  406. SetTarFiles
  407. }
  408.  
  409. MediaHelp()
  410. {
  411. Clear
  412.  
  413. echo ""
  414. echo "This script needs to know the mount point of the CD that"
  415. echo "contains the $LDN distribution. Please indicate"
  416. echo "this directory at the prompt or select from one of the following :"
  417.  
  418. if [ $EV != "\NULL" ]
  419. then
  420.     echo ""
  421.     echo "[Q]uit : Will cause this script to exit. The $ED $EV install"
  422.     echo "will go on to load the next piece of the $ED $EV distribution."
  423.     echo ""
  424.     echo "[A]bort : Will cause $ED $EV loading to exit."
  425. else
  426.     echo ""
  427.     echo "[A]bort : Will cause this script to exit."
  428. fi
  429.  
  430. echo ""
  431. echo "[H]elp : Displays this help information."
  432.  
  433. AwaitEnter
  434. Clear
  435. Media
  436. }
  437.  
  438. Media()
  439. {
  440. Echo ""
  441. case $MT in
  442. "cd" ) Echo "What is the mount point for the $LDN CD-ROM,"
  443.     Echo "[Q]uit loading $SN, or [H]elp?" ;;
  444. "tape" ) Echo "What device is the $LDN media accessible through,"
  445.     Echo "[Q]uit loading $SN, or [H]elp?";;
  446. esac
  447.  
  448. Echo ""
  449. Echon "[ $MP ] : "
  450. read RESP
  451.  
  452. case $EV in
  453. "\NULL" ) case $RESP in
  454.     [aA] ) Terminated 1 ;;
  455.     [qQ] ) Terminated 2 ;;
  456.     [hH] ) MediaHelp ;;
  457.     [a-zA-Z0-9/_]* ) MP=$RESP;;
  458.     * ) ;;
  459.     esac ;;
  460. * ) case "$RESP" in
  461.     [qQ] ) Terminated 2 ;;
  462.     [hH] ) MediaHelp ;;
  463.     [a-zA-Z0-9/_]* ) MP=$RESP;;
  464.     * ) ;;
  465.     esac ;;
  466. esac
  467.  
  468. SPACES=`echo $MP | awk '{print $2}'`
  469. if [ "X" != "${SPACES}X" ]
  470. then
  471.     Clear
  472.     Echo ""
  473.     Echo "$MP does not exist. Please try again."
  474.     Media
  475. else
  476.     LocateMedia
  477.  
  478.     if [ ! -d $CDDIR ]   #if we didn't see the CD try lowercase names
  479.     then
  480.         TMPCASE=$CASE
  481.         TMPCDDIR=$CDDIR
  482.         CASE='lower'
  483.         LocateMedia
  484.         if [ ! -d $CDDIR ] # try looking for the uppercase names
  485.         then
  486.             CASE='upper'
  487.             LocateMedia
  488.             if [ ! -d $CDDIR ] #didn't see either case so restore
  489.             then
  490.                 CASE=$TMPCASE
  491.                 CDDIR=$TMPCDDIR
  492.                 LocateMedia
  493.             fi
  494.         fi
  495.     fi
  496. fi
  497. }
  498.  
  499. FindMedia()
  500. {
  501. case $MT in
  502. "cd" ) while [ ! -d $CDDIR ]
  503.     do
  504.     Echo ""
  505.     Log "Unfortunately the $LDN"
  506.     Logn "is not accessible through $MP."
  507.     Echo ""
  508.     Media
  509.     done ;;
  510. "tape" ) while [ ! -c $CDDIR ]
  511.     do
  512.     Echo ""
  513.     Log "Unfortunately the $LDN"
  514.     Logn "is not accessible through $MP."
  515.     Echo ""
  516.     Media
  517.     done ;;
  518. esac
  519.  
  520. Log ""
  521. Log "The $LDN distribution has been confirmed"
  522. Log "to be accessible through $MP."
  523. AwaitEnter
  524. }
  525.  
  526.  
  527. DirectoryHelp()
  528. {
  529. Clear
  530.  
  531. echo ""
  532. if [ $EV != "\NULL" ]
  533. then
  534. echo "This script needs to know the directory you want to load the $SN piece"
  535. echo "of the $ED $EV distribution to."
  536. else
  537. echo "This script needs to know the directory you want to load $SN to."
  538. fi
  539. echo "Please indicate this directory or select from these choices at the prompt :"
  540.  
  541. echo ""
  542. echo "Press 'h' followed by return to access this help screen."
  543.  
  544. if [ $EV != "\NULL" ]
  545. then
  546.     echo ""
  547.     echo "Press 'q' to quit when prompted. The $ED $EV install will go on to load"
  548.     echo "the next piece of the $ED $EV distribution."
  549.     echo ""
  550.     echo "Press 'a' to exit $ED $EV distribution loading."
  551. else
  552.     echo ""
  553.     echo "Press 'q' to exit the $LS script."
  554. fi
  555.  
  556. AwaitEnter
  557. Clear
  558. Directory
  559. }
  560.  
  561. UseAbsolutePathnames()
  562. {
  563. Clear
  564. Echo ""
  565. Echo "Please use absolute pathnames only."
  566. Directory
  567. }
  568.  
  569. HandleDistAlreadyInstalledHelp()
  570. {
  571. Clear
  572.  
  573. echo ""
  574. echo "The $LDN has been located on `hostname`."
  575. echo "This script attempts to handle this situation."
  576.  
  577. echo "Press 'w' to overwrite the $ABN distribution in"
  578. echo "$TD with the one from your $ABN media."
  579. echo "This will cause the $ABN in $TD to be replaced."
  580.  
  581. echo ""
  582. echo "Press 's' to specify another directory to load $SN into."
  583.  
  584. echo ""
  585. echo "Press 'h' to access this help screen."
  586.  
  587. if [ $EV != "\NULL" ]
  588. then
  589.     echo ""
  590.     echo "Press 'q' to quit when prompted. The $ED $EV install will go on to load"
  591.     echo "the next piece of the $ED $EV distribution."
  592.     echo ""
  593.     echo "Press 'a' to exit $ED $EV distribution loading."
  594. else
  595.     echo ""
  596.     echo "Press 'q' to exit the $LS script."
  597. fi
  598.  
  599. echo ""
  600. echo "Notes of interest are as follows :"
  601. echo ""
  602. echo "If you specify 'w' this will be non-destructive & therefore not"
  603. echo "garaunteed to work. If you still choose this option we strongly"
  604. echo "recommend backing up $TD."
  605. echo ""
  606. echo "We recommend [S]pecifying a new directory in case you want to"
  607. echo "switch between revisions of the $ABN distribution."
  608.  
  609. AwaitEnter
  610. Clear
  611. HandleDistAlreadyInstalled
  612. }
  613.  
  614. HandleDistAlreadyInstalled()
  615. {
  616. Log ""
  617. Log "Do you wish to :"
  618. Log "[W]rite over the $ABN in $TD with $SN,"
  619. Log "[S]pecify a new directory to load $SN,"
  620. if [ $EV != "\NULL" ]
  621. then
  622. Log "[Q]uit loading $SN, [A]bort loading $ED $EV, or [H]elp?"
  623. else
  624. Log "[Q]uit, or [H]elp?"
  625. fi
  626. echo ""
  627. Logn "[ Specify new directory ] : "
  628. read ANSWER
  629.  
  630. case $ANSWER in
  631. [aA] ) if [ $EV != "\NULL" ]
  632.     then
  633.         Terminated 1 
  634.     else
  635.         HandleDistAlreadyInstalled
  636.     fi ;;
  637. [qQ] ) Terminated 2 ;;
  638. [sS] ) Clear ; Directory ;;
  639. [hH] ) HandleDistAlreadyInstalledHelp ;;
  640. [wW] ) FOUNDDIR="1" ;;
  641. [b-gB-Gi-vI-Vx-zX-Z0-9]* ) HandleDistAlreadyInstalled ;;
  642. * ) Clear ; Directory ;;
  643. esac
  644. }
  645.  
  646. PreviousInstallation()
  647. {
  648. Clear
  649. echo ""
  650. Log "A version of $ABN exists in $TD."
  651. HandleDistAlreadyInstalled
  652. }
  653.  
  654. CheckForExistingDistribution()
  655. {
  656. if [ $FOUNDDIR = "0" ]
  657. then
  658. CFILE=$TD'/'$LIB
  659.  
  660. case $OSNAME in 
  661. "Linux" ) if [ -L $CFILE ] || [ -f $CFILE ]
  662.     then
  663.         PreviousInstallation
  664.     fi ;;
  665. "AIX" ) if [ -L $CFILE ] || [ -f $CFILE ]
  666.     then
  667.         PreviousInstallation
  668.     fi ;;
  669. "OSF1" ) if [ -c $CFILE ] || [ -f $CFILE ]
  670.      then
  671.          PreviousInstallation
  672.      fi ;;
  673. "SOL1" ) if [ -h $CFILE ] || [ -f $CFILE ]
  674.     then
  675.         PreviousInstallation
  676.     fi ;;
  677. "SOL2" ) if [ -h $CFILE ] || [ -f $CFILE ]
  678.     then
  679.         PreviousInstallation
  680.     fi ;;
  681. "HP_UX" ) if [ -h $CFILE ] || [ -f $CFILE ]
  682.     then
  683.         PreviousInstallation
  684.     fi ;;
  685. "IRIX" ) if [ -h $CFILE ] || [ -f $CFILE ]
  686.     then
  687.         PreviousInstallation
  688.     fi ;;
  689. esac
  690. fi
  691. }
  692.  
  693. CheckForExistingBXDistribution()
  694. {
  695. FOUNDBX='0'
  696. CFILE=$TD'/bin/bx'
  697. if [ -x $CFILE ]
  698. then
  699.     if $CFILE -version 2>&1 | grep $EVERS > /dev/null
  700.     then
  701.         FOUNDBX='1'
  702.     fi
  703. else
  704.     Clear
  705.     Echo ""
  706.     Echo "Unfortunately BX does not reside in $TD."
  707. #    Echo "Unfortunately the BX in $TD is not an executable."
  708.     Directory
  709. fi
  710. }
  711.  
  712. Directory()
  713. {
  714. if [ $DIRPASSEDIN = "1" ]
  715. then
  716.     DIRPASSEDIN='0'
  717.     DirectoryExistsCheck
  718. else
  719. DXMessage
  720. Echo ""
  721. if [ $EV != "\NULL" ]
  722. then
  723. echo "What is the directory name that you want the $LDN"
  724. echo "distribution loaded to, [Q]uit loading the $LDN"
  725. echo "distribution, [A]bort loading & linking $ED $EV, or [H]elp?"
  726. else
  727. Echo "What is the directory name that you want the $LDN" 
  728. Echo "distribution loaded to, [Q]uit, or [H]elp?"
  729. fi
  730.  
  731. Echo ""
  732. Echon "[ $TD ] : "
  733. read RESP
  734.  
  735. case $EV in
  736. "\NULL" ) case $RESP in
  737.     [qQ] ) Terminated 1 ;;
  738.     [hH] ) DirectoryHelp ;;
  739.     "/" ) TD=$RESP ;;
  740.     /[a-zA-Z0-9/_]* ) TD=$RESP ;;
  741.     [a-zA-Z0-9/_]* ) UseAbsolutePathnames ;;
  742.     [.]* ) UseAbsolutePathnames ;;
  743.     * ) ;;
  744.     esac ;;
  745. * ) case $RESP in
  746.     [aA] ) Terminated 1 ;;
  747.     [qQ] ) Terminated 2 ;;
  748.     [hH] ) DirectoryHelp ;;
  749.     "/" ) TD=$RESP ;;
  750.     /[a-zA-Z0-9/_]* ) TD=$RESP ;;
  751.     [a-zA-Z0-9/_]* ) UseAbsolutePathnames ;;
  752.     [.]* ) UseAbsolutePathnames ;;
  753.     * ) ;;
  754.     esac ;;
  755. esac
  756.  
  757. SPACES=`echo $TD | awk '{print $2}'`
  758. if [ "X" != "${SPACES}X" ]
  759. then
  760.     Clear
  761.     Echo ""
  762.     Echo "I cannot find the directory $TD. Please try again."
  763.     Directory
  764. else
  765.     DirectoryExistsCheck
  766. fi
  767. fi
  768. }
  769.  
  770. DirectoryExistsCheck()
  771. {
  772. if [ ! -d $TD ]
  773. then
  774.     if [ $AN = "DXORA" ] || [ $AN = "DXSYB" ]
  775.     then
  776.         Clear
  777.         Directory
  778.     else
  779.         ToCreateDirectory
  780.     fi
  781.     else
  782.     if [ $AN = "DXORA" ] || [ $AN = "DXSYB" ]
  783.     then
  784.         CheckForExistingBXDistribution
  785.         if [ $FOUNDBX = "1" ]
  786.         then
  787.             CheckForExistingDistribution
  788.         fi
  789.     else
  790.         CheckForExistingDistribution
  791.     fi
  792. fi
  793. }
  794.  
  795. DirectoryConfirmation()
  796. {
  797. Echo ""
  798. Log "The $LDN will be loaded into"
  799. Log "$TD."
  800. AwaitEnter
  801. }
  802.  
  803. DirectoryWriteCheck()
  804. {
  805. CheckWritePermissions $TD/$LS.$$
  806.  
  807. if [ $TOUCHER != "0" ]
  808. then
  809.     Echo ""
  810.     Echo "The $SN cannot be loaded into $TD"
  811.     Echo "due to write access permissions."
  812.     Directory
  813. fi
  814. }
  815.  
  816. ToCreateDirectoryHelp()
  817. {
  818. Clear
  819.  
  820. echo ""
  821. echo "This script is inquiring if you want to create the directory"
  822. echo "$TD to load the $SN distribution into :"
  823.  
  824. echo ""
  825. echo "Press 'y' followed by return to create $TD."
  826.  
  827. echo ""
  828. echo "Press 'n' followed by return to be prompted for a new directory to load"
  829. echo "the $SN distribution into."
  830.  
  831. echo ""
  832. echo "Press 'h' followed by return to display this help information."
  833.  
  834. if [ $EV != "\NULL" ]
  835. then
  836.     echo ""
  837.     echo "Press 'q' to quit when prompted. The $ED $EV install will go on to load"
  838.     echo "the next piece of the $ED $EV distribution."
  839.     echo ""
  840.     echo "Press 'a' to exit $ED $EV distribution loading."
  841. else
  842.     echo ""
  843.     echo "Press 'q' to exit the $LS script."
  844. fi
  845.  
  846. AwaitEnter
  847. ToCreateDirectory
  848. }
  849.  
  850. ToCreateDirectory()
  851. {
  852. Clear
  853. echo ""
  854. echo "The directory $TD does not exist."
  855. if [ $EV != "\NULL" ]
  856. then
  857. echo "Do you want to create $TD [Y/N],"
  858. echo "[Q]uit loading the $LDN distribution,"
  859. echo "[A]bort loading $ED $EV, or [H]elp?"
  860. else
  861. echo "Do you want to create $TD [Y/N],"
  862. echo "[Q]uit, or [H]elp?"
  863. fi
  864.  
  865. echo ""
  866. Echon "[ Y ] : "
  867. read ANSWER
  868.  
  869. case $EV in
  870. "\NULL" ) case $ANSWER in
  871.     [qQ] ) Terminated 1 ;;
  872.     [yY] ) CreateDirectory $TD ;;
  873.     [nN] ) Clear; Directory ;;
  874.     [hH] ) ToCreateDirectoryHelp ;;
  875.     [a-zA-Z0-9]* ) ToCreateDirectory ;;
  876.     * ) CreateDirectory $TD ;;
  877.     esac ;;
  878. * ) case "$ANSWER" in
  879.     [aA] ) Terminated 1 ;;
  880.     [qQ] ) Terminated 2 ;;
  881.     [yY] ) CreateDirectory $TD ;;
  882.     [nN] ) Clear ; Directory ;;
  883.     [hH] ) ToCreateDirectoryHelp ;;
  884.     [a-zA-Z0-9]* ) ToCreateDirectory ;;
  885.     * ) CreateDirectory $TD ;;
  886.     esac;;
  887. esac
  888. }
  889.  
  890. CheckErrors()
  891. {
  892. if [ $MVER = "1" ]
  893. then
  894.     Echo ""
  895.     Log "-There were problems encountered moving files."
  896.     ERR='1'
  897. fi
  898.  
  899. if [ $RMER = "1" ]
  900. then
  901.     Echo ""
  902.     Log "-There were problems encountered removing files."
  903.     ERR='1'
  904. fi
  905.  
  906. if [ $MKDER = "1" ]
  907. then
  908.     Echo ""
  909.     Log "-There were problems encountered creating directories."
  910.     ERR='1'
  911. fi
  912.  
  913. if [ $CHMODER = "1" ]
  914. then
  915.     Echo ""
  916.     Log "-There were problems encountered changing permissions."
  917.     ERR='1'
  918. fi
  919.  
  920. if [ $ZCATER = "1" ]
  921. then
  922.     Echo ""
  923.     Log "-There were problems uncompressing the $LDN"
  924.     Log "distribution in the directory $TD due to permissions."
  925.     ERR='1'
  926. fi
  927.  
  928. if [ $TARER = "1" ]
  929. then
  930.     Echo ""
  931.     Log "-There were problems untarring the $LDN distribution."
  932.     ERR='1'
  933. fi
  934.  
  935. if [ $ZCATER = "1" ] && [ $TARER = "1" ]
  936. then
  937.     Echo ""
  938.     Log "The untar problems were due to uncompression failure."
  939.     ERR='1'
  940. fi
  941. }
  942.  
  943. Closing()
  944. {
  945. CheckErrors
  946.  
  947. if [ $ERR = "0" ]
  948. then
  949.     Echo ""
  950.     Log "$LDN distribution Load Finished"
  951.     Log "- `hostname` `date`."
  952. else
  953.     Log ""
  954.     Log "We recommend examining the permissions on $TD"
  955.     
  956.     if [ `$WHOAMI` != "root" ]
  957.     then
  958.         Log "and executing $MP/$LS as root."
  959.     else
  960.         Log "and executing $MP/$LS again."
  961.     fi
  962. fi
  963.  
  964. Message
  965. Exit $ERR
  966. }
  967.  
  968. Terminated()
  969. {
  970. SAFE=$1
  971. Clear
  972. if [ $EV = "\NULL" ]
  973. then
  974. Log ""
  975. Log "$LDN distribution Load Terminated"
  976. Log "- `hostname` `date`."
  977. Log ""
  978. Log "Warning: You will need to complete the $LS script to"
  979. Log "sucessfully load the $LDN distribution."
  980. Message
  981. fi
  982. Exit $1
  983. }
  984.  
  985. Exit()
  986. {
  987. exit $1
  988. }
  989.  
  990. MoveFileNo()
  991. {
  992. $MV $1 $1.old
  993. ER=$?
  994. #Log "MV RETURN CODE -> $ER"
  995. if [ $ER != "0" ]
  996. then
  997. MVER=$ER
  998. DetermineUID
  999. fi
  1000. }
  1001.  
  1002. RemoveFileNo()
  1003. {
  1004. $RM $1
  1005. ER=$?
  1006. #Log "RM RETURN CODE -> $ER"
  1007. if [ $ER != "0" ]
  1008. then
  1009. RMER=$ER
  1010. DetermineUID
  1011. fi
  1012. }
  1013.  
  1014. CheckWritePermissions()
  1015. {
  1016. TOUCHER='0'
  1017. SAVE=$1
  1018. $TOUCH $SAVE
  1019. ER=$?
  1020. #Log "TOUCH RETURN CODE -> $ER"
  1021. if [ $ER != "0" ]
  1022. then
  1023.     TOUCHER=$ER
  1024.     DetermineUID
  1025. else
  1026.     RemoveFileNo $1
  1027. fi
  1028. }
  1029.  
  1030. CreateDirectory()
  1031. {
  1032. SAVE=$1
  1033. $MKDIR $SAVE
  1034. ER=$?
  1035. #Log "MKDIR RETURN CODE -> $ER"
  1036. MKDER=$ER
  1037. if [ $ER != "0" ]
  1038. then
  1039.     DetermineUID
  1040. fi
  1041. }
  1042.  
  1043. MakeLink()
  1044. {
  1045. SAVE=$1
  1046. SAVE2=$2
  1047.  
  1048. case $OSNAME in
  1049. "AIX" )  if [ -L $2 ]
  1050.     then
  1051.         rm $2
  1052.     fi ;;
  1053. "OSF1" )  if [ -e $2 ]
  1054.     then
  1055.         rm $2
  1056.     fi ;;
  1057. "SOL2" | "SOL1" | "HP_UX" | "Linux" )  if [ -h $2 ]
  1058.                     then
  1059.                         rm $2
  1060.                     fi ;;
  1061. "IRIX" )  if [ -l $2 ]
  1062.     then
  1063.         rm $2
  1064.     fi ;;
  1065. esac
  1066.  
  1067. $LN $SAVE $SAVE2
  1068. ER=$?
  1069. #Log "LINK RETURN CODE -> $ER"
  1070. if [ "$ER" != "0" ]
  1071. then
  1072.     LNER=$ER
  1073.     DetermineUID
  1074. fi
  1075. }
  1076.  
  1077. LoadDirectoryPreamble()
  1078. {
  1079. Clear
  1080. Echo ""
  1081. Echo "This script is inquiring the directory you want to load"
  1082. Echo "the $LDN distribution into."
  1083. }
  1084.  
  1085. FindMediaPreamble()
  1086. {
  1087. Clear
  1088. Echo ""
  1089. Echo "This script attempts to locate the $LDN"
  1090. Echo "$MT in $MP. If unsuccessful you will be prompted for the"
  1091. Echo "correct location."
  1092. }
  1093.  
  1094. DecryptionKeyPreamble()
  1095. {
  1096. Clear
  1097. Echo ""
  1098. Echo "This script is inquiring for your $LDN decryption key."
  1099. Echo ""
  1100. Echo "Notes of interest are as follows :"
  1101. Echo ""
  1102. Echo "If you want to load an evaluation version of $SN press return at the"
  1103. Echo "decryption key prompt."
  1104. Echo ""
  1105. Echo "If you are loading the release version of $SN then enter the decryption"
  1106. Echo "key as it appears in the document '$SN Decryption Key Information'"
  1107. Echo "enclosed with this distribution."
  1108. Echo ""
  1109. Echo "If you are loading the release version of $SN and you cannot locate the"
  1110. Echo "'$SN Decryption Key Information' document please email support@ics.com"
  1111. Echo "or call our ICS Tech Support department at 617-621-0060."
  1112. }
  1113.  
  1114. CheckDecryptionKey()
  1115. {
  1116. if [ -f $CDDIR'/detar' ]
  1117. then
  1118.     if $CDDIR/detar -auth $KEY 
  1119.     then
  1120.         AUTHRESULT="0"
  1121.     fi
  1122. elif [ -f $CDDIR'/DETAR' ]
  1123. then
  1124.     if $CDDIR/DETAR -auth $KEY 
  1125.     then
  1126.         AUTHRESULT="0"
  1127.     fi
  1128. fi
  1129.  
  1130. if [ $AUTHRESULT != "0" ]
  1131. then
  1132.     Echo ""
  1133.     Echo "$KEY is an invalid key."
  1134. fi
  1135. }
  1136.  
  1137. DecryptionKeyHelp()
  1138. {
  1139. DecryptionKeyPreamble
  1140. AwaitEnter
  1141. Clear
  1142. }
  1143.  
  1144. DecryptionKey()
  1145. {
  1146. AUTHRESULT='1'
  1147. KEY=`echo $KEY | awk '{print $1}'`
  1148. if [ "X" != "${KEY}X" ]
  1149. then
  1150.     CheckDecryptionKey
  1151. fi
  1152.  
  1153. while [ $AUTHRESULT != "0" ]
  1154. do
  1155.     echo ""
  1156.     echo "Enter your $SN decryption key, press <return> to load an evaluation"
  1157.     Echon "version of $SN, [H]elp, or [Q]uit : "
  1158.  
  1159.     read RESP
  1160.  
  1161.     case $RESP in
  1162.     "" ) KEY=$RESP; AUTHRESULT='0' ;;
  1163.     [qQ] ) Terminated 1 ;;
  1164.     [hH] ) DecryptionKeyHelp ;;
  1165.     [a-zA-Z0-9/_]* ) KEY=$RESP ;;
  1166.     esac
  1167.  
  1168.     SPACES=`echo $KEY | awk '{print $2}'`
  1169.     if [ "X" != "${SPACES}X" ]
  1170.     then
  1171.         Clear
  1172.         echo ""
  1173.         echo "$KEY is an invalid key."
  1174.         echo "Decryption keys are 13 Uppercase characters with no spaces."
  1175.     else
  1176.         if [ $AUTHRESULT != '0' ]
  1177.         then
  1178.             if [ $RESP != 'h' ] || [ $RESP != 'H' ] # help not chosen 
  1179.             then
  1180.                 CheckDecryptionKey
  1181.             fi
  1182.         fi
  1183.     fi
  1184. done
  1185. }
  1186.  
  1187. MakeLinksPreamble()
  1188. {
  1189. Clear
  1190. Echo ""
  1191. Echo "This script is inquiring if you would like to create symbolic links that"
  1192. Echo "will make the $SN loaded to $TD the default"
  1193. Echo "$LDN on `$HOSTNAME`."
  1194. Echo ""
  1195. Echo "Notes of interest are as follows :"
  1196. Echo ""
  1197. Echo "If you wish to make links at at later time you can execute the script"
  1198. Echo "$TD/$MLS."
  1199. Echo ""
  1200. Echo "If you wish to create these symbolic links by hand refer to the section"
  1201. Echo "'Making Links By Hand' in the $SN Installation Notes."
  1202. }
  1203.  
  1204. MakeLinksHelp()
  1205. {
  1206. MakeLinksPreamble
  1207. if [ $MULTIPLESETS = "1" ]
  1208. then
  1209. Echo ""
  1210. Echo "The sets that you select will be symbolically linked to directories"
  1211. Echo "under /."
  1212. Echo ""
  1213. Echo "To select a $SN set enter the number corresponding to that set"
  1214. Echo "followed by return."
  1215. Echo ""
  1216. Echo "To unselect a $SN set enter the number corresponding to that set"
  1217. Echo "followed by return."
  1218. Echo ""
  1219. Echo "When you are finished selecting/unselecting press <return> to continue."
  1220. else
  1221. Echo ""
  1222. Echo "The symbolic links will be created from directories under /."
  1223. Echo ""
  1224. Echo "Press 'y' followed by return to create these symbolic links."
  1225. Echo ""
  1226. Echo "Press 'n' followed by return to keep from creating these symbolic links."
  1227. fi
  1228. Echo ""
  1229. Echo "Press 'h' followed by return to access this help screen."
  1230. Echo ""
  1231. Echo "Press 'q' followed by return to quit the $LS script."
  1232. AwaitEnter
  1233. Clear
  1234. }
  1235.  
  1236. MakeLinks()
  1237. {
  1238. PROMPT=1
  1239. LINKDOC='0'
  1240. LINKLIB='0'
  1241. while [ $PROMPT = "1" ]
  1242. do
  1243. case $MULTIPLESETS in
  1244. "1" ) Echo ""
  1245.     Echo "Please select the number of the $SN set(s) you wish to link :"
  1246.     Echo ""
  1247.  
  1248.     if [ $LOADLIB = "1" ]
  1249.     then
  1250.     case $LINKLIB in
  1251.     "0" ) echo "   1. $SN libraries and include files" ;;
  1252.     "1" ) echo " * 1. $SN libraries and include files" ;;
  1253.     esac
  1254.     fi
  1255.  
  1256.     if [ $LOADDOC = "1" ]
  1257.     then
  1258.     case $LINKDOC in
  1259.     "0" ) echo "   2. $SN man pages" ;;
  1260.     "1" ) echo " * 2. $SN man pages" ;;
  1261.     esac
  1262.     fi
  1263.  
  1264.     if [ $LOADLIB = "1" ] && [ $LOADDOC = "1" ]
  1265.     then
  1266.     if [ $LINKLIB = "1" ] && [ $LINKDOC = "1" ]
  1267.     then
  1268.         echo " * 3. All $SN sets"
  1269.     else
  1270.         echo "   3. All $SN sets"
  1271.     fi
  1272.     fi
  1273.  
  1274.     Echo ""
  1275.     Echo "Enter the number corresponding to the set to select/unselect,"
  1276.     Echo "[H]elp, [Q]uit loading the $LDN distribution,"
  1277.     Echon "or press <return> when finished selecting : "
  1278.  
  1279.     read RESP
  1280.  
  1281.     case $RESP in
  1282.     [qQ] ) Terminated 1 ;;
  1283.     [hH] ) MakeLinksHelp ;;
  1284.     "1" ) Clear
  1285.         if [ $LOADLIB = "1" ]
  1286.         then
  1287.         case $LINKLIB in
  1288.         "0" ) LINKLIB='1' ;;
  1289.         "1" ) LINKLIB='0' ;;
  1290.         esac
  1291.         fi ;;
  1292.     "2" ) Clear
  1293.         if [ $LOADDOC = "1" ]
  1294.         then
  1295.         case $LINKDOC in
  1296.         "0" ) LINKDOC='1' ;;
  1297.         "1" ) LINKDOC='0' ;;
  1298.         esac
  1299.         fi;;
  1300.     "3" ) Clear
  1301.         if [ $LOADLIB = "1" ] && [ $LOADDOC = "1" ]
  1302.         then
  1303.             if [ $LINKLIB = "1" ] && [ $LINKDOC = "1" ]
  1304.             then
  1305.                 LINKLIB='0' ; LINKDOC='0' ;
  1306.             else
  1307.                 LINKLIB='1' ; LINKDOC='1' ;
  1308.             fi
  1309.         fi ;;
  1310.     [a-zA-Z0-9]* ) Clear ;;
  1311.     * ) PROMPT='0' ;;
  1312.     esac ;;
  1313. "0" ) echo ""
  1314.     echo "Would you like to create symbolic links that will make the"
  1315.     echo "$LDN that's loaded into $TD"
  1316.     echo "the default $ABN on `hostname` [Y/N], [H]elp, or [Q]uit?"
  1317.     Echo ""
  1318.     Echon "[ Y ] : "
  1319.     read RESP
  1320.  
  1321.     case $RESP in
  1322.     [qQ] ) Terminated 1 ;;
  1323.     [hH] ) MakeLinksHelp ;;
  1324.     [yY] ) LINKLIB='1'; PROMPT='0' ;;
  1325.     [nN] ) LINKLIB='0'; PROMPT='0' ;;
  1326.     [a-gA-Gi-mI-Mo-pO-Pr-zR-Z0-9]* ) Clear ; Echo ""
  1327.          Echo "Please select from the available choices." ;;
  1328.     * ) LINKLIB='1'; PROMPT='0' ;;
  1329.     esac ;;
  1330. esac
  1331. done
  1332.  
  1333. if [ $LINKLIB = "1" ] || [ $LINKDOC = "1" ]
  1334. then
  1335.     MAKELINKS='1'
  1336. else
  1337.     MAKELINKS='0'
  1338. fi
  1339.  
  1340. }
  1341.  
  1342. FlexLMPreamble()
  1343. {
  1344. Clear
  1345. Echo ""
  1346. Echo "This script is inquiring if you would like to install the required"
  1347. Echo "Flexible License Manager Software (FlexLM) required to run $SN."
  1348. Echo ""
  1349. Echo "Notes of interest are as follows :"
  1350. Echo ""
  1351. Echo "If you already have FlexLM $OFLEXLMV installed for another product than you"
  1352. Echo "do not need to install the FlexLM software that comes with this $SN"
  1353. Echo "distribution. Otherwise you will need to as $SN requires FlexLM $OFLEXLM."
  1354. Echo ""
  1355. Echo "If you decide to install FlexLM at a later time you can execute"
  1356. Echo "$TD/install.lm."
  1357. }
  1358.  
  1359. FlexLMHelp()
  1360. {
  1361. FlexLMPreamble
  1362. Echo ""
  1363. Echo "Press 'y' followed by return to install the Flexible License Manager."
  1364. Echo ""
  1365. Echo "Press 'n' followed by return to keep from installing the Flexible"
  1366. Echo "License Manager"
  1367. Echo ""
  1368. Echo "Press 'h' followed by return to access this help screen."
  1369. Echo ""
  1370. Echo "Press 'q' followed by return to quit the $LS script."
  1371. AwaitEnter
  1372. Clear
  1373. }
  1374.  
  1375. FlexLM()
  1376. {
  1377. PROMPT='1'
  1378. IFLXLM='0'
  1379. while [ $PROMPT = "1" ]
  1380. do
  1381.     Echo ""
  1382.     Echo "Do you wish to install the Flexible License Manager $OFLEXLMV"
  1383.     Echo "(FlexLM) software [Y/N], [H]elp, or [Q]uit?"
  1384.  
  1385.     Echo ""
  1386.     Echon "[ Y ] : "
  1387.  
  1388.     read RESP
  1389.  
  1390.     case $RESP in
  1391.     [yY] ) PROMPT=0 ; IFLXLM='1' ;;
  1392.     [nN] ) PROMPT=0 ; IFLXLM='0' ;;
  1393.     [qQ] ) Terminated 1 ;;
  1394.     [hH] ) FlexLMHelp ;;
  1395.     [b-gB-Gi-mI-Mo-pO-Pr-z-R-Z0-9]* ) Clear
  1396.          Echo "" ; Echo "Please select an available option." ;;
  1397.     * ) PROMPT=0 ; IFLXLM='1' ;;
  1398.     esac
  1399. done
  1400. }
  1401.  
  1402. LMKeyPreamble()
  1403. {
  1404. Clear
  1405. Echo ""
  1406. Echo "This script is inquiring if you would like to install your $SN"
  1407. Echo "Flexible License Manager Key."
  1408. Echo ""
  1409. Echo "Notes of interest are as follows :"
  1410. Echo ""
  1411. Echo "$ABN $OREV keys are valid for $SN."
  1412. Echo ""
  1413. Echo "If you have a $ABN $OREV key you will not need to install a new FlexLM"
  1414. Echo "key for $SN."
  1415. Echo ""
  1416. Echo "If you do not have an activation key then read and follow the instructions"
  1417. Echo "on the enclosed document 'The ICS LICENSE MANAGER' to obtain the appropriate"
  1418. Echo "$SN FlexLM activation key."
  1419. Echo ""
  1420. Echo "To install your $SN Flexlm activation key at a later time execute the script"
  1421. Echo "$TD/addlmkey."
  1422. }
  1423.  
  1424. LMKeyHelp()
  1425. {
  1426. LMKeyPreamble
  1427. Echo ""
  1428. Echo "Press 'y' followed by return to install your $SN License Manager"
  1429. Echo "Activation Key."
  1430. Echo ""
  1431. Echo "Press 'n' followed by return to keep from installing a $SN License"
  1432. Echo "License Manager Activation Key."
  1433. Echo ""
  1434. Echo "Press 'h' followed by return to access this help screen."
  1435. Echo ""
  1436. Echo "Press 'q' followed by return to quit the $LS script."
  1437. AwaitEnter
  1438. Clear
  1439. }
  1440.  
  1441. LMKey()
  1442. {
  1443. PROMPT='1'
  1444. IFLXLMKEY='0'
  1445. while [ $PROMPT = "1" ]
  1446. do
  1447.     Echo ""
  1448.     Echo "Do you wish to install your $SN License Manager Activation Key"
  1449.     Echo "[Y/N], [H]elp, or [Q]uit?"
  1450.  
  1451.     Echo ""
  1452.     Echon "[ Y ] : "
  1453.  
  1454.     read RESP
  1455.  
  1456.     case $RESP in
  1457.     [yY] ) PROMPT=0 ; IFLXLMKEY='1' ;;
  1458.     [nN] ) PROMPT=0 ; IFLXLMKEY='0' ;;
  1459.     [qQ] ) Terminated 1 ;;
  1460.     [hH] ) LMKeyHelp ;;
  1461.     [b-gB-Gi-mI-Mo-pO-Pr-z-R-Z0-9]* ) Clear
  1462.          Echo "" ; Echo "Please select an available option." ;;
  1463.     * ) PROMPT=0 ; IFLXLMKEY='1' ;;
  1464.     esac
  1465. done
  1466. }
  1467.  
  1468. ChooseSetsPreamble()
  1469. {
  1470. Clear
  1471. Echo ""
  1472. Echo "This script is inquiring which $SN sets you would like to load."
  1473. }
  1474.  
  1475. ChooseSetsHelp()
  1476. {
  1477. ChooseSetsPreamble
  1478. Echo ""
  1479. Echo "The sets that you select will be loaded to $TD."
  1480. Echo ""
  1481. Echo "To select a $SN set enter the number corresponding to that set"
  1482. Echo "followed by return."
  1483. Echo ""
  1484. Echo "To unselect a $SN set enter the number corresponding to that set"
  1485. Echo "followed by return."
  1486. Echo ""
  1487. Echo "When you are finished selecting/unselecting press <return> to continue."
  1488. Echo ""
  1489. Echo "Press 'h' followed by return to access this help screen."
  1490. Echo ""
  1491. Echo "Press 'q' followed by return to quit the $LS script."
  1492. AwaitEnter
  1493. Clear
  1494. }
  1495.  
  1496. ChooseSets()
  1497. {
  1498. PROMPT='1'
  1499. LOADDOC='0'
  1500. LOADLIB='0'
  1501. LOADDEMO='0'
  1502. while [ $PROMPT = "1" ]
  1503. do
  1504. Echo ""
  1505. Echo "Please select the number of the $SN set(s) you wish to load :"
  1506. Echo ""
  1507. case $LOADLIB in
  1508. "0" ) echo "   1. $LIBSET" ;;
  1509. "1" ) echo " * 1. $LIBSET" ;;
  1510. esac
  1511. case $LOADDEMO in
  1512. "0" ) echo "   2. $DEMOSET" ;;
  1513. "1"  )echo " * 2. $DEMOSET" ;;
  1514. esac
  1515. case $LOADDOC in
  1516. "0" ) echo "   3. $DOCSET" ;;
  1517. "1" ) echo " * 3. $DOCSET" ;;
  1518. esac
  1519. if [ $LOADLIB = "1" ] && [ $LOADDEMO = "1" ] && [ $LOADDOC = "1" ]
  1520. then
  1521.     echo " * 4. All $SN sets    $TOTALSIZE"
  1522. else
  1523.     echo "   4. All $SN sets    $TOTALSIZE"
  1524. fi
  1525.  
  1526. Echo ""
  1527. Echo "Enter the number corresponding to the set to select/unselect,"
  1528. Echo "[H]elp, [Q]uit loading the $LDN distribution,"
  1529. Echon "or press <return> when finished selecting : "
  1530.  
  1531. read RESP
  1532.  
  1533. case $RESP in
  1534. [qQ] ) Terminated 1 ;;
  1535. [hH] ) ChooseSetsHelp ;;
  1536. "1" ) Clear
  1537.     case $LOADLIB in
  1538.     "0" ) LOADLIB='1' ;;
  1539.     "1" ) LOADLIB='0' ;;
  1540.     esac;;
  1541. "2" ) Clear
  1542.     case $LOADDEMO in
  1543.     "0" ) LOADDEMO='1' ;;
  1544.     "1" ) LOADDEMO='0' ;;
  1545.     esac;;
  1546. "3" ) Clear
  1547.     case $LOADDOC in
  1548.     "0" ) LOADDOC='1' ;;
  1549.     "1" ) LOADDOC='0' ;;
  1550.     esac;;
  1551. "4" ) Clear
  1552.     if [ $LOADLIB = "1" ] && [ $LOADDEMO = "1" ] && [ $LOADDOC = "1" ]
  1553.     then
  1554.         LOADLIB='0' ; LOADDEMO='0' ; LOADDOC='0' ;
  1555.     else
  1556.         LOADLIB='1' ; LOADDEMO='1' ; LOADDOC='1' ;
  1557.     fi ;;
  1558. [a-zA-Z0-9]* ) Clear ; Echo "" ; Echo "Please select from the avaliable choices." ;;
  1559. * )    if [ $LOADLIB = "0" ] && [ $LOADDEMO = "0" ] && [ $LOADDOC = "0" ]
  1560.     then
  1561.         Clear
  1562.         Echo ""
  1563.         Echo "You will need to select one of the $SN sets before continuing."
  1564.     else
  1565.         PROMPT='0'
  1566.     fi ;;
  1567. esac
  1568.  
  1569. done
  1570.  
  1571. IFLXLM='0'
  1572. IFLXLMKEY='0'
  1573. }
  1574.  
  1575. ModifyImakePreamble()
  1576. {
  1577. Clear
  1578. Echo ""
  1579. Echo "To properly install $SN you will need to have your Imake Configuration"
  1580. Echo "Files updated. This script is inguiring if you wish to have this process"
  1581. Echo "completed by this script."
  1582. Echo ""
  1583. Echo "Notes of interest are as follows :"
  1584. Echo ""
  1585. Echo "If you wish to update your Imake Configuration Files by hand you can refer"
  1586. Echo "to the section 'Updating Your Imake Configuration Files' in the $SN"
  1587. Echo "Installation notes."
  1588. }
  1589.  
  1590. ModifyImake()
  1591. {
  1592. PROMPT='1'
  1593. MODIMAKE='0'
  1594. while [ $PROMPT = "1" ]
  1595. do
  1596.     Echo ""
  1597.     Echo "Do you wish to update your Imake Configuration Files [Y/N], [H]elp, or [Q]uit?"
  1598.  
  1599.     Echo ""
  1600.     Echon "[ Y ] : "
  1601.  
  1602.     read RESP
  1603.  
  1604.     case $RESP in
  1605.     [yY] ) PROMPT=0 ; MODIMAKE='1' ;;
  1606.     [nN] ) PROMPT=0 ; MODIMAKE='0' ;;
  1607.     [qQ] ) Terminated 1 ;;
  1608.     [hH] ) LMKeyHelp ;;
  1609.     [b-gB-Gi-mI-Mo-pO-Pr-z-R-Z0-9]* ) Clear
  1610.          Echo "" ; Echo "Please select an available option." ;;
  1611.     * ) PROMPT=0 ; MODIMAKE='1' ;;
  1612.     esac
  1613. done
  1614. }
  1615.  
  1616. DoubleCheckHelp()
  1617. {
  1618. Clear
  1619. Echo ""
  1620. Echo "If you are statisfied with the current options press <return>."
  1621. Echo ""
  1622. Echo "Press 'r' to reselect your options."
  1623. Echo ""
  1624. Echo "Press 'q' to exit $LS."
  1625. Echo ""
  1626. Echo "Press 'h' to access this help screen."
  1627. AwaitEnter
  1628. Clear
  1629. }
  1630.  
  1631. DoubleCheck()
  1632. {
  1633. if [ $ED = "\NULL" ]
  1634. then
  1635.     Clear
  1636.     PROMPT='1'
  1637. else
  1638.     PROMPT=0
  1639.     RESP=''
  1640. fi
  1641.  
  1642. while [ $PROMPT = "1" ]
  1643. do
  1644. Echo ""
  1645. Echo "Before continuing we want to verify the following :"
  1646.  
  1647. if [ $MULTIPLESETS = "1" ]
  1648. then
  1649.     Echo ""
  1650.     Echo "We will load the following $SN sets to $TD :"
  1651.     if [ $LOADLIB = "1" ]
  1652.     then
  1653.         echo "$LIBSET"
  1654.     fi
  1655.     if [ $LOADDEMO = "1" ]
  1656.     then
  1657.         echo "$DEMOSET"
  1658.     fi
  1659.     if [ $LOADDOC = "1" ]
  1660.     then
  1661.         echo "$DOCSET"
  1662.     fi
  1663. else
  1664.     Echo ""
  1665.     Echo "We will load $SN to $TD."
  1666. fi
  1667.  
  1668.  
  1669. if [ $REQDECRYPTIONKEY = "1" ] && [ $LOADLIB = "1" ] && [ $MT = "cd" ]
  1670. then
  1671.     Echo ""
  1672.     KEY=`echo $KEY | awk '{print $1}'`
  1673.     if [ "X" != "${KEY}X" ]
  1674.     then
  1675.     Echo "We will decrypt the $SN library with this key :"
  1676.     Echo "$KEY"
  1677.     else
  1678.     Echo "You have specified to load the Evaluation Version of $SN."
  1679.     fi
  1680. fi
  1681.  
  1682. if [ $MAKELINKS = '1' ]
  1683. then
  1684. Echo ""
  1685. case $MULTIPLESETS in
  1686. "0" ) Echo "We will create symbolic links to $SN in $TD"
  1687.     Echo "from / that will make it the default $ABN on `hostname`." ;;
  1688. "1" )  Echo "We will symbolically link the following sets to directories under / :"
  1689.     if [ $LINKLIB = "1" ]
  1690.     then
  1691.          Echo "$SN libraries and include files"
  1692.     fi
  1693.  
  1694.     if [ $LINKDOC = "1" ]
  1695.     then
  1696.          Echo "$SN man pages"
  1697.     fi ;;
  1698. esac
  1699. fi
  1700.  
  1701. if [ $REQLMINSTALLATION = "1" ]
  1702. then
  1703.     if [ $IFLXLM = "1" ]
  1704.     then
  1705.         Echo ""
  1706.         Echo "We will install the Flexible Licence Manager $OFLEXLMV (FlexLM) software."
  1707.     fi
  1708. fi
  1709.  
  1710. if [ $REQLMKEY = "1" ]
  1711. then
  1712.     if [ $IFLXLMKEY = "1" ]
  1713.     then
  1714.         Echo ""
  1715.         Echo "We will prompt you for your $SN FlexLM Activation Key."
  1716.     fi
  1717. fi
  1718.  
  1719. if [ $MODIFYIMAKE = "1" ] && [ $LOADLIB = "1" ] && [ $MODIMAKE = "1" ]
  1720. then
  1721.     Echo ""
  1722.     Echo "We will automatically update your Imake Configuration Files."
  1723. fi
  1724.  
  1725. Echo ""
  1726. Echo "Press <return> to install $SN with these options, [R]eselect,"
  1727. Echon "[H]elp, or [Q]uit : "
  1728. read RESP
  1729.  
  1730. case $RESP in
  1731. [a-gA-Gi-pI-Ps-zS-Z0-9]* ) Clear ; Echo "" ;
  1732.      Echo "Please select from the available options." ;;
  1733. [rR] ) PROMPT=0 ;;
  1734. [hH] ) DoubleCheckHelp ;;
  1735. [qQ] ) Terminated 1 ;;
  1736. * ) PROMPT=0 ;;
  1737. esac
  1738. done
  1739.  
  1740. case $RESP in
  1741. [rR] ) LOADLIB='1' ; LOADDEM0='0' ; LOADDOC='0' ; LINKLIB='0' ; LINKDOC='0' ;
  1742.     MAKELINKS='1' ; FOUNDDIR='0' ; KEY='' ; Main ; break ;;
  1743. "" ) Install ; break ;;
  1744. esac
  1745.  
  1746. }
  1747.  
  1748. LoadPiece()
  1749. {
  1750. SET=$1
  1751.  
  1752. case $SET in
  1753. "LIB" ) SET=$LIBTAR ;;
  1754. "DLIB" ) SET=$DLIBTAR ;;
  1755. "DEMO" ) SET=$DEMOTAR ;;
  1756. "DOC" ) SET=$DOCTAR ;;
  1757. esac
  1758.  
  1759. if [ $TARER = "0" ]
  1760. then #if we were able to load the last piece it's ok to load the next piece
  1761.     case $MT in
  1762.     "cd" )  TAR='tar -xpf -'
  1763.         ZCAT='zcat'
  1764.         if $ZCAT < $CDDIR/$SET | $TAR;
  1765.         then
  1766.             TARER='0'
  1767.         else
  1768.             TARER='1'
  1769.         fi ;;
  1770.     "tape" ) TAR='tar -xpf'
  1771.         if $TAR $CDDIR ./$SET;
  1772.         then
  1773.             TARER='0'
  1774.         else
  1775.             TARER='1'
  1776.         fi ;;
  1777.     esac
  1778. fi
  1779. }
  1780.  
  1781. Install()
  1782. {
  1783. cd $TD # change directory to install directory
  1784. case $ED in
  1785. "\NULL" )  Clear
  1786.     Echo ""
  1787.     Echo "Loading the $LDN distribution."
  1788.     Echo ""
  1789.     Echo "Please wait while we are loading $SN."
  1790.     Echo "When $SN has been loaded you will be prompted. Thank you." ;;
  1791. * ) echo ""
  1792.     echo "Currently loading $SN. Please wait..." ;;
  1793. esac
  1794.  
  1795. if [ $LOADLIB = "1" ]
  1796. then
  1797.     if [ $REQDECRYPTIONKEY = "1" ]
  1798.     then
  1799.         KEY=`echo $KEY | awk '{print $1}'`
  1800.         if [ "X" != "${KEY}X" ]
  1801.         then     # LOAD LIB - valid key entered when prompted
  1802.             LoadPiece LIB
  1803.             if [ $TARER = "0" ] # decrypt if tar ok 
  1804.             then
  1805.                 if [ -f $CDDIR'/detar' ]
  1806.                 then
  1807.                     $CDDIR/detar $TD/$LIB'.enc' $KEY 
  1808.                 elif [ -f $CDDIR'/DETAR' ]
  1809.                 then
  1810.                     $CDDIR/DETAR $TD/$LIB'.enc' $KEY 
  1811.                 fi
  1812.             fi
  1813.         else    # LOAD EVAL LIB - return entered when prompted
  1814.             LoadPiece DLIB
  1815.         fi
  1816.     else # LOADREALLIB - no key needed
  1817.         LoadPiece LIB
  1818.     fi
  1819. fi
  1820. if [ $LOADDEMO = "1" ]
  1821. then 
  1822.     LoadPiece DEMO
  1823. fi
  1824. if [ $LOADDOC = "1" ]
  1825. then
  1826.     LoadPiece DOC
  1827. fi
  1828.  
  1829. #initial post-install processing (i.e. confirmation if successfull )
  1830. if [ $TARER = "0" ]
  1831. then
  1832.     ERR='0'
  1833.     case $MT in
  1834.     "tape" ) if [ $LOADLIB = "1" ]
  1835.         then
  1836.             eval '$MV $TD/$LIBTAR/* $TD'
  1837.             eval '$RMDIR $TD/$LIBTAR'
  1838.         fi
  1839.         if [ $LOADDEMO = "1" ]
  1840.         then
  1841.             eval '$MV $TD/$DEMOTAR/* $TD'
  1842.             eval '$RMDIR $TD/$DEMOTAR'
  1843.                fi
  1844.         if [ $LOADDOC = "1" ]
  1845.         then
  1846.             eval '$MV $TD/$DOCTAR/* $TD'
  1847.             eval '$RMDIR $TD/$DOCTAR'
  1848.         fi ;;
  1849.     esac
  1850.     if [ $ED = "\NULL" ]
  1851.     then
  1852.         echo ""
  1853.         echo "The $LDN distribution has been successfully loaded."
  1854.         AwaitEnter
  1855.     else
  1856.         Exit 0
  1857.     fi
  1858. else
  1859.     if [ $ED = "\NULL" ]
  1860.     then
  1861.         echo ""
  1862.         echo "There were problems loading the $LDN distribution."
  1863.         AwaitEnter
  1864.         Clear
  1865.         Closing
  1866.     else
  1867.         Exit 1
  1868.     fi
  1869. fi
  1870.  
  1871. #post-install processing
  1872. if [ $TARER = "0" ] # we don't need this check (taken care of in Install())
  1873. then             # - but just to make sure
  1874. if [ $SPECIALLINKS = "1" ]
  1875. then
  1876.     case $AN in
  1877.     "BX" | "DXORA" | "DXSYB" ) MakeLink $TD/bin/lmutil $TD/bin/lmdown
  1878.             MakeLink $TD/bin/lmutil $TD/bin/lmhostid
  1879.             MakeLink $TD/bin/lmutil $TD/bin/lmremove
  1880.              MakeLink $TD/bin/lmutil $TD/bin/lmreread
  1881.             MakeLink $TD/bin/lmutil $TD/bin/lmstat ;;
  1882.     esac 
  1883. fi
  1884.  
  1885. #if [ $OSNAME = "SOL2" ]  # MAKE THE PACKAGE !!!
  1886. #then
  1887. #    UpdatePackages
  1888. #fi
  1889.  
  1890. if [ $MODIFYIMAKE = "1" ] && [ $LOADLIB = "1" ] && [ $MODIMAKE = "1" ]
  1891. then
  1892.     ModifyImakeConfigFiles
  1893. fi
  1894.  
  1895. if [ $APPDEFPROCESSING = "1" ] && [ $LOADLIB = "1" ]
  1896. then
  1897.     ProcessAppDefaultsFile
  1898. fi
  1899.  
  1900. if [ $SPECIALSCRIPTS = "1" ] && [ $LOADLIB = "1" ]
  1901. then
  1902.     CreateExecutionScripts
  1903. fi
  1904.  
  1905. if [ $ED = "\NULL" ] && [ $MAKELINKS = "1" ]
  1906. then
  1907.     case $MULTIPLESETS in
  1908.     "0" ) MLS="$TD/$MLS $TD"
  1909.         eval $MLS;;
  1910.     "1" ) if [ $LINKLIB = "1" ] && [ $LINKDOC = "1" ]
  1911.         then
  1912.             MLS="$TD/$MLS BOTH"
  1913.             eval $MLS
  1914.         elif [ $LINKLIB = "1" ]
  1915.         then
  1916.             MLS="$TD/$MLS LIB"
  1917.             eval $MLS
  1918.         elif [ $LINKDOC = "1" ]
  1919.         then
  1920.             MLS="$TD/$MLS DOC"
  1921.             eval $MLS
  1922.         fi ;;
  1923.     esac
  1924.     AwaitEnter
  1925. fi
  1926.  
  1927. if [ $IFLXLM = "1" ] && [ $REQLMINSTALLATION = "1" ]
  1928. then
  1929.     FLXI="$TD/install.lm $TD"
  1930.     eval $FLXI
  1931. fi
  1932.  
  1933. if [ $REQLMKEY = "1" ] && [ $IFLXLMKEY = "1" ]
  1934. then
  1935.     FLXKEY="$TD/addlmkey $TD"
  1936.     eval $FLXKEY
  1937. fi
  1938.  
  1939. if [ $ED = "\NULL" ]
  1940. then
  1941.     Clear
  1942.     Closing
  1943. fi
  1944. fi
  1945. }
  1946.  
  1947. UpdatePackages()
  1948. {
  1949. KEY=`echo $KEY | awk '{print $1}'`
  1950. if [ "X" = "${KEY}X" ]
  1951. then
  1952. ADN='E'$ADN
  1953. LDN=$LDN' Evaluation'
  1954. fi
  1955. PKGINST=$ADN
  1956. DATE=`date`
  1957.  
  1958. Clear
  1959. Echo ""
  1960. Echo "Adding package $PKGINST information to `hostname`. Please wait..."
  1961.  
  1962. cd /var/sadm/pkg
  1963. mkdir $PKGINST
  1964. cd ./$PKGINST
  1965. mkdir save
  1966. mkdir install
  1967.  
  1968. echo "CLASSES=usr man demos" >> pkginfo
  1969. echo "TZ=US/Eastern" >> pkginfo
  1970. echo "PATH=/sbin:/usr/sbin:/usr/bin:/usr/sadm/install/bin" >> pkginfo
  1971. echo "OAMBASE=/usr/sadm/sysadm" >> pkginfo
  1972. echo "PKG=$ADN" >> pkginfo
  1973. echo "NAME=$LDN" >> pkginfo
  1974. echo "VERSION=$REV" >> pkginfo
  1975. echo "ARCH=SPARC" >> pkginfo
  1976. echo "CATEGORY=library" >> pkginfo
  1977. echo "VENDOR=Integrated Computer Solutions, Inc." >> pkginfo
  1978. echo "BASEDIR=$TD" >> pkginfo
  1979. echo "PSTAMP=kimchee941226170529" >> pkginfo
  1980. echo "PKGINST=$PKGINST" >> pkginfo
  1981. echo "PKGSAV=`pwd`/save" >> pkginfo
  1982. echo "CLIENT_BASEDIR=$TD" >> pkginfo
  1983. echo "INSTDATE=$DATE" >> pkginfo
  1984. echo "UPDATE=yes" >> pkginfo
  1985. echo "NONABI_SCRIPTS=TRUE" >> pkginfo
  1986.  
  1987. cd install
  1988. cp $TD/$RLS ./preremove
  1989.  
  1990. installf $PKGINST $TD
  1991. find $TD -type d -exec installf $PKGINST {} d 755 bin bin \;
  1992. find $TD -type f -exec installf $PKGINST {} f 644 bin bin \;
  1993. find $TD -name \*links -exec installf $PKGINST {} f 755 bin bin \;
  1994. installf -f $PKGINST
  1995.  
  1996. Echo "The maintenance of package $PKGINST on `hostname` has been completed."
  1997. AwaitEnter
  1998. }
  1999.  
  2000. CreateExecutionScripts()
  2001. {
  2002. case $AN in
  2003. "BX" ) HOST=`hostname`
  2004.     SCRPTNAME="BX"
  2005.     if [ -f $TD'/bin/bx'$AREV ]
  2006.     then
  2007.         rm $TD'/bin/bx'$AREV
  2008.     fi
  2009.     ScriptEcho "#!/bin/sh"
  2010.     ScriptEcho ""
  2011.     ScriptEcho "# This is a script to run the $DIST."
  2012.     ScriptEcho "# If you have any comments about this script"
  2013.     ScriptEcho "# please send email to bx-bugs@ics.com. Thank You."
  2014.     ScriptEcho ""
  2015.     ScriptEcho "# This sets your XFILESEARCHPATH to pick up the file BuilderXcessory"
  2016.     ScriptEcho "# in $TD which is the resource file for the $DIST."
  2017.     ScriptEcho "XFILESEARCHPATH=\"$TD/%N.$HOST:\$XFILESEARCHPATH\""
  2018.     ScriptEcho "XUSERFILESEARCHPATH=\"\""
  2019.     ScriptEcho "export XUSERFILESEARCHPATH"
  2020.     ScriptEcho "export XFILESEARCHPATH"
  2021.     ScriptEcho ""
  2022.     ScriptEcho "# This sets your XNLSPATH. Set this if you are having problems"
  2023.     ScriptEcho "# with the X language locale support"
  2024.     ScriptEcho "# XNLSPATH='$TD/lib/nls'"
  2025.     ScriptEcho "# export XNLSPATH"
  2026.     ScriptEcho ""
  2027.     ScriptEcho "# This sets your LM_LICENSE_FILE variable."
  2028.     ScriptEcho "# For those who place their license file in a non-standard location"
  2029.     ScriptEcho "# you can set this variable then uncomment this line"
  2030.     ScriptEcho "#LM_LICENSE_FILE='/usr/local/flexlm/licenses/license.dat'"
  2031.     ScriptEcho "#export LM_LICENSE_FILE"
  2032.     ScriptEcho ""
  2033.     ScriptEcho "# This variables set up the hyperhelp help system that"
  2034.     ScriptEcho "# the $DIST uses."
  2035.     ScriptEcho "HHPATH='$TD/bin':\$HHPATH"
  2036.     ScriptEcho "export HHPATH"
  2037.     ScriptEcho "XPPATH='$TD/help/Xp':\$XPPATH"
  2038.     ScriptEcho "export XPPATH"
  2039.     ScriptEcho ""
  2040.     ScriptEcho "# Your path is readjusted to various executables that"
  2041.     ScriptEcho "# the $DIST needs in order to provide optimal functionality."
  2042.     ScriptEcho "PATH='$TD/bin:'\$PATH"
  2043.     ScriptEcho ""
  2044.     ScriptEcho "# This command runs the $DIST in $TD"
  2045.     ScriptEcho "$TD/bin/bx -system_directory $TD \$*"
  2046.  
  2047.     chmod 777 $RUNSCRIPT ;;
  2048. "DXORA" | "DXSYB" ) SCRPTNAME=$AN
  2049.     if [ -f $TD'/bin/dx' ]
  2050.     then
  2051.         rm $TD'/bin/dx'
  2052.     fi
  2053.     ScriptEcho "#!/bin/sh"
  2054.     ScriptEcho ""
  2055.     ScriptEcho "# This is a script to run DX (any version)."
  2056.     ScriptEcho ""
  2057.     ScriptEcho "# This script currently takes these arguments :" 
  2058.     ScriptEcho "# the version of DX you wish to run which is -ora or -syb"
  2059.     ScriptEcho "# example : dx -syb"
  2060.     ScriptEcho ""
  2061.     ScriptEcho "# If you have any comments about this script"
  2062.     ScriptEcho "# please send email to dx-bugs@ics.com. Thank You."
  2063.     ScriptEcho ""
  2064.     ScriptEcho "#if [ \"\$1\" != \"-syb\" ] && [ \"\$1\" != \"-ora\" ]"
  2065.     ScriptEcho "#then"
  2066.     ScriptEcho "#echo 'dx [-syb,-ora]'"
  2067.     ScriptEcho "#exit 1"
  2068.     ScriptEcho "#fi"
  2069.     ScriptEcho ""
  2070.     ScriptEcho "# This sets your DXLOGIN variable for the schema browser"
  2071.     ScriptEcho "#if [ \$DXLOGIN ]"
  2072.     ScriptEcho "#then"
  2073.     ScriptEcho "#DXLOGIN='hostname:user:password'"
  2074.     ScriptEcho "#export DXLOGIN"  
  2075.     ScriptEcho "#fi"
  2076.     ScriptEcho ""
  2077.     ScriptEcho "# This sets your SYBASE variable for the schema browser"
  2078.     ScriptEcho "# SYBASE is your sybase home directory"
  2079.     ScriptEcho "#if [ \"\$1\" = \"-syb\" ]"
  2080.     ScriptEcho "#then"
  2081.     ScriptEcho "#SYBASE='/SYBASE/Directory'"
  2082.     ScriptEcho "#export SYBASE" 
  2083.     ScriptEcho "if [ \$SYBASE ]"
  2084.     ScriptEcho "then"
  2085.     ScriptEcho "echo \"\""
  2086.     ScriptEcho "else"
  2087.     ScriptEcho "echo \"The SYBASE environment variable is not set. DX cannot continue.\""
  2088.     ScriptEcho "echo \"Please see your system administrator for the correct value for this\""
  2089.     ScriptEcho "echo \"environment variable.\""
  2090.     ScriptEcho "exit 1"
  2091.     ScriptEcho "fi"
  2092.     ScriptEcho "#fi"
  2093.     ScriptEcho ""
  2094.     ScriptEcho "# This sets your ORACLE variables for the schema browser"
  2095.     ScriptEcho "# ORACLE_HOME is your oracle home directory"
  2096.     ScriptEcho "# ORACLE_SID is your oracle server id"
  2097.     ScriptEcho "#if [ \"\$1\" = \"-ora\" ]"
  2098.     ScriptEcho "#then"
  2099.     ScriptEcho "#ORACLE_HOME='/Oracle/home/Directory'"
  2100.     ScriptEcho "#export ORACLE_HOME"
  2101.     ScriptEcho "#ORACLE_SID='OracleServerId'"
  2102.     ScriptEcho "#export ORACLE_SID"
  2103.     ScriptEcho "#fi"
  2104.     ScriptEcho "" 
  2105.     ScriptEcho "# This sets your XFILESEARCHPATH to pick up the file BuilderXcessory"
  2106.     ScriptEcho "# in $TD which is the resource file for the $DIST."
  2107.     ScriptEcho "XFILESEARCHPATH='$TD/%N.$HOST:'\$XFILESEARCHPATH"
  2108.     ScriptEcho "XUSERFILESEARCHPATH=''"
  2109.     ScriptEcho "export XUSERFILESEARCHPATH"
  2110.     ScriptEcho "export XFILESEARCHPATH"
  2111.     ScriptEcho ""
  2112.     ScriptEcho "# This sets your XNLSPATH. Set this if you are having problems"
  2113.     ScriptEcho "# with the X language locale support"
  2114.     ScriptEcho "XNLSPATH='$TD/lib/nls'"
  2115.     ScriptEcho "export XNLSPATH"
  2116.     ScriptEcho ""
  2117.     ScriptEcho "# This sets your LM_LICENSE_FILE variable."
  2118.     ScriptEcho "# For those who place thier license file in a non-standard location"
  2119.     ScriptEcho "# you can set this variable then uncomment this line"
  2120.     ScriptEcho "#LM_LICENSE_FILE='/usr/local/flexlm/licenses/license.dat'"
  2121.     ScriptEcho "#export LM_LICENSE_FILE"
  2122.     ScriptEcho ""
  2123.     ScriptEcho "# This variables set up the hyperhelp help system that"
  2124.     ScriptEcho "# the $DIST uses."
  2125.     ScriptEcho "HHPATH='$TD/bin':\$HHPATH"
  2126.     ScriptEcho "export HHPATH"
  2127.     ScriptEcho "XPPATH='$TD/help/Xp':\$XPPATH"
  2128.     ScriptEcho "export XPPATH"
  2129.     ScriptEcho ""
  2130.     ScriptEcho "PATH='$TD/bin:'\$PATH"
  2131.     ScriptEcho ""
  2132.     ScriptEcho "CMDARGS=''"
  2133.     ScriptEcho "for f in \$*"
  2134.     ScriptEcho "do"
  2135.     ScriptEcho "if [ \"\$f\" != \"-ora\" ] && [ \"\$f\" != \"-syb\" ]"
  2136.     ScriptEcho "then"
  2137.     ScriptEcho "CMDARGS=\$CMDARGS' '\$f"
  2138.     ScriptEcho "fi"
  2139.     ScriptEcho "done"
  2140.     ScriptEcho ""
  2141.     ScriptEcho "# This command runs the $DIST in $TD"
  2142.     ScriptEcho "$TD/bin/dx-syb -db \$CMDARGS -system_directory $TD -dbrowser $TD/bin/dbrowser-syb -dbrowser_arg $TD"
  2143.  
  2144.     chmod 777 $RUNSCRIPT ;;
  2145. esac
  2146.  
  2147. SCRPTNAME="CGX"
  2148. if [ -f $TD'/bin/cgx'$CGXREV ]
  2149. then
  2150.     rm $TD'/bin/cgx'$CGXREV
  2151. fi
  2152. ScriptEcho "#!/bin/sh"
  2153. ScriptEcho ""
  2154. ScriptEcho "# This is a script to run the code generator that comes"
  2155. ScriptEcho "# with the $DIST."
  2156. ScriptEcho "# If you have any comments about this script"
  2157. ScriptEcho "# please send email to bx-bugs@ics.com. Thank You."
  2158. ScriptEcho ""
  2159. ScriptEcho "# This sets your LM_LICENSE_FILE variable."
  2160. ScriptEcho "# For those who place their license file in a non-standard location"
  2161. ScriptEcho "# you can set this variable then uncomment this line"
  2162. ScriptEcho "#LM_LICENSE_FILE='/usr/local/flexlm/licenses/license.dat'"
  2163. ScriptEcho "#export LM_LICENSE_FILE"
  2164. ScriptEcho ""
  2165. ScriptEcho "# This command runs the $DIST in $TD"
  2166. ScriptEcho "$TD/bin/cgx -path $TD \$*"
  2167.  
  2168. chmod 777 $RUNSCRIPT
  2169. }
  2170.  
  2171. ScriptEcho()
  2172. {
  2173. case $SCRPTNAME in
  2174. "BX" ) RUNSCRIPT=$TD'/bin/bx'$AREV ;;
  2175. "CGX" ) RUNSCRIPT=$TD'/bin/cgx'$CGXREV ;;
  2176. "DXORA" | "DXSYB" ) RUNSCRIPT=$TD'/bin/dx' ;;
  2177. esac
  2178.  
  2179. echo $1 >> $RUNSCRIPT
  2180. }
  2181.  
  2182. ProcessAppDefaultsFile()
  2183. {
  2184. case $AN in
  2185. "BX" ) STANDARD_LIB_DEST=/usr/lib/X11/builderXcessory
  2186.     APP_SRC=BuilderXcessory ;;
  2187. "DXORA" | "DXSYB" ) STANDARD_LIB_DEST=/usr/lib/X11/databaseXcessory
  2188.     APP_SRC=DatabaseXcessory ;;
  2189. esac
  2190.  
  2191. sed -e "s?${STANDARD_LIB_DEST}?${TD}?g" \
  2192.    ${APP_SRC}.ad > ${APP_SRC}.tmp
  2193. if [ -d ${TMP_DEST}/locale ]
  2194. then
  2195.     for f in ./locale/*
  2196.     do
  2197.         LOCALE=`basename $f`
  2198.         sed -e "s?${STANDARD_LIB_DEST}?${TD}?g" \
  2199.         ./locale/${LOCALE}/app-defaults/${APP_SRC}.ad > \
  2200.         ./locale/${LOCALE}/app-defaults/${APP_SRC}.tmp
  2201.             mv ./locale/${LOCALE}/app-defaults/${APP_SRC}.tmp \
  2202.         ./locale/${LOCALE}/app-defaults/${APP_SRC}.`hostname`
  2203.     done
  2204. fi
  2205. mv ./${APP_SRC}.tmp ./${APP_SRC}.`hostname`
  2206. cp ./${APP_SRC}.`hostname` ./${APP_SRC}
  2207. }
  2208.  
  2209. ModifyImakeConfigFiles()
  2210. {
  2211. TTALK='NO'
  2212. HHELP='NO'
  2213.  
  2214. case $OSNAME in
  2215. "SOL1" | "SOL2" ) TTALK='YES' ;;
  2216. esac
  2217.  
  2218. case $TTALK in
  2219. "YES" ) TTALK="#define HasToolTalk    YES" ;;
  2220. "NO" )  TTALK="#define HasToolTalk    NO" ;;
  2221. esac
  2222.  
  2223. case $HHELP in
  2224. "YES" ) HHELP="#define HasVKHyperHelp    YES" ;;
  2225. "NO" )  HHELP="#define HasVKHyperHelp    NO" ;;
  2226. esac
  2227.  
  2228. ENDIF="#endif /\* AfterVendorCF \*"
  2229.  
  2230. #X11SD='./site.def'
  2231. #XNEWSSD='./site.def'
  2232.  
  2233. X11SD='/usr/lib/X11/config/site.def'
  2234. XNEWSSD='/usr/openwin/lib/config/site.def'
  2235.  
  2236. if [ -f $X11SD ]
  2237. then
  2238.     eval 'chmod 666 $X11SD'
  2239. sed -e "\\@$ENDIF@i\\
  2240. $TTALK\\
  2241. $HHELP"  ${X11SD} > ${X11SD}.tmp
  2242.     eval '$MV $X11SD $X11SD.orig'
  2243.     eval '$MV $X11SD.tmp $X11SD'
  2244. fi
  2245.  
  2246. if [ -f $XNEWSSD ]
  2247. then
  2248.     eval 'chmod 666 $XNEWSSD'
  2249. sed -e "\\@$ENDIF@i\\
  2250. $TTALK\\
  2251. $HHELP"  ${XNEWSSD} > ${XNEWSSD}.tmp
  2252.     eval '$MV $XNEWSSD $XNEWSSD.orig'
  2253.     eval '$MV $XNEWSSD.tmp $XNEWSSD'
  2254. fi
  2255. }
  2256.  
  2257. Main()
  2258. {
  2259. if [ $ED = "\NULL" ]
  2260. then
  2261.  
  2262. LoadDirectoryPreamble
  2263. Directory
  2264. DirectoryConfirmation
  2265.  
  2266. if [ $MULTIPLESETS = "1" ]
  2267. then
  2268.     ChooseSetsPreamble
  2269.     ChooseSets
  2270. fi
  2271.  
  2272. if [ $REQDECRYPTIONKEY = "1" ] && [ $LOADLIB = "1" ] && [ $MT = 'cd' ]
  2273. then
  2274.     DecryptionKeyPreamble
  2275.     DecryptionKey
  2276. fi
  2277.  
  2278. if [ $MAKELINKS = "1" ]
  2279. then
  2280.     if [ $LOADLIB = "1" ] || [ $LOADDOC = "1" ]
  2281.     then
  2282.         MakeLinksPreamble
  2283.         MakeLinks
  2284.     else
  2285.         MAKELINKS='0'
  2286.     fi
  2287. fi
  2288.  
  2289. if [ $REQLMINSTALLATION = "1" ] && [ $LOADLIB = "1" ]
  2290. then
  2291.     FlexLMPreamble
  2292.     FlexLM
  2293. fi
  2294.  
  2295. if [ $REQLMKEY = "1" ] && [ $LOADLIB = "1" ]
  2296. then
  2297.     LMKeyPreamble
  2298.     LMKey
  2299. fi
  2300.  
  2301. if [ $MODIFYIMAKE = "1" ] && [ $LOADLIB = "1" ]
  2302. then
  2303.     if [ -f /usr/openwin/lib/config/site.def ] || [ -f /usr/lib/X11/config/site.def ]
  2304.     then
  2305.         ModifyImakePreamble
  2306.         ModifyImake
  2307.     fi
  2308. fi
  2309.  
  2310. fi
  2311.  
  2312. DoubleCheck
  2313. }
  2314.  
  2315. DetectArch
  2316. LocateMedia
  2317.  
  2318. if [ $ED = "\NULL" ]
  2319. then
  2320.     FindMediaPreamble
  2321.     FindMedia
  2322. fi
  2323.  
  2324. Main
  2325.