home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 August - Disc 2 / chip_20018102_hu.iso / linux / X-4.1.0 / glibc21 / xinstall.bin < prev    next >
Text File  |  2001-06-27  |  33KB  |  1,514 lines

  1. #!/bin/sh
  2.  
  3. #
  4. # $XFree86: xc/programs/Xserver/hw/xfree86/etc/Xinstall.sh,v 1.20.2.7 2001/06/06 18:46:19 dawes Exp $
  5. #
  6. # Copyright ⌐ 2000 by Precision Insight, Inc.
  7. # Copyright ⌐ 2000, 2001 by VA Linux Systems, Inc.
  8. # Portions Copyright ⌐ 1996-2000 by The XFree86 Project, Inc.
  9. #
  10. # This script should be used to install XFree86 4.1.0.
  11. #
  12. # Parts of this script are based on the old preinst.sh and postinst.sh
  13. # scripts.
  14. #
  15. # Set tabs to 4 spaces to view/edit this file.
  16. #
  17. # Authors:    David Dawes <dawes@xfree86.org>
  18. #
  19.  
  20. # Fallbacks for when the bindist version can't be auto-detected.
  21. # These should be updated for each release.
  22.  
  23. FULLPREFIX=4.1
  24. PATCHLEVEL=0
  25. VERSION=$FULLPREFIX.$PATCHLEVEL
  26. FULLVERSION=$FULLPREFIX.0
  27. SCRIPTVERSION=$VERSION
  28.  
  29. BINDISTFULLPREFIX=
  30. BINDISTPATCHLEVEL=
  31. BINDISTVERSION=
  32. BINDISTFULLVERSION=
  33.  
  34. ROOTDIR=
  35.  
  36. TESTROOT=/home1/test
  37.  
  38. if [ X"$1" = "X-test" -o X"$XINST_TEST" != X ]; then
  39.     ROOTDIR=$TESTROOT
  40.     if [ X"$1" = "X-test" ]; then
  41.         shift
  42.     fi
  43.     if [ ! -d $TESTROOT ]; then
  44.         echo "$TESTROOT doesn't exist (for test mode)"
  45.         exit 1
  46.     fi
  47.     for i in usr etc var; do
  48.         if [ ! -d $TESTROOT/$i ]; then
  49.             echo "$TESTROOT/$i doesn't exist, creating it"
  50.             mkdir $TESTROOT/$i
  51.         fi
  52.     done
  53.     echo ""
  54.     echo "Running in test mode"
  55. fi
  56.  
  57. RUNDIR=$ROOTDIR/usr/X11R6
  58. ETCDIR=$ROOTDIR/etc/X11
  59. VARDIR=$ROOTDIR/var
  60.  
  61. OLDFILES=""
  62.  
  63. OLDDIRS=" \
  64.     $RUNDIR/lib/X11/xkb/compiled \
  65.     "
  66.  
  67. OLDMODULES=" \
  68.     xie.so \
  69.     pex5.so \
  70.     glx.so \
  71.     "
  72.  
  73. BASEDIST=" \
  74.     Xbin.tgz \
  75.     Xlib.tgz \
  76.     Xman.tgz \
  77.     Xdoc.tgz \
  78.     Xfnts.tgz \
  79.     Xfenc.tgz \
  80.     "
  81.  
  82. UPDATEDIST=" \
  83.     Xupdate.tgz \
  84.     Xdrivers.tgz \
  85.     Xdocupd.tgz \
  86.     "
  87.  
  88. ETCDIST="Xetc.tgz"
  89.  
  90. VARDIST=""
  91.  
  92. SERVDIST=" \
  93.     Xxserv.tgz \
  94.     Xmod.tgz \
  95.     "
  96. OPTDIST=" \
  97.     Xfsrv.tgz \
  98.     Xnest.tgz \
  99.     Xprog.tgz \
  100.     Xprt.tgz \
  101.     Xvfb.tgz \
  102.     Xf100.tgz \
  103.     Xfcyr.tgz \
  104.     Xflat2.tgz \
  105.     Xfnon.tgz \
  106.     Xfscl.tgz \
  107.     Xhtml.tgz \
  108.     Xjdoc.tgz \
  109.     Xps.tgz \
  110.     "
  111.  
  112. ETCDLINKS=" \
  113.     app-defaults \
  114.     fs \
  115.     lbxproxy \
  116.     proxymngr \
  117.     rstart \
  118.     twm \
  119.     xdm \
  120.     xinit \
  121.     xsm \
  122.     xserver \
  123.     "
  124.  
  125. ETCFLINKS=" \
  126.     XftConfig \
  127.     "
  128.  
  129.  
  130. XKBDIR="$ETCDIR/xkb"
  131. XKBDBDIR=
  132.  
  133. FONTDIRS=" \
  134.     local \
  135.     misc
  136.     "
  137.  
  138. XSERVERCMD="$RUNDIR/bin/XFree86"
  139.  
  140. VERSIONFILE=".XFree86_Version"
  141.  
  142. WDIR=`pwd`
  143.  
  144. DOUPDATE=
  145. DOBASE=
  146.  
  147. OPTS=""
  148.  
  149. # Check how to suppress newlines with echo (from perl's Configure)
  150. ((echo "xxx\c"; echo " ") > .echotmp) 2> /dev/null
  151. if [ ! -f .echotmp ]; then
  152.     echo "Can't write to the current directory.  Aborting";
  153.     exit 1
  154. fi
  155. if grep c .echotmp >/dev/null 2>&1; then
  156.     n='-n'
  157.     c=''
  158. else
  159.     n=''
  160.     c='\c'
  161. fi
  162. rm -f .echotmp
  163.  
  164. Echo()
  165. {
  166.     echo $n "$@""$c"
  167. }
  168.  
  169. ContinueNo()
  170. {
  171.     Echo "Do you wish to continue? (y/n) [n] "
  172.     read response
  173.     case "$response" in
  174.     [yY]*)
  175.         echo ""
  176.         ;;
  177.     *)
  178.         echo "Aborting the installation."
  179.         exit 2
  180.         ;;
  181.     esac
  182. }
  183.  
  184. ContinueYes()
  185. {
  186.     Echo "Do you wish to continue? (y/n) [y] "
  187.     read response
  188.     case "$response" in
  189.     [nN]*)
  190.         echo "Aborting the installation."
  191.         exit 2
  192.         ;;
  193.     *)
  194.         echo ""
  195.         ;;
  196.     esac
  197. }
  198.  
  199. Description()
  200. {
  201.     case $1 in
  202.     Xfsrv*)
  203.         echo "font server";;
  204.     Xnest*)
  205.         echo "Nested X server";;
  206.     Xprog*)
  207.         echo "programmer support";;
  208.     Xprt*)
  209.         echo "X print server";;
  210.     Xvfb*)
  211.         echo "Virtual framebuffer X server";;
  212.     Xf100*)
  213.         echo "100dpi fonts";;
  214.     Xfcyr*)
  215.         echo "Cyrillic fonts";;
  216.     Xflat2*)
  217.         echo "Latin-2 fonts";;
  218.     Xfnon*)
  219.         echo "Some large fonts";;
  220.     Xfscl*)
  221.         echo "Scaled fonts (Speedo and Type1)";;
  222.     Xhtml*)
  223.         echo "Docs in HTML";;
  224.     Xjdoc*)
  225.         echo "Docs in Japanese";;
  226.     Xps*)
  227.         echo "Docs in PostScript";;
  228.     Xaout*)
  229.         echo "a.out compatibility libraries";;
  230.     Xquartz*)
  231.         echo "Mac OS X Quartz compatible X server";;
  232.     *)
  233.         echo "unknown";;
  234.     esac
  235. }
  236.  
  237. ReadLink()
  238. {
  239.     rltmp="`ls -l $1`"
  240.     rl=`expr "$rltmp" : '.*-> \([^     ]*\)'`
  241.     echo $rl
  242. }
  243.  
  244. GetOsInfo()
  245. {
  246.     echo "Checking which OS you're running..."
  247.  
  248.     OsName="`uname`"
  249.     OsVersion="`uname -r`"
  250.     case "$OsName" in
  251.     SunOS) # Assumes SunOS 5.x
  252.         OsArch="`uname -p`"
  253.         ;;
  254.     *)
  255.         OsArch="`uname -m`"
  256.         ;;
  257.     esac
  258.     # Some SVR4.0 versions have a buggy uname that reports the node name
  259.     # for the OS name.  Try to catch that here.  Need to check what is
  260.     # reported for non-buggy versions.
  261.     if [ "$OsName" = "`uname -n`" -a -f /stand/unix ]; then
  262.         OsName=UNIX_SV
  263.     fi
  264.     echo "uname reports '$OsName' version '$OsVersion', architecture '$OsArch'."
  265.  
  266.     # Find the object type, where needed
  267.  
  268.     case "$OsName" in
  269.     Linux|FreeBSD|NetBSD)
  270.         if file -L /bin/sh | grep ELF > /dev/null 2>&1; then
  271.             OsObjFormat=ELF
  272.         else
  273.             OsObjFormat=a.out
  274.         fi
  275.         ;;
  276.     esac
  277.  
  278.     if [ X"$OsObjFormat" != X ]; then
  279.         Echo "Object format is '$OsObjFormat'.  "
  280.         needNL=YES
  281.     fi
  282.  
  283.     # test's flag for symlinks
  284.     #
  285.     # For OSs that don't support symlinks, choose a type that is guaranteed to
  286.     # return false for regular files and directories.
  287.  
  288.     case "$OsName" in
  289.     FreeBSD)
  290.         case "$OsVersion" in
  291.         2.*)
  292.             L="-h"
  293.             ;;
  294.         *)
  295.             L="-L"
  296.             ;;
  297.         esac
  298.         ;;
  299.     SunOS)
  300.         L="-h"                # /bin/sh built-in doesn't do -L
  301.         ;;
  302.     OS-with-no-symlinks)    # Need to set this correctly
  303.         L="-b"
  304.         NoSymlinks=YES
  305.         ;;
  306.     *)
  307.         L="-L"
  308.         ;;
  309.     esac
  310.  
  311.     # Find the libc version, where needed
  312.     case "$OsName" in
  313.     Linux)
  314.         tmp="`ldd /bin/sh | grep libc.so 2> /dev/null`"
  315.         LibcPath=`expr "$tmp" : '[^/]*\(/[^ ]*\)'`
  316.         tmp="`strings $LibcPath | grep -i 'c library'`"
  317.         OsLibcMajor=`expr "$tmp" : '.* \([0-9][0-9]*\)'`
  318.         OsLibcMinor=`expr "$tmp" : '.* [0-9][0-9]*\.\([0-9][0-9]*\)'`
  319.         OsLibcTeeny=`expr "$tmp" : '.* [0-9][0-9]*\.[0-9][0-9]*\.\([0-9][0-9]*\)'`
  320.         case "$OsLibcMajor" in
  321.         2)
  322.             # 2 is the glibc version
  323.             OsLibcMajor=6
  324.             ;;
  325.         esac
  326.         ;;
  327.     esac
  328.  
  329.     if [ X"$OsLibcMajor" != X ]; then
  330.         Echo "libc version is '$OsLibcMajor"
  331.         if [ X"$OsLibcMinor" != X ]; then
  332.             Echo ".$OsLibcMinor"
  333.             if [ X"$OsLibcTeeny" != X ]; then
  334.                 Echo ".$OsLibcTeeny"
  335.                 if [ $OsLibcTeeny -gt 80 ]; then
  336.                     OsLibcMinor=`expr $OsLibcMinor + 1`
  337.                 fi
  338.             fi
  339.             Echo "'"
  340.             Echo " ($OsLibcMajor.$OsLibcMinor)"
  341.         else
  342.             Echo "'"
  343.         fi
  344.         echo "."
  345.     fi
  346. #    if [ X"$needNL" = XYES ]; then
  347. #        echo ""
  348. #    fi
  349.     echo ""
  350. }
  351.  
  352. DoOsChecks()
  353. {
  354.     # Do some OS-specific checks
  355.  
  356.     case "$OsName" in
  357.     Linux)
  358.         case "$OsObjFormat" in
  359.         ELF)
  360.             # Check ldconfig
  361.             LDSO=`/sbin/ldconfig -v -n | awk '{ print $3 }'`
  362.             # if LDSO is empty ldconfig may be Version 2
  363.             if [ X"$LDSO" = X ]; then
  364.                 LDSO=`/sbin/ldconfig -V | awk 'NR == 1 { print $4 }'`
  365.             fi
  366.             LDSOMIN=`echo $LDSO | awk -F[.-] '{ print $3 }'`
  367.             LDSOMID=`echo $LDSO | awk -F[.-] '{ print $2 }'`
  368.             LDSOMAJ=`echo $LDSO | awk -F[.-] '{ print $1 }'`
  369.             if [ "$LDSOMAJ" -gt 1 ]; then
  370.                 : OK
  371.             else
  372.                 if [ "$LDSOMID" -gt 7 ]; then
  373.                     : OK
  374.                 else
  375.                     if [ "$LDSOMIN" -ge 14 ]; then
  376.                         : OK
  377.                     else
  378.                         echo ""
  379.                         echo "Before continuing, you will need to get a"
  380.                         echo "current version of ld.so.  Version 1.7.14 or"
  381.                         echo "newer will do."
  382.                         NEEDSOMETHING=YES
  383.                     fi
  384.                 fi
  385.             fi
  386.             ;;
  387.         esac
  388.         # The /dev/tty0 check is left out.  Presumably nobody has a system where
  389.         # this is missing any more.
  390.         ;;
  391.     esac
  392. }
  393.  
  394. FindDistName()
  395. {
  396.     case "$OsName" in
  397.     Darwin)
  398.         case "$OsArch" in
  399.         Power*)
  400.             case "$OsVersion" in
  401.             1.[2-9]*)
  402.                 DistName="Darwin-ppc"
  403.                 ;;
  404.             *)
  405.                 Message="No Darwin/ppc binaries available for this OS version"
  406.                 ;;
  407.             esac
  408.             ;;
  409.         x86*)
  410.             case "$OsVersion" in
  411.             1.[3-9]*)
  412.                 DistName="Darwin-ix86"
  413.                 ;;
  414.             *)
  415.                 Message="No Darwin/ix86 binaries available for this OS version"
  416.                 ;;
  417.             esac
  418.             ;;
  419.         *)
  420.             Message="Darwin binaries are not available for this architecture"
  421.             ;;
  422.         esac
  423.         ;;
  424.     DGUX)    # Check this string
  425.         case "$OsArch" in
  426.         i*86)
  427.             DistName="DGUX-ix86"
  428.             ;;
  429.         *)
  430.             Message="DGUX binaries are only available for ix86 platforms"
  431.             ;;
  432.         esac
  433.         ;;
  434.     FreeBSD)
  435.         case "$OsArch" in
  436.         i386)
  437.             case "$OsVersion" in
  438.             2.2*)
  439.                 DistName="FreeBSD-2.2.x"
  440.                 ;;
  441.             3.*)
  442.                 case "$OsObjFormat" in
  443.                 ELF)
  444.                     DistName="FreeBSD-3.x"
  445.                     ;;
  446.                 *)
  447.                     Message="FreeBSD 3.x binaries are only available in ELF format"
  448.                     ;;
  449.                 esac
  450.                 ;;
  451.             4.*)
  452.                 DistName="FreeBSD-4.x"
  453.                 ;;
  454.             *)
  455.                 Message="FreeBSD/i386 binaries are not available for this version"
  456.                 ;;
  457.             esac
  458.             ;;
  459.         alpha)
  460.             case "$OsVersion" in
  461.             3.*)
  462.                 DistName="FreeBSD-alpha-3.x"
  463.                 ;;
  464.             4.*)
  465.                 DistName="FreeBSD-alpha-4.x"
  466.                 ;;
  467.             *)
  468.                 Message="FreeBSD/alpha binaries are not available for this version"
  469.                 ;;
  470.             esac
  471.             ;;
  472.         *)
  473.             Message="FreeBSD binaries are not available for this architecture"
  474.             ;;
  475.         esac
  476.         ;;
  477.     Linux)
  478.         case "$OsArch" in
  479.         i*86)
  480.             case "$OsLibcMajor" in
  481.             5)
  482.                 DistName="Linux-ix86-libc5"
  483.                 ;;
  484.             6)
  485.                 case "$OsLibcMinor" in
  486.                 0)
  487.                     DistName="Linux-ix86-glibc20"
  488.                     ;;
  489.                 1)
  490.                     DistName="Linux-ix86-glibc21"
  491.                     ;;
  492.                 2)
  493.                     DistName="Linux-ix86-glibc22"
  494.                     ;;
  495.                 *)
  496.                     Message="No dist available for glibc 2.$OsLibcMinor.  Try Linux-ix86-glibc22"
  497.                     ;;
  498.                 esac
  499.                 ;;
  500.             *)
  501.                 case "$OsObjFormat" in
  502.                 a.out)
  503.                     Message="Linux a.out is no longer supported"
  504.                     ;;
  505.                 *)
  506.                     Message="No Linux/ix86 binaries for this libc version"
  507.                     ;;
  508.                 esac
  509.                 ;;
  510.             esac
  511.             ;;
  512.         ppc)
  513.             case "$OsLibcMajor.$OsLibcMinor" in
  514.             6.1)
  515.                 DistName="Linux-ppc-glibc21"
  516.                 ;;
  517.             6.*)
  518.                 Message="No Linux/ppc binaries for glibc 2.$OsLibcMinor.  Try Linux-ppc-glibc21"
  519.                 ;;
  520.             *)
  521.                 Message="No Linux/ppc binaries for this libc version"
  522.                 ;;
  523.             esac
  524.             ;;
  525.         alpha)
  526.             case "$OsLibcMajor.$OsLibcMinor" in
  527.             6.1)
  528.                 DistName="Linux-alpha-glibc21"
  529.                 ;;
  530.             6.*)
  531.                 Message="No Linux/alpha binaries for glibc 2.$OsLibcMinor.  Try Linux-alpha-glibc21"
  532.                 ;;
  533.             *)
  534.                 Message="No Linux/alpha binaries for this libc version"
  535.                 ;;
  536.             esac
  537.             ;;
  538.         mips)
  539.             case "$OsLibcMajor.$OsLibcMinor" in
  540.             6.0)
  541.                 DistName="Linux-mips-glibc20"
  542.                 ;;
  543.             *)    
  544.                 Message="No Linux/Mips binaries for this libc version"
  545.                 ;;
  546.             esac
  547.             ;;
  548.         *)
  549.             Message="No Linux binaries available for this architecture"
  550.             ;;
  551.         esac
  552.         ;;
  553.     LynxOS)    # Check this
  554.         DistName="LynxOS"
  555.         ;;
  556.     NetBSD)
  557.         case "$OsArch" in
  558.         i386)
  559.             case "$OsVersion" in
  560.             1.[4-9]*)    # Check this
  561.                 case "$OsObjFormat" in
  562.                 a.out)
  563.                     DistName="NetBSD-1.4.x"
  564.                     ;;
  565.                 *)
  566.                     DistName="NetBSD-1.5"
  567.                     ;;
  568.                 esac
  569.                 ;;
  570.             *)
  571.                 Message="No NetBSD/i386 binaries available for this version"
  572.                 ;;
  573.             esac
  574.             ;;
  575.         *)
  576.             Message="No NetBSD binaries available for this architecture"
  577.             ;;
  578.         esac
  579.         ;;
  580.     OpenBSD)
  581.         case "$OsArch" in
  582.         i386)
  583.             case "$OsVersion" in
  584.             2.9*)    # Check this
  585.                 DistName="OpenBSD-2.9"
  586.                 ;;
  587.             *)
  588.                 Message="No OpenBSD/i386 binaries available for this version"
  589.                 ;;
  590.             esac
  591.             ;;
  592.         *)
  593.             Message="No OpenBSD binaries available for this architecture"
  594.             ;;
  595.         esac
  596.         ;;
  597.     SunOS)
  598.         case "$OsArch" in
  599.         i386)
  600.             case "$OsVersion" in
  601.             5.[67]*)
  602.                 DistName="Solaris"
  603.                 ;;
  604.             5.8*)
  605.                 DistName="Solaris-8"
  606.                 ;;
  607.             *)
  608.                 Message="No Solaris/x86 binaries available for this version"
  609.                 ;;
  610.             esac
  611.             ;;
  612.         *)
  613.             Message="No SunOS/Solaris binaries available for this architecture"
  614.             ;;
  615.         esac
  616.         ;;
  617.     UNIX_SV)
  618.         case "$OsArch" in
  619.         i386)
  620.             case "$OsVersion" in
  621.             4.0*)
  622.                 DistName="SVR4.0"
  623.                 ;;
  624.             *)
  625.                 # More detailed version check??
  626.                 DistName="UnixWare"
  627.                 ;;
  628.             esac
  629.             ;;
  630.         *)
  631.             Message="No SYSV binaries available for this architecture"
  632.             ;;
  633.         esac
  634.         ;;
  635.     *)
  636.         Message="No binaries available for this OS"
  637.         ;;
  638.     esac
  639.  
  640.     if [ X"$DistName" != X ]; then
  641.         echo "Binary distribution name is '$DistName'"
  642.         echo ""
  643.     else
  644.         if [ X"$Message" = X ]; then
  645.             echo "Can't find which binary distribution you should use."
  646.             echo "Please send the output of this script to XFree86@XFree86.org"
  647.             echo ""
  648.         else
  649.             echo "$Message"
  650.             echo ""
  651.         fi
  652.     fi
  653. }
  654.  
  655. GetBindistVersion()
  656. {
  657.     VERSTARBALL=
  658.     if [ X$DOBASE = XYES ]; then
  659.         if [ -f Xbin.tgz ]; then
  660.             VERSTARBALL=Xbin.tgz
  661.         fi
  662.     else
  663.         if [ X$DOUPDATE = XYES ]; then
  664.             if [ -f Xupdate.tgz ]; then
  665.                 VERSTARBALL=Xupdate.tgz
  666.             fi
  667.         fi
  668.     fi
  669.     rm -f $VERSIONFILE
  670.     if [ X$VERSTARBALL != X ]; then
  671.         $TAR xzf $VERSTARBALL $VERSIONFILE
  672.     fi
  673.     if [ -f $VERSIONFILE ]; then
  674.         BINDISTVERSION=`cat $VERSIONFILE`
  675.         echo "Bindist version is $BINDISTVERSION"
  676.         BINDISTFULLPREFIX=`expr $BINDISTVERSION : '\([0-9]*\.[0-9]*\)\.'`
  677.         BINDISTPATCHLEVEL=`expr $BINDISTVERSION : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
  678.         BINDISTFULLVERSION=$BINDISTFULLPREFIX.0
  679.     else
  680.         echo "Warning: can't detect the bindist version"
  681.     fi
  682.  
  683. }
  684.  
  685. CheckInstallType()
  686. {
  687.     # Check for explicit options
  688.  
  689.     if [ X"$1" != X ]; then
  690.         case $1 in
  691.         -update)
  692.             DOUPDATE=YES
  693.             DOBASE=NO
  694.             OPTS="$OPTS $1"
  695.             shift
  696.             ;;
  697.         -base|-full)
  698.             DOBASE=YES
  699.             DOUPDATE=NO
  700.             OPTS="$OPTS $1"
  701.             shift
  702.             ;;
  703.         esac
  704.     fi
  705.         
  706.     # Auto-detect based on what files are present
  707.  
  708.     if [ X"$DOUPDATE" = X ]; then
  709.         for i in $BASEDIST; do
  710.             if [ -f $i ]; then
  711.                 DOBASE=YES
  712.             fi
  713.         done
  714.         for i in $UPDATEDIST; do
  715.             if [ -f $i ]; then
  716.                 DOUPDATE=YES
  717.             fi
  718.         done
  719.         if [ X"$DOBASE" = XYES -a X"$DOUPDATE" = XYES ]; then
  720.             echo ""
  721.             echo "You appear to have binaries in the current directory for"
  722.             echo "both a full release and an update release.  The full release"
  723.             echo "must be installed before installing the update release."
  724.             echo ""
  725.             echo "The full release can be installed by re-running this script"
  726.             echo "with the '-base' option (sh $0 -base)."
  727.             echo ""
  728.             echo "The update release can be installed by re-running this script"
  729.             echo "with the '-update' option (sh $0 -update)."
  730.             echo ""
  731.             exit 1
  732.         fi
  733.     fi
  734.     GetBindistVersion
  735. }
  736.  
  737. InstallUpdate()
  738. {
  739.     # Check that there's an existing installation.
  740.  
  741.     missingDir=
  742.  
  743.     for d in $RUNDIR $RUNDIR/lib $RUNDIR/lib/X11 $RUNDIR/bin; do
  744.         if [ ! -d $d ]; then
  745.             missingDir="$missingDir $d"
  746.         fi
  747.     done
  748.  
  749.     if [ X$missingDir != X ]; then
  750.         echo ""
  751.         echo "You don't appear to have an existing installation of XFree86."
  752.         echo "You must install the most recent full release ($FULLVERSION)"
  753.         echo "before installing this update release."
  754.         echo ""
  755.         exit 1
  756.     fi
  757.  
  758.     if [ -f $XSERVERCMD ]; then
  759.         existingVer=`$XSERVERCMD -version 2>&1 | grep "XFree86 Version" | \
  760.                         awk '{print $3}'`
  761.         case $existingVer in
  762.         ${FULLPREFIX}.*)
  763.             ;;
  764.         *)
  765.             echo ""
  766.             echo "This update release should be installed on top of the most"
  767.             echo "recent full release ($FULLVERSION).  Your current version"
  768.             echo "appears to be $existingVer.  Please install $FULLVERSION"
  769.             echo "before installing this update release."
  770.             echo ""
  771.             exit 1
  772.         esac
  773.     fi
  774.  
  775.     echo ""
  776.     echo "Installing the update binary distribution"
  777.     echo ""
  778.     for i in $UPDATEDIST $EXTRAUPDATE; do
  779.         (cd $RUNDIR; $EXTRACT $WDIR/$i)
  780.     done
  781.  
  782.     # Make sure that $RUNDIR/lib isn't group/other writable
  783.     chmod og-w $RUNDIR/lib
  784.  
  785.     # Need to run ldconfig on some OSs
  786.     case "$OsName" in
  787.     FreeBSD|NetBSD|OpenBSD)
  788.         echo ""
  789.         echo "Running ldconfig"
  790.         /sbin/ldconfig -m $RUNDIR/lib
  791.         ;;
  792.     Linux)
  793.         echo ""
  794.         echo "Running ldconfig"
  795.         /sbin/ldconfig $RUNDIR/lib
  796.         ;;
  797.     esac
  798.  
  799.     # Run mkfontdir in the local and misc directories to make sure that
  800.     # the fonts.dir files are up to date after the installation.
  801.     echo ""
  802.     for i in $FONTDIRS $EXTRAFONTDIRS; do
  803.         if [ -d $RUNDIR/lib/X11/fonts/$i ]; then
  804.             Echo "Updating the fonts.dir file in $RUNDIR/lib/X11/fonts/$i..."
  805.             $RUNDIR/bin/mkfontdir $RUNDIR/lib/X11/fonts/$i
  806.             echo ""
  807.         fi
  808.     done
  809.         
  810.     echo ""
  811.     echo "Update installation complete."
  812. }
  813.  
  814.  
  815. if [ X"$1" = "X-check" ]; then
  816.     GetOsInfo
  817.     FindDistName
  818.     exit 0
  819. fi
  820.  
  821. echo ""
  822. echo "        Welcome to the XFree86 $SCRIPTVERSION installer"
  823. echo ""
  824. echo "You are strongly advised to backup your existing XFree86 installation"
  825. echo "before proceeding.  This includes the $ROOTDIR/usr/X11R6 and $ROOTDIR/etc/X11"
  826. echo "directories.  The installation process will overwrite existing files"
  827. echo "in those directories, and this may include some configuration files"
  828. echo "that may have been customised."
  829. echo ""
  830. echo "If you are installing a version different from $SCRIPTVERSION, you"
  831. echo "may need an updated version of this installer script."
  832. echo ""
  833. ContinueNo
  834.  
  835. # Should check if uid is zero
  836.  
  837. # Check if $DISPLAY is set, and warn
  838.  
  839. if [ X"$DISPLAY" != X ]; then
  840.     echo "\$DISPLAY is set, which may indicate that you are running this"
  841.     echo "installation from an X session.  It is recommended that X not be"
  842.     echo "running while doing the installation."
  843.     echo ""
  844.     ContinueNo
  845. fi
  846.  
  847. # First, do some preliminary checks
  848.  
  849. GetOsInfo
  850.  
  851. # Make OS-specific adjustments
  852.  
  853. case "$OsName" in
  854. Darwin)
  855.     SERVDIST="Xxserv.tgz"
  856.     EXTRAOPTDIST="Xquartz.tgz"
  857.     UPDATEDIST="Xupdate.tgz Xdocupd.tgz"
  858.     ;;
  859. FreeBSD|NetBSD|OpenBSD)
  860.     VARDIST="Xvar.tgz"
  861.     XKBDBDIR="$VARDIR/db/xkb"
  862.     ;;
  863. Interactive)    # Need the correct name for this
  864.     EXTRADIST="Xbin1.tgz"
  865.     EXTRAOPTDIST="Xxdm.tgz"
  866.     ;;
  867. Linux)
  868.     VARDIST="Xvar.tgz"
  869.     XKBDBDIR="$VARDIR/lib/xkb"
  870.     ;;
  871. esac
  872.  
  873. # Check for extract and extract.exe, and check that they are usable.
  874. #
  875. # This test may not be fool-proof.  A FreeBSD/ELF binary downloaded in
  876. # ASCII mode passed it :-(.
  877. #
  878. if [ -f extract ]; then
  879.     ExtractExists=YES
  880.     chmod +x extract
  881.     if ./extract --version | head -1 | \
  882.       fgrep "extract (XFree86 version" > /dev/null 2>&1; then
  883.         ExtractOK=YES
  884.     else
  885.         echo "extract doesn't work properly, renaming it to 'extract.bad'"
  886.         rm -f extract.bad
  887.         mv extract extract.bad
  888.     fi
  889. fi
  890. if [ X"$ExtractOK" != XYES ]; then
  891.     if [ -f extract.exe ]; then
  892.         ExtractExeExists=YES
  893.         rm -f extract
  894.         ln extract.exe extract
  895.         chmod +x extract
  896.         if ./extract --version | head -1 | \
  897.           fgrep "extract (XFree86 version" > /dev/null 2>&1; then
  898.             ExtractOK=YES
  899.         else
  900.             echo "extract.exe doesn't work properly, renaming it to"
  901.             echo "'extract.exe.bad'"
  902.             rm -f extract.exe.bad
  903.             mv extract.exe extract.exe.bad
  904.             rm -f extract
  905.         fi
  906.     fi
  907. fi
  908. if [ X"$ExtractOK" != XYES ]; then
  909.     echo ""
  910.     if [ X"$ExtractExists" = XYES -a X"$ExtractExeExists" = XYES ]; then
  911.         echo "The versions of 'extract' and 'extract.exe' you have do not run'"
  912.         echo "correctly.  Make sure that you have downloaded the correct"
  913.         echo "binaries for your system.  To find out which is correct,"
  914.         echo "run 'sh $0 -check'."
  915.     fi
  916.     if [ X"$ExtractExists" = XYES -a X"$ExtractExeExists" != XYES ]; then
  917.         echo "The version of 'extract' you have does not run correctly."
  918.         echo "This is most commonly due to problems downloading this file"
  919.         echo "with some web browsers.  You may get better results if you"
  920.         echo "download the version called 'extract.exe' and try again."
  921.     fi
  922.     if [ X"$ExtractExists" != XYES -a X"$ExtractExeExists" = XYES ]; then
  923.         echo "The version of 'extract.exe' you have does not run correctly."
  924.         echo "Make sure that you have downloaded the correct binaries for your"
  925.         echo "system.  To find out which is correct, run 'sh $0 -check'."
  926.     fi
  927.     if [ X"$ExtractExists" != XYES -a X"$ExtractExeExists" != XYES ]; then
  928.         echo "You need to download the 'extract' (or 'extract.exe') utility"
  929.         echo "and put it in this directory."
  930.     fi
  931.     echo ""
  932.     echo "When you have corrected the problem, please re-run 'sh $0$OPTS'"
  933.     echo "to proceed with the installation."
  934.     echo ""
  935.     exit 1
  936. fi
  937.  
  938. # Link extract to gnu-tar so it can also be used as a regular tar
  939. rm -f gnu-tar
  940. ln extract gnu-tar
  941.  
  942. EXTRACT=$WDIR/extract
  943. TAR=$WDIR/gnu-tar
  944.  
  945. CheckInstallType "$@"
  946.  
  947. if [ X"$DOUPDATE" = XYES ]; then
  948.     REQUIREDFILES=" \
  949.         extract \
  950.         $UPDATEDIST \
  951.         $EXTRAUPDATE
  952.         "
  953. else
  954.     REQUIREDFILES=" \
  955.         extract \
  956.         $BASEDIST \
  957.         $ETCDIST \
  958.         $VARDIST \
  959.         $SERVDIST \
  960.         $EXTRADIST \
  961.         "
  962. fi
  963.  
  964. echo "Checking for required files ..."
  965. Needed=""
  966.  
  967. for i in $REQUIREDFILES; do
  968.     if [ ! -f $i ]; then
  969.         Needed="$Needed $i"
  970.     fi
  971. done
  972. if [ X"$Needed" != X ]; then
  973.     echo ""
  974.     echo "The files:"
  975.     echo ""
  976.     echo "$Needed"
  977.     echo ""
  978.     echo "must be present in the current directory to proceed with the"
  979.     echo "installation.  You should be able to find it at the same place"
  980.     echo "you picked up the rest of the XFree86 binary distribution."
  981.     echo "Please re-run 'sh $0$OPTS' to proceed with the installation when"
  982.     echo "you have them."
  983.     echo ""
  984.     exit 1
  985. fi
  986.  
  987. DoOsChecks
  988.  
  989. if [ X"$NEEDSOMETHING" != X ]; then
  990.     echo ""
  991.     echo "Please re-run 'sh $0$OPTS' to proceed with the installation after you"
  992.     echo "have made the required updates."
  993.     echo ""
  994.     exit 1
  995. fi
  996.  
  997. echo ""
  998.  
  999. # Set version variables if the bindist version was successfully auto-detected.
  1000.  
  1001. if [ X$BINDISTVERSION != X ]; then
  1002.     VERSION=$BINDISTVERSION
  1003. fi
  1004. if [ X$BINDISTFULLVERSION != X ]; then
  1005.     FULLVERSION=$BINDISTFULLVERSION
  1006. fi
  1007. if [ X$BINDISTPATCHLEVEL != X ]; then
  1008.     PATCHLEVEL=$BINDISTPATCHLEVEL
  1009. fi
  1010. if [ X$BINDISTFULLPREFIX != X ]; then
  1011.     FULLPREFIX=$BINDISTFULLPREFIX
  1012. fi
  1013.  
  1014. if [ X"$DOUPDATE" = XYES ]; then
  1015.     InstallUpdate
  1016.     exit 0
  1017. fi
  1018.  
  1019. # Create $RUNDIR and $ETCDIR if they don't already exist
  1020.  
  1021. if [ ! -d $RUNDIR ]; then
  1022.     NewRunDir=YES
  1023.     echo "Creating $RUNDIR"
  1024.     mkdir $RUNDIR
  1025. fi
  1026. if [ ! -d $RUNDIR/lib ]; then
  1027.     echo "Creating $RUNDIR/lib"
  1028.     mkdir $RUNDIR/lib
  1029. fi
  1030. if [ ! -d $RUNDIR/lib/X11 ]; then
  1031.     echo "Creating $RUNDIR/lib/X11"
  1032.     mkdir $RUNDIR/lib/X11
  1033. fi
  1034. if [ ! -d $ETCDIR ]; then
  1035.     NewEtcDir=YES
  1036.     echo "Creating $ETCDIR"
  1037.     mkdir $ETCDIR
  1038. fi
  1039.  
  1040. if [ -d $RUNDIR -a -d $RUNDIR/bin -a -d $RUNDIR/lib ]; then
  1041.     echo ""
  1042.     echo "You appear to have an existing installation of X.  Continuing will"
  1043.     echo "overwrite it.  You will, however, have the option of being prompted"
  1044.     echo "before most configuration files are overwritten."
  1045.     ContinueYes
  1046. fi
  1047.  
  1048. if [ X"$OLDFILES" != X ]; then
  1049.     echo ""
  1050.     echo "Removing some old files that are no longer required..."
  1051.     for i in $OLDFILES; do
  1052.         if [ -f $i ]; then
  1053.             echo "    removing old file $i"
  1054.             rm -f $i
  1055.         fi
  1056.     done
  1057.     echo ""
  1058. fi
  1059.  
  1060. if [ X"$OLDDIRS" != X ]; then
  1061.     echo ""
  1062.     echo "Removing some old directories that are no longer required..."
  1063.     for i in $OLDDIRS; do
  1064.         if [ -d $i ]; then
  1065.             echo "    removing old directory $i"
  1066.             rm -fr $i
  1067.         fi
  1068.     done
  1069.     echo ""
  1070. fi
  1071.  
  1072. if [ ! -d $RUNDIR/lib/X11/xkb ]; then
  1073.     echo "Creating $RUNDIR/lib/X11/xkb"
  1074.     mkdir $RUNDIR/lib/X11/xkb
  1075. fi
  1076. # Check for config file directories that may need to be moved.
  1077.  
  1078. EtcDirToMove=
  1079. EtcFileToMove=
  1080. if [ X"$NoSymLinks" != XYES ]; then
  1081.     for i in $ETCDLINKS; do
  1082.         if [ -d $RUNDIR/lib/X11/$i -a ! $L $RUNDIR/lib/X11/$i ]; then
  1083.             EtcDirToMove="$EtcDirToMove $i"
  1084.         fi
  1085.     done
  1086.     for i in $ETCFLINKS; do
  1087.         if [ -f $RUNDIR/lib/X11/$i -a ! $L $RUNDIR/lib/X11/$i ]; then
  1088.             EtcFileToMove="$EtcFileToMove $i"
  1089.         fi
  1090.     done
  1091. fi
  1092.  
  1093. if [ X"$EtcDirToMove" != X -o X"$EtcFileToMove" != X ]; then
  1094.     echo "XFree86 now installs most customisable configuration files under"
  1095.     echo "$ETCDIR instead of under $RUNDIR/lib/X11, and has symbolic links"
  1096.     echo "under $RUNDIR/lib/X11 that point to $ETCDIR.  You currently have"
  1097.     echo "files under the following subdirectories of $RUNDIR/lib/X11:"
  1098.     echo ""
  1099.     echo "$EtcDirToMove $EtcFileToMove"
  1100.     echo ""
  1101.     echo "Do you want to move them to $ETCDIR and create the necessary"
  1102.     Echo "links? (y/n) [y] "
  1103.     read response
  1104.     case "$response" in
  1105.     [nN]*)
  1106.         echo ""
  1107.         echo "Note: this means that your run-time config files will remain"
  1108.         echo "in the old $RUNDIR/lib/X11 location."
  1109.         NoSymLinks=YES;
  1110.         ;;
  1111.     esac
  1112.     echo ""
  1113.     if [ X"$NoSymLinks" != XYES ]; then
  1114.         for i in $EtcDirToMove; do
  1115.             echo "Moving $RUNDIR/lib/X11/$i to $ETCDIR/$i ..."
  1116.             if [ ! -d $ETCDIR/$i ]; then
  1117.                 mkdir $ETCDIR/$i
  1118.             fi
  1119.             $TAR -C $RUNDIR/lib/X11/$i -c -f - . | \
  1120.                 $TAR -C $ETCDIR/$i -v -x -p -U -f - && \
  1121.                 rm -fr $RUNDIR/lib/X11/$i && \
  1122.                 ln -s $ETCDIR/$i $RUNDIR/lib/X11/$i
  1123.         done
  1124.         for i in $EtcFileToMove; do
  1125.             echo "Moving $RUNDIR/lib/X11/$i to $ETCDIR/$i ..."
  1126.             cp -p $RUNDIR/lib/X11/$i $ETCDIR/$i && \
  1127.                 rm -fr $RUNDIR/lib/X11/$i && \
  1128.                 ln -s $ETCDIR/$i $RUNDIR/lib/X11/$i
  1129.         done
  1130.     fi
  1131. fi
  1132.  
  1133. # Maybe allow a backup of the config files to be made?
  1134.  
  1135. # Extract Xetc.tgz into a temporary location, and prompt for moving the
  1136. # files.
  1137.  
  1138. echo "Extracting $ETCDIST into a temporary location ..."
  1139. rm -fr .etctmp
  1140. mkdir .etctmp
  1141. (cd .etctmp; $EXTRACT $WDIR/$ETCDIST)
  1142. for i in $ETCDLINKS; do
  1143.     DoCopy=YES
  1144.     if [ -d $RUNDIR/lib/X11/$i ]; then
  1145.         Echo "Do you want to overwrite the $i config files? (y/n) [n] "
  1146.         read response
  1147.         case "$response" in
  1148.         [yY]*)
  1149.             : OK
  1150.             ;;
  1151.         *)
  1152.             DoCopy=NO
  1153.             ;;
  1154.         esac
  1155.     fi
  1156.     if [ $DoCopy = YES ]; then
  1157.         echo "Installing the $i config files ..."
  1158.         if [ X"$NoSymLinks" != XYES ]; then
  1159.             if [ ! -d $ETCDIR/$i ]; then
  1160.                 mkdir $ETCDIR/$i
  1161.             fi
  1162.             if [ ! -d $RUNDIR/lib/X11/$i ]; then
  1163.                 ln -s $ETCDIR/$i $RUNDIR/lib/X11/$i
  1164.             fi
  1165.         else
  1166.             if [ ! -d $RUNDIR/lib/X11/$i ]; then
  1167.                 mkdir $RUNDIR/lib/X11/$i
  1168.             fi
  1169.         fi
  1170.         $TAR -C .etctmp/$i -c -f - . | \
  1171.             $TAR -C $RUNDIR/lib/X11/$i -v -x -p -U -f -
  1172.     fi
  1173. done
  1174. for i in $ETCFLINKS; do
  1175.     DoCopy=YES
  1176.     if [ -f $RUNDIR/lib/X11/$i ]; then
  1177.         Echo "Do you want to overwrite the $i config file? (y/n) [n] "
  1178.         read response
  1179.         case "$response" in
  1180.         [yY]*)
  1181.             : OK
  1182.             ;;
  1183.         *)
  1184.             DoCopy=NO
  1185.             ;;
  1186.         esac
  1187.     fi
  1188.     if [ $DoCopy = YES ]; then
  1189.         echo "Installing the $i config file ..."
  1190.         if [ X"$NoSymLinks" != XYES ]; then
  1191.             if [ ! -f $RUNDIR/lib/X11/$i ]; then
  1192.                 ln -s $ETCDIR/$i $RUNDIR/lib/X11/$i
  1193.             fi
  1194.         fi
  1195.         (set -x; cp -p .etctmp/$i $RUNDIR/lib/X11/$i)
  1196.     fi
  1197. done
  1198. if [ X"$XKBDIR" != X ]; then
  1199.     if [ X"$NoSymLinks" = XYES ]; then
  1200.         XKBDIR=$RUNDIR/lib/X11/xkb/compiled
  1201.     fi
  1202.     if [ -d .etctmp/xkb ]; then
  1203.         if [ ! -d $XKBDIR ]; then
  1204.             mkdir $XKBDIR
  1205.         fi
  1206.         $TAR -C .etctmp/xkb -c -f - . | \
  1207.             $TAR -C $XKBDIR -v -x -p -U -f -
  1208.     fi
  1209. fi
  1210. rm -fr .etctmp
  1211.  
  1212. echo ""
  1213. echo "Installing the mandatory parts of the binary distribution"
  1214. echo ""
  1215. for i in $BASEDIST $SERVDIST; do
  1216.     (cd $RUNDIR; $EXTRACT $WDIR/$i)
  1217. done
  1218. if [ X"$VARDIST" != X ]; then
  1219.     (cd $VARDIR; $EXTRACT $WDIR/$VARDIST)
  1220. fi
  1221.  
  1222. if [ X"$XKBDIR" != X -a X"$XKBDIR" != X"$RUNDIR/lib/X11/xkb/compiled" -a \
  1223.      X"$XKBDBDIR" != X ]; then
  1224.     rm -fr $RUNDIR/lib/X11/xkb/compiled
  1225.     ln -s $XKBDBDIR $RUNDIR/lib/X11/xkb/compiled
  1226. fi
  1227.  
  1228. echo "Checking for optional components to install ..."
  1229. for i in $OPTDIST $EXTRAOPTDIST; do
  1230.     if [ -f $i ]; then
  1231.         Echo "Do you want to install $i (`Description $i`)? (y/n) [y] "
  1232.         read response
  1233.         case "$response" in
  1234.         [nN]*)
  1235.             : skip this one
  1236.             ;;
  1237.         *)
  1238.             (cd $RUNDIR; $EXTRACT $WDIR/$i)
  1239.             ;;
  1240.         esac
  1241.     fi
  1242. done
  1243.  
  1244. # Need to run ldconfig on some OSs
  1245. case "$OsName" in
  1246. FreeBSD|NetBSD|OpenBSD)
  1247.     echo ""
  1248.     echo "Running ldconfig"
  1249.     /sbin/ldconfig -m $RUNDIR/lib
  1250.     ;;
  1251. Linux)
  1252.     echo ""
  1253.     echo "Running ldconfig"
  1254.     /sbin/ldconfig $RUNDIR/lib
  1255.     ;;
  1256. esac
  1257.  
  1258. # Run mkfontdir in the local and misc directories to make sure that
  1259. # the fonts.dir files are up to date after the installation.
  1260. echo ""
  1261. for i in $FONTDIRS $EXTRAFONTDIRS; do
  1262.     if [ -d $RUNDIR/lib/X11/fonts/$i ]; then
  1263.         Echo "Updating the fonts.dir file in $RUNDIR/lib/X11/fonts/$i..."
  1264.         $RUNDIR/bin/mkfontdir $RUNDIR/lib/X11/fonts/$i
  1265.         echo ""
  1266.     fi
  1267. done
  1268.         
  1269. # Check if the system has a termcap file
  1270. TERMCAP1DIR=$ROOTDIR/usr/share
  1271. TERMCAP2=$ROOTDIR/etc/termcap
  1272. if [ -d $TERMCAP1DIR ]; then
  1273.     TERMCAP1=`find $TERMCAP1DIR -type f -name termcap -print 2> /dev/null`
  1274.     if [ x"$TERMCAP1" != x ]; then
  1275.         TERMCAPFILE="$TERMCAP1"
  1276.     fi
  1277. fi
  1278. if [ x"$TERMCAPFILE" = x ]; then
  1279.     if [ -f $TERMCAP2 ]; then
  1280.         TERMCAPFILE="$TERMCAP2"
  1281.     fi
  1282. fi
  1283.  
  1284. # Override this for some OSs
  1285.  
  1286. case "$OsName" in
  1287. OpenBSD)
  1288.     TERMCAPFILE=""
  1289.     ;;
  1290. esac
  1291.  
  1292. if [ X"$TERMCAPFILE" != X ]; then
  1293.     echo ""
  1294.     echo "You appear to have a termcap file: $TERMCAPFILE"
  1295.     echo "This should be edited manually to replace the xterm entries"
  1296.     echo "with those in $RUNDIR/lib/X11/etc/xterm.termcap"
  1297.     echo ""
  1298.     echo "Note: the new xterm entries are required to take full advantage"
  1299.     echo "of new features, but they may cause problems when used with"
  1300.     echo "older versions of xterm.  A terminal type 'xterm-r6' is included"
  1301.     echo "for compatibility with the standard X11R6 version of xterm."
  1302. fi
  1303.  
  1304. # Check for terminfo, and update the xterm entry
  1305. TINFODIR=$ROOTDIR/usr/lib/terminfo
  1306. # Does this list need to be updated?
  1307. OLDTINFO=" \
  1308.     x/xterm \
  1309.     x/xterms \
  1310.     x/xterm-24 \
  1311.     x/xterm-vi \
  1312.     x/xterm-65 \
  1313.     x/xterm-bold \
  1314.     x/xtermm \
  1315.     x/xterm-boldso \
  1316.     x/xterm-ic \
  1317.     x/xterm-r6 \
  1318.     x/xterm-old \
  1319.     x/xterm-r5 \
  1320.     v/vs100"
  1321.     
  1322. if [ -d $TINFODIR ]; then
  1323.     echo ""
  1324.     echo "You appear to have a terminfo directory: $TINFODIR"
  1325.     echo "New xterm terminfo entries can be installed now."
  1326.     echo ""
  1327.     echo "Note: the new xterm entries are required to take full advantage"
  1328.     echo "of new features, but they may cause problems when used with"
  1329.     echo "older versions of xterm.  A terminal type 'xterm-r6' is included"
  1330.     echo "for compatibility with the standard X11R6 version of xterm."
  1331.     echo ""
  1332.     echo "Do you wish to have the new xterm terminfo entries installed"
  1333.     Echo "now (y/n)? [n] "
  1334.     read response
  1335.     case "$response" in
  1336.     [yY]*)
  1337.         echo ""
  1338.         for t in $OLDTINFO; do
  1339.             if [ -f $TINFODIR/$t ]; then
  1340.                 echo "Moving old terminfo file $TINFODIR/$t to $TINFODIR/$t.bak"
  1341.                 rm -f $TINFODIR/$t.bak
  1342.                 mv -f $TINFODIR/$t $TINFODIR/$t.bak
  1343.             fi
  1344.         done
  1345.         echo ""
  1346.         echo "Installing new terminfo entries for xterm."
  1347.         echo ""
  1348.         echo "On some systems you may get warnings from tic about 'meml'"
  1349.         echo "and 'memu'.  These warnings can safely be ignored."
  1350.         echo ""
  1351.         tic $RUNDIR/lib/X11/etc/xterm.terminfo
  1352.         ;;
  1353.     *)
  1354.         echo ""
  1355.         echo "Not installing new terminfo entries for xterm."
  1356.         echo "They can be installed later by running:"
  1357.         echo ""
  1358.         echo "  tic $RUNDIR/lib/X11/etc/xterm.terminfo"
  1359.         ;;
  1360.     esac
  1361. fi
  1362.  
  1363. if [ -f $RUNDIR/lib/libGL.so ]; then
  1364.     existing=""
  1365.     if [ -f $ROOTDIR/usr/lib/libGL.so ]; then
  1366.         existing="$existing /usr/lib/libGL.so"
  1367.     fi
  1368.     if [ -f $ROOTDIR/usr/lib/libGL.so.1 ]; then
  1369.         existing="$existing /usr/lib/libGL.so.1"
  1370.     fi
  1371.     if [ -d $ROOTDIR/usr/include/GL ]; then
  1372.         existing="$existing /usr/include/GL"
  1373.     fi
  1374.     echo ""
  1375.     echo "On some platforms (e.g., Linux), the OpenGL standard requires"
  1376.     echo "that the GL shared library and header files be visible from the"
  1377.     echo "standard system lib and include directories ($ROOTDIR/usr/lib and"
  1378.     echo "$ROOTDIR/usr/include).  This can be done by installing links in those"
  1379.     echo "directories to the files that have been installed under $RUNDIR."
  1380.     echo ""
  1381.     echo "NOTE: installing these links will overwrite existing files or"
  1382.     echo "links."
  1383.     if [ X"$existing" != X ]; then
  1384.         echo ""
  1385.         echo "The follwing links/files/directories already exist:"
  1386.         echo ""
  1387.         ls -ld $existing
  1388.     fi
  1389.     echo ""
  1390.     Echo "Do you wish to have the (new) links installed (y/n)? [n] "
  1391.     read response
  1392.     case "$response" in
  1393.     [yY]*)
  1394.         if [ ! -d $ROOTDIR/usr/lib ]; then
  1395.             echo "Creating $ROOTDIR/usr/lib"
  1396.             mkdir $ROOTDIR/usr/lib
  1397.         fi
  1398.         if [ ! -d $ROOTDIR/usr/include ]; then
  1399.             echo "Creating $ROOTDIR/usr/include"
  1400.             mkdir $ROOTDIR/usr/include
  1401.         fi
  1402.         rm -f $ROOTDIR/usr/lib/libGL.so
  1403.         if [ ! -f $ROOTDIR/usr/lib/libGL.so ]; then
  1404.             echo "Creating link from $RUNDIR/lib/libGL.so to $ROOTDIR/usr/lib/libGL.so"
  1405.             ln -s $RUNDIR/lib/libGL.so $ROOTDIR/usr/lib/libGL.so
  1406.         else
  1407.             echo "Could not remove existing $ROOTDIR/usr/lib/libGL.so, so the new"
  1408.             echo "link has not been created."
  1409.         fi
  1410.         rm -f $ROOTDIR/usr/lib/libGL.so.1
  1411.         if [ ! -f $ROOTDIR/usr/lib/libGL.so.1 ]; then
  1412.             echo "Creating link from $RUNDIR/lib/libGL.so.1 to $ROOTDIR/usr/lib/libGL.so.1"
  1413.             ln -s $RUNDIR/lib/libGL.so.1 $ROOTDIR/usr/lib/libGL.so.1
  1414.         else
  1415.             echo "Could not remove existing $ROOTDIR/usr/lib/libGL.so.1, so the new"
  1416.             echo "link has not been created."
  1417.         fi
  1418.         if [ -d $RUNDIR/include/GL ]; then
  1419.             rm -f $ROOTDIR/usr/include/GL
  1420.             if [ ! -d $ROOTDIR/usr/include/GL ]; then
  1421.                 echo "Creating link from $RUNDIR/include/GL to $ROOTDIR/usr/include/GL"
  1422.                 ln -s $RUNDIR/include/GL $ROOTDIR/usr/include/GL
  1423.             else
  1424.                 echo "Could not remove existing $ROOTDIR/usr/include/GL, so the new"
  1425.                 echo "link has not been created."
  1426.             fi
  1427.         fi
  1428.         ;;
  1429.     esac
  1430. fi
  1431.  
  1432. if [ -f $RUNDIR/bin/rstartd ]; then
  1433.     echo ""
  1434.     echo "If you are going to use rstart and $RUNDIR/bin isn't in the"
  1435.     echo "default path for commands run remotely via rsh, you will need"
  1436.     echo "a link to rstartd installed in $ROOTDIR/usr/bin."
  1437.     echo ""
  1438.     Echo "Do you wish to have this link installed (y/n)? [n] "
  1439.     read response
  1440.     case "$response" in
  1441.     [yY]*)
  1442.         if [ ! -d $ROOTDIR/usr/bin ]; then
  1443.             echo "Creating $ROOTDIR/usr/bin"
  1444.             mkdir $ROOTDIR/usr/bin
  1445.         fi
  1446.         echo "Creating link from $RUNDIR/bin/rstartd to $ROOTDIR/usr/bin/rstartd"
  1447.         rm -f $ROOTDIR/usr/bin/rstartd
  1448.         ln -s $RUNDIR/bin/rstartd $ROOTDIR/usr/bin/rstartd
  1449.         ;;
  1450.     esac
  1451. fi
  1452.  
  1453. # Finally, check for old 3.3.x modules that will conflict with 4.x
  1454. if [ -d $RUNDIR/lib/modules ]; then
  1455.     for i in $OLDMODULES; do
  1456.         if [ -f $RUNDIR/lib/modules/$i ]; then
  1457.             ModList="$ModList $i"
  1458.         fi
  1459.     done
  1460.     if [ X"$ModList" != X ]; then
  1461.         echo ""
  1462.         echo "The following 3.3.x X server modules were found in"
  1463.         echo "$RUNDIR/lib/modules, and they may cause problems when running"
  1464.         echo "$VERSION:"
  1465.         echo ""
  1466.         echo "  $ModList"
  1467.         echo ""
  1468.         echo "Do you want them moved to $RUNDIR/lib/modules/old?"
  1469.         echo "Note: that if you want to use them with 3.3.x again, you'll"
  1470.         Echo "need to move them back manually. (y/n) [n] "
  1471.         read response
  1472.         case "$response" in
  1473.         [yY]*)
  1474.             if [ ! -d $RUNDIR/lib/modules/old ]; then
  1475.                 echo ""
  1476.                 echo "Creating $RUNDIR/lib/modules/old"
  1477.                 mkdir $RUNDIR/lib/modules/old
  1478.             else
  1479.                 echo ""
  1480.             fi
  1481.             if [ -d $RUNDIR/lib/modules/old ]; then
  1482.                 for i in $ModList; do
  1483.                     echo "Moving $i to $RUNDIR/lib/modules/old"
  1484.                     mv $RUNDIR/lib/modules/$i $RUNDIR/lib/modules/old/$i
  1485.                 done
  1486.             else
  1487.                 echo "Failed to create directory $RUNDIR/lib/modules/old"
  1488.             fi
  1489.             ;;
  1490.         *)
  1491.             echo ""
  1492.             echo "Make sure that you rename, move or delete the old modules"
  1493.             echo "before running $VERSION."
  1494.         esac
  1495.     fi
  1496.     # Some distributions have old codeconv modules
  1497.     if [ -d $RUNDIR/lib/modules/codeconv ]; then
  1498.         if [ -f $RUNDIR/lib/modules/codeconv/ISO8859_1.so ]; then
  1499.             echo ""
  1500.             echo "Warning: it looks like there are some old *.so modules"
  1501.             echo "in $RUNDIR/lib/modules/codeconv.  You may need to rename,"
  1502.             echo "move or delete them if you use the xtt font module."
  1503.         fi
  1504.     fi
  1505. fi
  1506.  
  1507. echo ""
  1508. echo "Installation complete."
  1509.  
  1510. exit 0
  1511. ### Local Variables:     ***
  1512. ### tab-width: 4         ***
  1513. ### End:                ***
  1514.