home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 March B / SCO_CASTOR4RRT.iso / uccs / install / postinstall < prev    next >
Text File  |  1998-08-19  |  4KB  |  165 lines

  1. #ident    "@(#)pkg4.i386:i386/pkg/uccs/postinstall    1.16"
  2. #-------
  3. # This edits /etc/profile.
  4. #
  5. # During installation, it appends a line which will make
  6. # the new compilation system the default.
  7. #
  8. # PKGINST should be provided by the installation service.
  9. #-------
  10. #Set up localized messaging
  11. PKMSG=${PKGINST}.pkg
  12. LOCALE=${LC_ALL:-${LC_MESSAGES:-${LANG:-"C"}}}
  13. MENU_OUT=/tmp/out$$
  14.  
  15. trap "rm -f /tmp/*$$ 2>/dev/null; exit" 0 2
  16. #-------
  17.  
  18. urel=`uname -r`
  19. #-------
  20. # Take care of libcrypt.a; also on uw2 get right version of ld
  21. #-------
  22. if [ $urel = "5" ]
  23. then
  24.     if    [ ! -f /usr/lib/libcrypt_d.a ]
  25.     then
  26.         rm -f /usr/lib/libcrypt.a
  27.         ln /usr/lib/libcrypt_i.a /usr/lib/libcrypt.a
  28.     fi
  29. else
  30.     # add on
  31.     if    [ ! -f /udk/usr/lib/libcrypt_d.a ]
  32.     then
  33.         rm -f /udk/usr/lib/libcrypt.a
  34.         ln /udk/usr/lib/libcrypt_i.a /udk/usr/lib/libcrypt.a
  35.     fi
  36.     if [ $urel = "4.2MP" ]
  37.     then
  38.         if [ -f /udk/usr/ccs/lib/libp/libc.so.1.uw2 ]
  39.         then
  40.             /usr/bin/mv /udk/usr/ccs/lib/libp/libc.so.1.uw2 /udk/usr/ccs/lib/libp/libc.so.1
  41.             removef ${PKGINST} /udk/usr/ccs/lib/libp/libc.so.1.uw2 > /dev/null 2>&1
  42.             installf ${PKGINST} /udk/usr/ccs/lib/libp/libc.so.1 f 0755 bin bin > /dev/null 2>&1
  43.         fi
  44.         if [ -f /udk/usr/ccs/bin/ld.uw2 ]
  45.         then
  46.             /usr/bin/mv /udk/usr/ccs/bin/ld.uw2 /udk/usr/ccs/bin/ld
  47.             removef ${PKGINST} /udk/usr/ccs/bin/ld.uw2 > /dev/null 2>&1
  48.             installf ${PKGINST} /udk/usr/ccs/bin/ld f 0755 bin bin > /dev/null 2>&1
  49.         fi
  50.         installf -f $PKGINST
  51.     fi
  52.     if [ -f /udk/usr/ccs/lib/libp/libc.so.1 ]
  53.     then
  54.         if [ ! -d /usr/ccs/lib/libp ]
  55.         then
  56.             mkdir -p /usr/ccs/lib/libp
  57.         fi
  58.         ln -s /udk/usr/ccs/lib/libp/libc.so.1 /usr/ccs/lib/libp/libc.so.1
  59.     fi
  60. fi
  61.  
  62. if [ $urel = "4.2MP" ]
  63. then
  64.     exit 0
  65. fi
  66.  
  67. if [ $urel = "3.2" ]
  68. then
  69.     MENU_DIR=/usr/adm/pkg/uccs/install
  70. fi
  71.  
  72. no_license() {
  73.     #  Set up to use menu_colors; default to C-locale
  74.     # if ${LOCALE}'s dir has no menu_colors.sh
  75.     #
  76.     menu_colors warn
  77.     /udk/bin/menu -f ${MENU_DIR}/set.12 -o ${MENU_OUT} < /dev/tty > /dev/tty 2>/dev/null
  78.     menu_colors regular
  79. }
  80.  
  81.  
  82. # On OpensServer, prompt for licensing information
  83. if [ $urel = "3.2" ]
  84. then
  85.     TERM=${TERM:-minansiterm} 
  86.     LINES=${LINES:-24} 
  87.     COLUMNS=${COLUMNS:-80} 
  88.     export TERM LINES COLUMNS
  89.     if [ -f /etc/inst/locale/${LOCALE}/menus/menu_colors.sh ]
  90.     then
  91.         . /etc/inst/locale/${LOCALE}/menus/menu_colors.sh
  92.     else
  93.         . /etc/inst/locale/C/menus/menu_colors.sh
  94.     fi
  95.     alldone=0
  96.     while [ $alldone = "0" ]
  97.     do
  98.         /udk/bin/menu -f ${MENU_DIR}/set.11 -o ${MENU_OUT} < /dev/tty > /dev/tty 2>/dev/null
  99.         . ${MENU_OUT}
  100.         if [ "${LICNUMBER}" -a "${LICCODE}" ]
  101.         then
  102.             if [ "${LICDATA}" ]
  103.             then
  104.                 /etc/brand -g -q  -a "${LICDATA}" "${LICNUMBER}" "${LICCODE}" >/dev/null 2>&1
  105.             else
  106.                 /etc/brand -g -q "${LICNUMBER}" "${LICCODE}" >/dev/null 2>&1
  107.             fi
  108.             if [ $? -ne 0 ]
  109.             then
  110.                 no_license
  111.             else
  112.                 alldone=1
  113.             fi
  114.         else
  115.             no_license
  116.             alldone=1
  117.         fi
  118.     done
  119.     exit 0
  120. fi
  121.  
  122. # after this, Gemini only
  123. PROFILE=/etc/profile
  124.  
  125. #-------
  126. # Add /usr/ccs/bin to path in /etc/profile
  127. #-------
  128. echo 'PATH=$PATH:/usr/ccs/bin  #**UNIXWARE CCS** Installed by pkginst' $PKGINST>>/etc/profile
  129. #-------
  130.  
  131. #-------
  132. # Take care of /usr/lib/cpp.
  133. #-------
  134.  
  135. if    [ ! -f /usr/lib/cpp -a ! -h /usr/lib/cpp -a -f /usr/ccs/lib/cpp ]
  136. then    ln -s /usr/ccs/lib/cpp /usr/lib/cpp
  137. fi
  138.  
  139. #-------
  140. # Take care of symbolic links for files in /usr/ccs/bin
  141. #-------
  142. if [ ! -f /bin/cc ]
  143. then
  144. a=`pwd`
  145. cd /usr/ccs/bin
  146. for i in *
  147. do
  148. if [ ! -f /usr/bin/$i -a ! -h /usr/bin/$i ]
  149. then    ln -s /usr/ccs/bin/$i /usr/bin/$i
  150. fi
  151. done
  152. cd $a
  153. fi
  154.  
  155. ## link /usr/ccs/bin/ld and /usr/bin/idld if the system is Destiny
  156. ## (pkg=base; version=1 or higher)
  157.  
  158. version=`pkgparam base VERSION 2>/dev/null`
  159. [ "$version" -ge 1 ] && [ -x /usr/bin/idld ] && {
  160.     rm -f /usr/bin/idld
  161.     ln /usr/ccs/bin/ld /usr/bin/idld
  162. }
  163.  
  164. exit 0
  165.