home *** CD-ROM | disk | FTP | other *** search
/ Peanuts NeXT Software Archives / Peanuts-2.iso / Text / tex / teTeX / distrib / install.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  1996-08-31  |  73.2 KB  |  2,634 lines

  1. #!/bin/sh
  2.  
  3. ################################################################
  4. # Basic IO:
  5. ################################################################
  6.  
  7. ################################################################
  8. # read: called with the name of a variable and (optionally) a
  9. #       different message text. Keeps the old value of the
  10. #       variable, if the empty string in entered.
  11. ################################################################
  12. gets()
  13. {
  14.     gets_var=$1; gets_text=${2-$gets_var}
  15.     eval old=\$$gets_var
  16.     eval $echon \""New value for $gets_text [$old]: "\"
  17.     read $gets_var
  18.     eval test -z \"\$$gets_var\" && eval $gets_var=\'$old\'
  19. }
  20.  
  21. ################################################################
  22. # getopt: get a menu choice.
  23. #   $1: string with valid characters
  24. #   $2: message for prompting
  25. ################################################################
  26. getopt()
  27. {
  28.     chars=$1; msg=$2
  29.     while true; do
  30.         #$echon "$msg ([$chars]): "
  31.         $echon "$msg: " >&2
  32.         read ans
  33.         ans=`echo $ans | tr '[a-z]' '[A-Z]'`
  34.         case "$ans" in
  35.           [$chars])
  36.             echo "$ans"
  37.             return
  38.         esac
  39.     done
  40. }
  41.  
  42. ################################################################
  43. # toolge: given the name of a variable, toogle switches between
  44. #         the values ' ' and X.
  45. ################################################################
  46. toggle()
  47. {
  48.     if eval test \"\$$1\" = X; then
  49.         eval $1=\' \'
  50.     else
  51.         eval $1=X
  52.     fi
  53. }
  54.  
  55. ################################################################
  56. # This tricky function displays the value of a variable that can
  57. # contain newline characters. Variables will be expanded, too.
  58. # Arguments:
  59. #       1: the name of the variable
  60. ################################################################
  61. textvar_show()
  62. {
  63.     OLDIFS=$IFS; IFS=;
  64.     eval echo \"`eval echo \\$${1}`\"
  65.     IFS=$OLDIFS
  66. }
  67.  
  68. readln()
  69. {
  70.     $echon 'Press return to continue... '
  71.     read foo
  72. }
  73.  
  74. help()
  75. {
  76.     var=$1
  77.     cls
  78.     textvar_show $var 2>&1 | eval $PAGER
  79.     echo
  80.     readln
  81. }
  82.  
  83. ################################################################
  84. # Use the yesno functions to ask the user a simple yes/no
  85. # question.
  86. # Arguments:
  87. #   $1: test to display for the question (" (Y/N)? " will
  88. #       automatically be appended).
  89. ################################################################
  90. yesno()
  91. {
  92.     while true; do
  93.     $echon "$1 (Y/N)? "
  94.     read ans
  95.     case $ans in
  96.         y|Y)    return 0;;
  97.         n|N)    return 1;;
  98.         esac
  99.     done
  100. }
  101.  
  102. ################################################################
  103. # A set of functions the might do an echo without linefeed in
  104. # the end. Function find_echo sets the variable "echon" to a
  105. # suitable function.
  106. ################################################################
  107. echo_a() { echo      -n "$@";   }
  108. echo_b() { echo         "$@\c"; }
  109. echo_c() { echo      -e "$@\c"; }
  110. echo_d() { /bin/echo -n "$@";   }
  111. echo_e() { /bin/echo    "$@\c"; }
  112. echo_f() { /bin/echo -e "$@\c"; }
  113.  
  114. ################################################################
  115. # Test which of the above functions does the trick. We set
  116. # the variable "echon" to the first function that works
  117. # correctly.
  118. ################################################################
  119. find_echo()
  120. {
  121.     for i in a b c d e f; do
  122.         test "`echo_$i c``echo_$i a`"  = ca && echon=echo_$i && return
  123.     done
  124.     echon=echo
  125. }
  126.  
  127.  
  128. ################################################################
  129. # series and packages management:
  130. ################################################################
  131.  
  132. ###############################################################################
  133. # The series structure:
  134. #  s_${series}_la:   "list of all packages"
  135. #  s_${series}_lf:   "list of packages we found on the disk"
  136. #  s_${series}_ls:   "list of selected packages"
  137. #  s_${series}_mis:  "list of packages that are missing"
  138. #  s_${series}_nf:   "number of packages we find"
  139. #  s_${series}_ns:   "number of selected packages"
  140. #  s_${series}_nmis: "number of packages that are missing"
  141. #  s_${series}_du:   "disk space usage of all packages found"
  142. #  s_${series}_dus:  "disk space usage of selected packages"
  143. #  s_${series}_h:    "help text"
  144. ###############################################################################
  145.  
  146. ###############################################################################
  147. # The package structure:
  148. #  p_${package}_n:  "the name of the package"
  149. #  p_${package}_s:  "is the package selected?"
  150. #  p_${package}_l:  "level: required, recommended or optional"
  151. #  p_${package}_da: "did we find the package?"
  152. #  p_${package}_fn: "the filename of a package the we found"
  153. #  p_${package}_h:  "help text"
  154. ###############################################################################
  155.  
  156. allseries_locate()
  157. {
  158.     for al_series in $S_all_la;
  159.     do
  160.         series_locate $al_series;
  161.     done
  162. }
  163.  
  164. allseries_locate_check()
  165. {
  166.     notall=false
  167.     hasbin=false
  168.     test "$this_platform" != "" &&
  169.         eval test \"\$p_${this_platform}_da\" = true &&
  170.         hasbin=true
  171.     for alc_series in $S_all_la; do
  172.         test $alc_series = bin && $hasbin && continue
  173.         eval alc_all_packages=\"\$s_${alc_series}_la\"
  174.         for alc_p in $alc_all_packages; do
  175.           if eval test \"\$p_${alc_p}_da\" = false; then
  176.             notall=true
  177.             eval echo \""Warning: package not found: \${p_${alc_p}_d-$alc_p} (series: $alc_series)."\"
  178.           fi
  179.         done
  180.     done
  181.     if test "$notall" = true; then
  182.         echo
  183.         echo "Notice: ignore the warnings, if the packages are missing intentionally."
  184.         echo
  185.         $echon "Press return to continue or Control-C to abort... "
  186.         read foo
  187.     fi
  188. }
  189.  
  190. series_locate()
  191. {
  192.     sl_series=$1
  193.     eval sl_all_packages=\"\$s_${sl_series}_la\"
  194.     eval dft_dir=\"\$s_${sl_series}_d\"
  195.     lf=; mis=; nmis=0; nf=0
  196.     for sl_p in $sl_all_packages; do
  197.         eval bn=\${p_${sl_p}_d-$sl_p}
  198.         fn=
  199.         test -f $here/$dft_dir/$bn.tar.gz && fn=$here/$dft_dir/$bn.tar.gz
  200.         test -f $here/$bn.tar.gz && fn=$here/$bn.tar.gz
  201.         if test -z "$fn"; then
  202.           eval p_${sl_p}_da=false
  203.           eval p_${sl_p}_fn=
  204.  
  205.           mis="$mis $sl_p"
  206.           nmis=`expr $nmis + 1`
  207.         else
  208.           eval p_${sl_p}_da=true
  209.           eval p_${sl_p}_fn=$fn
  210.  
  211.           lf="$lf $sl_p"
  212.           nf=`expr $nf + 1`
  213.         fi
  214.     done
  215.     eval s_${sl_series}_lf=\"$lf\"
  216.     eval s_${sl_series}_mis=\"$mis\"
  217.     eval s_${sl_series}_nmis=$nmis
  218.     eval s_${sl_series}_nf=$nf
  219.     setlength s_${sl_series}_nf 2
  220. }
  221.  
  222. series_select_all()
  223. {
  224.     ssa_series=$1
  225.     eval all_packages=\"\$s_${ssa_series}_lf\"
  226.     for ssa_p in $all_packages; do
  227.         package_select $ssa_p
  228.     done
  229.     series_stat $ssa_series
  230. }
  231.  
  232. series_deselect_all()
  233. {
  234.     sda_series=$1
  235.     eval all_packages=\"\$s_${sda_series}_lf\"
  236.     for sda_p in $all_packages; do
  237.         package_deselect $sda_p
  238.     done
  239.     series_stat $sda_series
  240. }
  241.  
  242. series_stat()
  243. {
  244.     series=$1
  245.     dus=0
  246.     ns=0
  247.     ls=
  248.     eval ss_all_packages=\"\$s_${series}_lf\"
  249.     for ss_p in $ss_all_packages; do
  250.         eval \$p_${ss_p}_s || continue
  251.         eval newdu=\"\$p_${ss_p}_du\"
  252.         if test -z "$newdu"; then
  253.           echo "unknown disk space usage for package: $ss_p"
  254.           newdu=0
  255.         fi
  256.         ls="$ls $ss_p"
  257.         ns=`expr $ns + 1`
  258.         dus=`expr $dus + $newdu`
  259.     done
  260.     eval s_${series}_dus=\$dus
  261.     setlength s_${series}_dus 6
  262.     eval s_${series}_ns=\$ns
  263.     setlength s_${series}_ns 2
  264.     eval s_${series}_ls=\$ls
  265. }
  266.  
  267. nobin_stat()
  268. {
  269.     dus=0; nf=0; ns=0;
  270.     for ns_series in $S_nobin_la; do
  271.       eval dus=\`expr \$dus + \$s_${ns_series}_dus\`
  272.       eval nf=\` expr \$nf  + \$s_${ns_series}_nf\`
  273.       eval ns=\` expr \$ns  + \$s_${ns_series}_ns\`
  274.     done
  275.     S_nobin_dus=$dus;  setlength S_nobin_dus 6
  276.     S_nobin_nf=$nf;    setlength S_nobin_nf 2
  277.     S_nobin_ns=$ns;    setlength S_nobin_ns 2
  278.     total_stat
  279. }
  280.  
  281. total_stat()
  282. {
  283.     s_total_dus=`expr $s_bin_dus + $S_nobin_dus`; setlength s_total_dus 6
  284.     s_total_nf=`expr $s_bin_nf + $S_nobin_nf`;    setlength s_total_nf 2
  285.     s_total_ns=`expr $s_bin_ns + $S_nobin_ns`;    setlength s_total_du 2
  286. }
  287.  
  288. package_select()   { eval p_${1}_s=true;  }
  289. package_deselect() { eval p_${1}_s=false; }
  290.  
  291. series_list()
  292. {
  293.     sl_series=$1
  294.     cls
  295.     echo "Series \`\`$sl_series'' statistics:"; echo
  296.     echo "                  package name   size selected"
  297.     echo "  --------------------------------------------"
  298.     eval sl_all_p=\"\$s_${sl_series}_lf\"
  299.     for sl_p in $sl_all_p; do
  300.       eval sl_n=\"\$p_${sl_p}_n\"
  301.       eval sl_du=\"\$p_${sl_p}_du\"
  302.       eval sl_s=\"\$p_${sl_p}_s\"
  303.       if $sl_s; then sl_s='[X]'; else sl_s='[ ]'; fi
  304.       setlength sl_n 30
  305.       setlength sl_du 6
  306.       echo "$sl_n ${sl_du}k    $sl_s"
  307.     done
  308.     eval sl_s_dus=\"\$s_${sl_series}_dus\"
  309.     setlength sl_s_dus 6
  310.     echo "  --------------------------------------------"
  311.     echo "                selected size: ${sl_s_dus}k"
  312.     echo
  313.     echo
  314.     readln
  315. }
  316.  
  317. series_init()
  318. {
  319.     $echon "Locating packages... "; allseries_locate; echo "Done."
  320.     $echon "Initializing series... "
  321.     for si_series in $S_nobin_la; do
  322.         series_select_all $si_series
  323.     done
  324.     echo "Done."
  325.     series_deselect_all bin
  326.     test -z "$this_platform" || {
  327.         this_platform_set "$this_platform"
  328.         package_select "$this_platform"
  329.         series_stat bin
  330.     }
  331.     allseries_locate_check
  332. }
  333.  
  334. this_platform_set()
  335. {
  336.     this_platform="$1"
  337.     for tps_p in $s_bin_lf; do
  338.         eval p_${tps_p}_l=optional
  339.     done
  340.     series_deselect_all bin
  341.     if test -z "$this_platform"; then
  342.         this_platform_n=
  343.         this_platform_d=
  344.     else
  345.       package_select ${this_platform}
  346.       series_stat bin
  347.       eval this_platform_n=\$p_${this_platform}_n
  348.       eval this_platform_d=\$p_${this_platform}_d
  349.       eval p_${this_platform}_l=required
  350.     fi
  351.     nobin_stat
  352. }
  353.  
  354. ################################################################
  355. #debugging:
  356. ################################################################
  357. series_dbg()
  358. {
  359.     series=$1
  360.  
  361.     eval echo \""all packages: '\$s_${series}_la'"\"
  362.     eval echo \""default dir:  '\$s_${series}_d'"\"
  363.     eval echo \""selected:     '\$s_${series}_ls'"\"
  364.     eval echo \""found:        '\$s_${series}_lf'"\"
  365.     eval echo \""missing:      '\$s_${series}_mis'"\"
  366.     eval echo \""anz found:    '\$s_${series}_nf'"\"
  367.     eval echo \""anz missing:  '\$s_${series}_nmis'"\"
  368.     eval echo \""anz selected: '\$s_${series}_ns'"\"
  369.     eval echo \""du total:     '\$s_${series}_du'"\"
  370.     eval echo \""du selected:  '\$s_${series}_dus'"\"
  371.     echo help:
  372.     textvar_show s_${series}_h
  373.     echo
  374. }
  375.  
  376. package_dbg()
  377. {
  378.     p=$1
  379.     eval echo \""gefunden: '\$p_${p}_da'"\"
  380.     eval echo \""filename: '\$p_${p}_fn'"\"
  381.     eval echo \""du:       '\$p_${p}_du'"\"
  382.     eval echo \""version:  '\$p_${p}_v'"\"
  383.     eval echo \""selected: '\$p_${p}_s'"\"
  384.     eval echo \""name:     '\$p_${p}_n'"\"
  385.     echo help:
  386.     textvar_show p_${p}_h
  387.     echo
  388. }
  389.  
  390. ################################################################
  391. # utility functions:
  392. ################################################################
  393.  
  394. bad_sh()
  395. {
  396.     /bin/sh -c 'exit 1'
  397.     retval=$?
  398.     if test "$retval" != 1; then
  399.         echo
  400.         echo 'Your /bin/sh is completely broken. A simple program like'
  401.         echo
  402.         echo "                /bin/sh -c 'exit 1'; echo \$?"
  403.         echo
  404.         echo "gives a wrong result."
  405.         echo
  406.         echo 'Your shell is likely to break some scripts of teTeX. Please'
  407.         echo 'update your /bin/sh first and try to install teTeX later.'
  408.         echo 'GNU bash 1.14.5 will do, whereas bash 1.14.3 is known to have'
  409.         echo 'problems.'
  410.         echo
  411.         exit 1
  412.    fi
  413. }
  414.  
  415. warning()
  416. {
  417.     echo "$@"
  418. }
  419.  
  420. cls()
  421. {
  422.     test "$debug" = true || clear
  423. }
  424.  
  425. check_for_binary()
  426. {
  427.     testbin=$1
  428.     case "$testbin" in
  429.       /*) test -x "$testbin" && test -f "$testbin"; return;;
  430.       *)
  431.          OLDIFS=$IFS; IFS=:; eval set $PATH; IFS=$OLDIFS
  432.          for this_dir
  433.          do
  434.              test -x "$this_dir/$testbin" &&
  435.              test -f "$this_dir/$testbin" && return 0
  436.          done
  437.          return 1;;
  438.     esac
  439. }
  440.  
  441. require_binaries()
  442. {
  443.     for this_bin
  444.     do
  445.         check_for_binary $this_bin ||
  446.           fatal "program '$this_bin' not found in PATH"
  447.     done
  448. }
  449.  
  450. man_fix_texmf()
  451. {
  452.     file=$TETEXDIR/man/man1/bibtex.1
  453.     test -f "$file" || return
  454.     man_texmf_old=`grep texmf/bibtex/bst $file 2>/dev/null | sed 's@.*:@@; s@/bibtex/bst@@'`
  455.     test -z "$man_texmf_old" && man_texmf_old=$man_texmf_old_fallback
  456.     man_tetexdir_old=`dirname "$man_texmf_old"`
  457.     test -z "$man_tetexdir_old" && man_tetexdir_old=$man_tetexdir_old_fallback
  458.  
  459.     if test "$opt_savespace_man_rm" = X; then
  460.         rm -f $TETEXDIR/man/man*/*
  461.         rmdir $TETEXDIR/man/man*
  462.     fi 2>/dev/null
  463.  
  464.     if test "$TEXMF" != "$man_texmf_old" ||
  465.        test "$man_tetexdir_old" != "$TETEXDIR"; then
  466.         $echon "Fixing pathnames in the manualpages... "
  467.         for mpage in $TETEXDIR/man/*/*[0-9]; do
  468.           sed s@$man_texmf_old@$TEXMF@g\;s@$man_tetexdir_old@$TETEXDIR@g \
  469.             $mpage > $TMPDIR/man.tmp.$$
  470.           test -s $TMPDIR/man.tmp.$$ && mv $TMPDIR/man.tmp.$$ $mpage
  471.         done
  472.         echo "Done."
  473.     fi
  474.     test "$opt_savespace_man_gzip" = X && gzip $TETEXDIR/man/cat*/*.[1.9]
  475.     touch $TETEXDIR/man/cat*/* 2>/dev/null
  476. }
  477.  
  478. maketex_setopt()
  479. {
  480.     mtsite=$TEXMF/$mt_site_loc
  481.     test -w "$mtsite" || return
  482.     test -w "$TETEXDIR/texmf.cnf" || return
  483.     test "$opt_varfonts" = X || return
  484.  
  485.     ed "$TETEXDIR/texmf.cnf" >$ERRLOG 2>&1 <<eof
  486. /^VARFONTS.*=/
  487. c
  488. VARFONTS    = $opt_varfonts_dir
  489. .
  490. w
  491. q
  492. eof
  493.     show_error
  494.  
  495.     ed "$mtsite" >$ERRLOG 2>&1 <<'eof'
  496. /^: \${MT_FEATURES=/
  497. s/}/:varfonts}/
  498. w
  499. q
  500. eof
  501.     show_error
  502. }
  503.  
  504. texmfcnf_fix_texmf()
  505. {
  506.     test "$TETEXDIR/texmf" = "$TEXMF" && return
  507.     test -w "$TETEXDIR/texmf.cnf" || return
  508.     ed "$TETEXDIR/texmf.cnf" >$ERRLOG 2>&1 <<-eof
  509. /^TEXMF.*=/
  510. c
  511. TEXMF        = $TEXMF
  512. .
  513. w
  514. q
  515. eof
  516.     show_error
  517.     rm -f $TETEXDIR/texmf
  518. }
  519.  
  520. texmfcnf_fix_tetexdir()
  521. {
  522.     test -f $TETEXDIR/texmf.cnf || return
  523.     if test ! -w "$TETEXDIR/texmf.cnf"; then
  524.         warning "Warning: cannot write to file $TETEXDIR/texmf.cnf"
  525.         readln
  526.         return
  527.     fi
  528.     if test $platform_subdir_strip = true; then
  529.         newtexmf='$SELFAUTODIR'
  530.     else
  531.         newtexmf='$SELFAUTOPARENT'
  532.     fi
  533.     ed "$TETEXDIR/texmf.cnf" >$ERRLOG 2>&1 <<-eof
  534. /^TETEXDIR.*=/
  535. c
  536. TETEXDIR           = $newtexmf
  537. .
  538. w
  539. q
  540. eof
  541.     show_error
  542. }
  543.  
  544. # fill a string with blanks:
  545. setlength()
  546. {
  547.     var=$1
  548.     length=$2
  549.     eval value=\"\$$var\"
  550.     l=`expr "$value" : '.*'`
  551.     test $l -lt $length || return
  552.     d=`expr $length - $l`
  553.     OLDIFS=$IFS; IFS=
  554.     substr=`awk 'END {print substr("                                         ", 1, ANZ)}' ANZ=$d </dev/null`
  555.     eval $var='$substr$value'
  556.     IFS=$OLDIFS
  557. }
  558.  
  559. # NEW PLATFORM: add a 'case'
  560. platform_guess()
  561. {
  562.   case `(guess | sed 's@-.*-@-@')` in
  563.     alpha-linux)
  564.       echo alpha_linux;;
  565.     alpha-osf3.*)
  566.       echo alpha_osf32;;
  567.     alpha-osf4.*)
  568.       echo alpha_osf40;;
  569.     c1-bsd)
  570.       echo c1_bsd;;
  571.     c*-bsd)
  572.       echo c2_bsd;;
  573.     hppa-nextstep3)
  574.       echo hppa_nextstep3;;
  575.     hppa1.1-hpux10*)
  576.       echo hppa11_hpux10;;
  577.     hppa1.1-hpux9*)
  578.       echo hppa11_hpux9;;
  579.     *86-freebsd2.*)
  580.       echo i386_freebsd215;;
  581.     *86-linux)
  582.       echo i386_linux;;
  583.     *86-linuxaout)
  584.       echo i386_linuxaout;;
  585.     *86-nextstep3)
  586.       echo i386_nextstep3;;
  587.     *86-solaris2.*)
  588.       echo i386_solaris25;;
  589.     m68k-hpux*)
  590.       echo m68k_hpux9;;
  591.     m68k-nextstep3)
  592.       echo m68k_nextstep3;;
  593.     mips-irix5.*)
  594.       echo mips_irix53;;
  595.     mips-irix6.*)
  596.       echo mips_irix62;;
  597.     mips-ultrix4*)
  598.       echo mips_ultrix43;;
  599.     rs6000-aix4.1*)
  600.       echo rs6000_aix414;;
  601.     rs6000-aix4.2*)
  602.       echo rs6000_aix420;;
  603.     sparc-nextstep3)
  604.       echo sparc_nextstep3;;
  605.     sparc-solaris2.4)
  606.       echo sparc_solaris24;;
  607.     sparc-solaris2.[56789])
  608.       echo sparc_solaris25;;
  609.     sparc-sunos4*)
  610.       echo sparc_sunos413;;
  611.    esac
  612. }
  613.  
  614. unset_vars()
  615. {
  616.     for var in $envvars; do
  617.         unset $var
  618.     done
  619. }
  620.  
  621. mkdirhier()
  622. {
  623.     case $1 in
  624.         /*) cd /;;
  625.     esac
  626.     OLDIFS=$IFS; IFS=/; eval set $1; IFS=$OLDIFS
  627.     for i
  628.     do
  629.         test -d $i || mkdir $i || break
  630.         cd $i || break
  631.     done
  632. }
  633.  
  634. # [t]ry again, [r]econfigure, [a] abort
  635. tra()
  636. {
  637.     msg=$1
  638.     cls
  639.     echo "Oops, I am in trouble here! The error was:"
  640.     echo ">> $msg <<"
  641.     echo
  642.     case `getopt TRQ 'What shall we do now: t: try again, r: reconfigure, q: quit'` in
  643.         T) return;;
  644.         R) menu_main;;
  645.         Q) exit 1;;
  646.     esac
  647. }
  648.  
  649. warn()
  650. {
  651.     msg=$1
  652.     cls
  653.     echo "Oops, I am in trouble here! The problem was:"
  654.     echo ">> $msg <<"
  655.     echo
  656.     case `getopt CQ 'What shall we do now: c: ccontinue, q: quit'` in
  657.         C) return;;
  658.         Q) exit 1;;
  659.     esac
  660. }
  661.  
  662. fatal()
  663. {
  664.     echo; echo
  665.     echo "ERROR: $@."
  666.     echo "This was a fatal error, my friend. Installation aborted."
  667.     exit 1
  668. }
  669.  
  670. show_error()
  671. {
  672.     test $? = 0 && return
  673.     cls
  674.     echo 'WARNING: the last command returned an error.'
  675.     if yesno 'Do you want to see the errorlog'; then
  676.         cat $ERRLOG | eval $PAGER
  677.         readln
  678.     fi
  679.     cls
  680. }
  681.  
  682. nonemptydir()
  683. {
  684.   test -d "$1" && test -n "`ls \"$1\"`"
  685.   return $?
  686. }
  687.  
  688. # this is a hard job... trying to anticipiate trouble...
  689. sanity_checks()
  690. {
  691.     while nonemptydir $TETEXDIR; do
  692.         tra "non-empty directory TETEXDIR=$TETEXDIR already exists"
  693.     done
  694.     while nonemptydir $TEXMF; do
  695.         tra "non-empty directory TEXMF=$TEXMF already exists"
  696.     done
  697.     while test "$opt_symlink" = X &&
  698.           test ! -z "$opt_symlinks_bin" &&
  699.           test -d "$opt_symlinks_bin" &&
  700.           test ! -w "$opt_symlinks_bin"; do
  701.         tra "cannot write to directory $opt_symlinks_bin"
  702.     done
  703.     while test "$opt_symlink" = X &&
  704.           test ! -z "$opt_symlinks_man" &&
  705.           test -d "$opt_symlinks_man" &&
  706.           test ! -w "$opt_symlinks_man"; do
  707.         tra "cannot write to directory $opt_symlinks_man"
  708.     done
  709.     while test "$opt_symlink" = X &&
  710.           test ! -z "$opt_symlinks_info" &&
  711.           test -d "$opt_symlinks_info" &&
  712.           test ! -w "$opt_symlinks_info"; do
  713.         tra "cannot write to directory $opt_symlinks_info"
  714.     done
  715.     while test ! -z "$opt_varfonts_dir" &&
  716.           test -d "$opt_varfonts_dir" &&
  717.           test ! -w "$opt_varfonts_dir"; do
  718.         tra "cannot write to directory $opt_varfonts_dir"
  719.     done
  720. }
  721.  
  722. prepare_directories()
  723. {
  724.     alldirs="$TMPDIR $TETEXDIR $TEXMF
  725.              $opt_symlinks_bin $opt_symlinks_info"
  726.     test -z "$opt_symlinks_man" ||
  727.              alldirs="$alldirs $opt_symlinks_man/man1 $opt_symlinks_man/man5 $opt_symlinks_man/cat1 $opt_symlinks_man/cat5"
  728.     test -z "$opt_varfonts_dir" ||
  729.              alldirs="$alldirs $opt_varfonts_dir/pk $opt_varfonts_dir/tfm"
  730.     for dir in $alldirs; do
  731.         while test ! -d $dir || test ! -w $dir; do
  732.           mkdirhier $dir
  733.           test -d $dir || { tra "could not make directory '$dir'"; continue; }
  734.           test -w $dir || { tra "cannot write to directory '$dir'"; continue; }
  735.         done
  736.     done
  737.     chmod 700 $TMPDIR || fatal "command 'chmod 700 $TMPDIR' failed"
  738.     test -z "$opt_varfonts_dir" ||
  739.         chmod 1777 $opt_varfonts_dir/pk $opt_varfonts_dir/tfm ||
  740.         fatal "command 'chmod 1777 $opt_varfonts_dir/pk $opt_varfonts_dir/tfm' failed"
  741.     ln -s $TETEXDIR $TMPDIR/$tetex_prefix
  742.     test -d $TETEXDIR/texmf || ln -s $TEXMF $TETEXDIR/texmf
  743.     platform_subdir_strip=false
  744.     if test $s_bin_ns = 1; then
  745.         cls
  746.         textvar_show screen_6
  747.         echo
  748.         if yesno 'Do you want to omit the extra subdirectory'; then
  749.           platform_subdir_strip=true
  750.           mkdir $TETEXDIR/bin
  751.           for pd_p in $s_bin_lf; do
  752.             if eval \$p_${pd_p}_s; then
  753.               eval platform_subdir_strip_d=\$p_${pd_p}_d
  754.               break
  755.             fi
  756.           done
  757.           ln -s . $TETEXDIR/bin/$platform_subdir_strip_d
  758.         fi
  759.     fi
  760.     mkdirhier $TEXMF/lists
  761. }
  762.  
  763. opt_do_symlinks()
  764. {
  765.     test "$opt_symlinks" = X || return
  766.     $echon 'Creating symbolic links... '
  767.     if test -d $TETEXDIR/man/man1 && test -w $opt_symlinks_man/man1; then
  768.         cd $opt_symlinks_man/man1
  769.         rm -f `ls $TETEXDIR/man/man1`; ln -s $TETEXDIR/man/man1/* .
  770.     fi
  771.     if test -d $TETEXDIR/man/man5 && test -w $opt_symlinks_man/man5; then
  772.         cd $opt_symlinks_man/man5
  773.         rm -f `ls $TETEXDIR/man/man5`; ln -s $TETEXDIR/man/man5/* .
  774.     fi
  775.     if test -d $TETEXDIR/man/cat1 && test -w $opt_symlinks_man/cat1; then
  776.         cd $opt_symlinks_man/cat1
  777.         rm -f `ls $TETEXDIR/man/cat1`; ln -s $TETEXDIR/man/cat1/* .
  778.     fi
  779.     if test -d $TETEXDIR/man/cat5 && test -w $opt_symlinks_man/cat5; then
  780.         cd $opt_symlinks_man/cat5
  781.         rm -f `ls $TETEXDIR/man/cat5`; ln -s $TETEXDIR/man/cat5/* .
  782.     fi
  783.     if test -d $TETEXDIR/info && test -w "$opt_symlinks_info"; then
  784.         cd $opt_symlinks_info
  785.         rm -f `ls $TETEXDIR/info`; ln -s $TETEXDIR/info/*info* .
  786.     fi
  787.     if test "$opt_symlinks" = X; then
  788.         if test ! -z "$this_platform_bin"; then
  789.           if test -w "$opt_symlinks_bin"; then
  790.             cd $opt_symlinks_bin
  791.             rm -f `ls $this_platform_bin`; ln -s $this_platform_bin/* .
  792.             echo 'Done.'
  793.           fi
  794.         else
  795.           cls
  796.           echo '                              WARNING!                              '
  797.           echo
  798.           echo 'teTeX binaries for this platform are not installed. If you install'
  799.           echo 'them later, you can create symbolic links to $opt_symlinks_bin'
  800.           echo 'with a command like:'
  801.           echo
  802.           echo "  ln -s $TETEXDIR/bin/PLATFORM/* $opt_symlinks_bin"
  803.           echo
  804.           echo 'PLATFORM needs to be replaced by the name of the subdirectory that'
  805.           echo 'contains the binaries for this platform.'
  806.           echo
  807.           readln
  808.         fi
  809.     fi
  810. }
  811.  
  812. locate_binaties()
  813. {
  814.     this_platform_bin=
  815.     lb_dir=$TETEXDIR/bin/$this_platform_d
  816.     test -x "$lb_dir/initex" && this_platform_bin=$lb_dir
  817.     test -x "$TETEXDIR/bin/initex" && this_platform_bin=$TETEXDIR/bin
  818.     test ! -d $lb_dir && rm -f $lb_dir 2>/dev/null
  819.     test -z "$this_platform_bin" && return
  820.     PATH="${this_platform_bin}:${PATH}"; export PATH
  821. }
  822.  
  823. untgz()
  824. {
  825.     cd $TMPDIR
  826.     for u_series in $S_all_la; do
  827.         eval selected=\$s_${u_series}_ls
  828.         for u_package in $selected; do
  829.           eval file=\$p_${u_package}_fn
  830.           list=`basename $file| sed 's@.tar.gz$@@'`
  831.           package_showinfo $u_package
  832.           if $checkit; then
  833.             echo
  834.             $echon "Testing integrity of file $file... "
  835.             gzip --test $file
  836.             if test $? = 0; then
  837.               echo "Ok."
  838.             else
  839.               warn "Integrity of file $file is void."
  840.               continue
  841.             fi
  842.           fi
  843.           $echon "Extracting package $p_current_n... "
  844.           gzip -dc < $file | tar xvf - >$ERRLOG 2>&1
  845.           if test $? = 0; then
  846.             echo 'Done.'
  847.             sed /$tetex_prefix/'!d; s@[^/]*'$tetex_prefix'/*@@; s/[,/]*[     ].*//; /^$/d' $ERRLOG > $TEXMF/lists/$list
  848.             if test -s $TEXMF/lists/$list; then
  849.               chmod 755 $TEXMF/lists/$list
  850.             else
  851.               rm -f $TEXMF/lists/$list
  852.             fi
  853.           else
  854.             show_error
  855.             continue
  856.           fi
  857.         done
  858.     done
  859.     rmdir $TEXMF/lists 2>/dev/null
  860. }
  861.  
  862. prepare_errorlog()
  863. {
  864.     touch "$ERRLOG"
  865.     test -w "$ERRLOG" || fatal "cannot write to file '$ERRLOG'"
  866. }
  867.  
  868. locate_binaries()
  869. {
  870.     require_binaries touch sed awk gzip ln rm ls tar tr mkdir cat pwd
  871. }
  872.  
  873. init()
  874. {
  875.     cd $here
  876.     # for fast installation: set CHECKIT_OVERRIDE to false in your environment.
  877.     checkit=${CHECKIT_OVERRIDE-true}
  878.     bad_sh
  879.     prepare_errorlog
  880.     locate_binaries
  881.     find_echo
  882.     unset_vars
  883.     this_platform=`platform_guess`
  884.     series_init
  885.     nobin_stat    
  886. }
  887.  
  888. fixperm()
  889. {
  890.     $echon 'Fixing permissions... '
  891.     cd $TEXMF
  892.     files=`find . -perm -2 \( -type d -o -type f \) -print`
  893.     test -z "$files" || chmod go-w $files
  894.     cd $TETEXDIR
  895.     files=`find . -perm -2 \( -type d -o -type f \) -print`
  896.     test -z "$files" || { chmod go-w $files 2>$ERRLOG; show_error; }
  897.     dirs=`find $TEXMF/fonts/tfm $TEXMF/fonts/pk $TEXMF/fonts/source/jknappen/* -type d -print 2>$ERRLOG`
  898.     test -z "$dirs" || { chmod 1777 $dirs 2>$ERRLOG; show_error; }
  899.     test -f $TEXMF/ls-R && { chmod 666 $TEXMF/ls-R 2>$ERRLOG; show_error; }
  900.     echo 'Done.'
  901. }
  902.  
  903. install_now()
  904. {
  905.     umask 022
  906.     cls; sanity_checks
  907.     cls; prepare_directories
  908.     umask 0
  909.     cls; untgz
  910.     { $platform_subdir_strip && rm -f $TETEXDIR/bin/$platform_subdir_strip_d; } >/dev/null 2>&1
  911.     cls; fixperm
  912.     umask 022
  913.     locate_binaties
  914.     man_fix_texmf
  915.     opt_do_symlinks
  916.     texmfcnf_fix_texmf
  917.     texmfcnf_fix_tetexdir
  918.     update
  919.     init_tetex
  920.     cls
  921.     if test ! -z "$this_platform_bin"; then
  922.         if test -z "$opt_symlinks_bin"; then
  923.           bin=$this_platform_bin
  924.         else
  925.           bin=$opt_symlinks_bin
  926.         fi
  927.  
  928.         cat <<eof
  929. Welcome to the teTeX TeX system!
  930.  
  931. Some notes on how to proceed:
  932.   - set up your PATH to include the directory containing the just
  933.     installed binaries in $bin.
  934.     Similarly, MANPATH and INFOPATH to include the relevant newly
  935.     installed subdirectories.
  936.   - run \`\`texconfig confall'' to check your setup
  937.   - call texconfig to set up a few things: hyphenation, paper size for
  938.     printing, printer mode (implies resolution), font generation, etc.
  939.   - you need to run texhash after you install new files in
  940.       $TEXMF
  941.   - There are two mailing list for discussion and announces about the
  942.     teTeX.  See the FAQ (\$TEXMF/doc/tetex/teTeX-FAQ) for more about this.
  943.   - See CTAN sites (systems/unix/teTeX/updates) for updates and corrections
  944.     to the system. For information about CTAN, see \$TEXMF/doc/help/ctan.
  945. eof
  946.     else
  947.     cat <<eof
  948. Welcome to the teTeX TeX system!
  949.  
  950. Some notes on how to proceed:
  951.   - binaries for this platform are not installed. If you install the
  952.     missing binaries later, make sure to run
  953.       texconfig init
  954.   - run \`\`texconfig confall'' to check your setup
  955.   - call texconfig to set up a few things: hyphenation, paper size for
  956.     printing, printer mode (implies resolution), font generation, etc.
  957.   - you need to run texhash after you install new files in
  958.       $TEXMF
  959.   - There are two mailing list for discussion and announces about the
  960.     teTeX.  See the FAQ (\$TEXMF/doc/tetex/teTeX-FAQ) for more about this.
  961.   - See CTAN sites (systems/unix/teTeX/updates) for updates and corrections
  962.     to the system. For information about CTAN, see \$TEXMF/doc/help/ctan.
  963. eof
  964.     fi
  965.  
  966.     exit
  967. }
  968.  
  969. tetex_dump()
  970. {
  971.     $echon "Building filename database... "
  972.     echo '% This is file ls-R. Maintained by texhash and append_db.' > $TEXMF/ls-R
  973.     (cd $TEXMF; \ls -LAR ./ /dev/null | grep -v '^\.*$' | sed 's@\.//@./@' ) 2>$ERRLOG >> $TEXMF/ls-R
  974.     show_error
  975.     chmod 666 $TEXMF/ls-R
  976.     echo 'Done.'
  977.  
  978.     if test ! -z "$this_platform_bin"; then
  979.         test "$debug" = true && { set; sleep 5; }
  980.         $echon 'Creating base/fmt/mem files... '
  981.         eval TEXMF=$TEXMF $this_platform_bin/texconfig init >$ERRLOG 2>&1
  982.         show_error
  983.         echo 'Done.'
  984.     fi
  985.     $echon "Setting permissions for fonts tree... "
  986.     if test "x$opt_varfonts" = xX; then
  987.       texconfig font ro
  988.     else
  989.       texconfig font rw
  990.     fi >/dev/null 2>&1
  991.     echo Done.
  992. }
  993.  
  994. init_tetex()
  995. {
  996.     tetex_dump
  997.     maketex_setopt
  998. }
  999.  
  1000. update()
  1001. {
  1002.     test "$opt_update" = X || return
  1003.     echo "locating files for update option... "
  1004.     update_get_texmf
  1005.     if test -d "$opt_update_oldtexmf"; then
  1006.         echo "  old TEXMF: $opt_update_oldtexmf"
  1007.     else
  1008.         echo "  old TEXMF: not found"
  1009.     fi
  1010.     update_get_xdvi_ad
  1011.     if test -f "$opt_update_xdviad"; then
  1012.         echo "  old app-defaults file for xdvi: $opt_update_xdviad"
  1013.         rm -f $TEXMF/xdvi/XDvi
  1014.         cp "$opt_update_xdviad" $TEXMF/xdvi/XDvi
  1015.     else
  1016.         echo "  old app-defaults file for xdvi: not found"
  1017.     fi
  1018.     if test -d "$opt_update_oldtexmf/dvips"; then
  1019.         echo "  old dvips config files: $opt_update_oldtexmf/dvips"
  1020.         files=`(cd "$opt_update_oldtexmf/dvips"; find . -name config.\* -print)`
  1021.         (cd $TEXMF/dvips && rm -f `echo "$files" | sed 's@.*/@@'`)
  1022.         (cd "$opt_update_oldtexmf/dvips"; cp $files $TEXMF/dvips)
  1023.     else
  1024.         echo "  old dvips config files: not found"
  1025.     fi
  1026. }
  1027.  
  1028. update_get_texmf()
  1029. {
  1030.     opt_update_oldtexmf=`sed -n '/^TEXMF[     ]*=/!d; s/.*=[     ]*//; s/[     ].*//; s@\$TETEXDIR@'$opt_update_olddir'@; p' $opt_update_olddir/texmf.cnf 2>/dev/null`
  1031.     test ! -d "$opt_update_oldtexmf" && opt_update_oldtexmf="$opt_update_olddir/texmf"
  1032. }
  1033.  
  1034. update_get_xdvi_ad()
  1035. {
  1036.     opt_update_xdviad=`find $opt_update_olddir/xdvi* $opt_update_oldtexmf \( -name XDvi -o -name XDvi.ad \) -print | sed q 2>/dev/null`
  1037.     test ! -f "$opt_update_xdviad" && opt_update_xdviad=
  1038. }
  1039.  
  1040. ################################################################
  1041. # menus:
  1042. ################################################################
  1043. menu_main()
  1044. {
  1045.     while true; do
  1046.         cls
  1047.         opt_savespace_man=X
  1048.         test "$opt_savespace_man_rm" = X || test "$opt_savespace_man_gzip" = X ||
  1049.           opt_savespace_man=' '
  1050.         textvar_show screen_1; echo
  1051.         case `getopt SDOIHQ 'Enter command'` in
  1052.           S) menu_series;;
  1053.           D) menu_directories;;
  1054.           O) menu_options;;
  1055.           I) install_now;;
  1056.           H) help help_1;;
  1057.           Q) exit_on_confirm;;
  1058.         esac
  1059.     done
  1060. }
  1061.  
  1062. menu_directories()
  1063. {
  1064.     while true; do
  1065.         cls
  1066.         textvar_show screen_2; echo
  1067.         case `getopt 12RQ 'Enter command'` in
  1068.           1) gets TETEXDIR; TETEXDIR=`dirname "$TETEXDIR/x" | sed 's@//*@/@g'`
  1069.              TEXMF=`echo $TETEXDIR/texmf | sed 's@//*@/@g'`;;
  1070.           2) gets TEXMF; TEXMF=`dirname "$TEXMF/x" | sed 's@//*@/@g'`;;
  1071.           R) return;;
  1072.           Q) exit_on_confirm;;
  1073.         esac
  1074.     done
  1075. }
  1076.  
  1077. menu_options()
  1078. {
  1079.     while true; do
  1080.         cls
  1081.         textvar_show screen_3; echo
  1082.         case `getopt ASMRQ 'Enter command'` in
  1083.           A) toggle opt_varfonts
  1084.              if test "$opt_varfonts" = X; then
  1085.                cls; textvar_show screen_3; echo
  1086.                opt_varfonts_dir=$opt_varfonts_dir_last
  1087.                test -z "$opt_varfonts_dir" && opt_varfonts_dir=/var/tmp/texfonts
  1088.                gets opt_varfonts_dir 'alternate directory'
  1089.              else
  1090.                opt_varfonts_dir_last=$opt_varfonts_dir
  1091.                opt_varfonts_dir=
  1092.              fi
  1093.              ;;
  1094.           S) toggle opt_symlinks
  1095.              if test "$opt_symlinks" = X; then
  1096.                cls; textvar_show screen_3; echo
  1097.                opt_symlinks_bin=$opt_symlinks_bin_last
  1098.                test -z "$opt_symlinks_bin" && opt_symlinks_bin=/usr/local/bin
  1099.                gets opt_symlinks_bin 'binary directory'
  1100.                opt_symlinks_man=$opt_symlinks_man_last
  1101.                test -z "$opt_symlinks_man" && opt_symlinks_man=`dirname $opt_symlinks_bin`/man
  1102.                gets opt_symlinks_man 'man directory   '
  1103.                opt_symlinks_info=$opt_symlinks_info_last
  1104.                test -z "$opt_symlinks_info" && opt_symlinks_info=`dirname $opt_symlinks_bin`/info
  1105.                gets opt_symlinks_info 'info directory  '
  1106.              else
  1107.                opt_symlinks_bin_last=$opt_symlinks_bin
  1108.                opt_symlinks_man_last=$opt_symlinks_man
  1109.                opt_symlinks_info_last=$opt_symlinks_info
  1110.                opt_symlinks_bin=; opt_symlinks_man=; opt_symlinks_info=
  1111.              fi
  1112.              ;;
  1113.           M) cls; textvar_show screen_3; echo
  1114.              opt_savespace_man=' '
  1115.              opt_savespace_man_rm=' '
  1116.              opt_savespace_man_gzip=' '
  1117.              yesno 'remove nroff sources' &&
  1118.                  { opt_savespace_man_rm=X; opt_savespace_man=X; }
  1119.              yesno 'compress preprocessed manpages with gzip' &&
  1120.                  { opt_savespace_man_gzip=X; opt_savespace_man=X; }
  1121.              ;;
  1122.           C) toggle opt_update
  1123.              if test "$opt_update" = X; then
  1124.                cls; textvar_show screen_3; echo
  1125.                opt_update_olddir=$opt_update_olddir_last
  1126.                test -z "$opt_update_olddir" && test -f /usr/local/tex/texmf.cnf &&
  1127.                  opt_update_olddir=/usr/local/tex
  1128.                gets opt_update_olddir 'old TETEXDIR'
  1129.                test -f $opt_update_olddir/texmf.cnf && continue
  1130.                echo "File $opt_update_olddir/texmf.cnf does not exist."
  1131.                readln
  1132.                opt_update=' '
  1133.                opt_update_olddir=
  1134.              else
  1135.                opt_update_olddir_last=$opt_update_olddir
  1136.                opt_update_olddir=
  1137.              fi
  1138.              ;;
  1139.           R) return;;
  1140.           Q) exit_on_confirm;;
  1141.         esac
  1142.     done
  1143. }
  1144.  
  1145. menu_series()
  1146. {
  1147.     while true; do
  1148.         cls
  1149.         textvar_show screen_4; echo
  1150.         menu_series_ans=`getopt PBGFDRQ 'Enter command'`
  1151.         case "$menu_series_ans" in
  1152.           P) series=bin;;
  1153.           B) series=base;;
  1154.           G) series=goodies;;
  1155.           F) series=fonts;;
  1156.           D) series=doc;;
  1157.         esac
  1158.         case "$menu_series_ans" in
  1159.           [PBGFD])
  1160.              cls; textvar_show screen_4;
  1161.              textvar_show s_${series}_h; echo
  1162.              case `getopt ANSLC "install series $series ([A]ll, [N]o, [S]elect, [L]ist, [C]ancel)"` in
  1163.                A) series_select_all $series; nobin_stat;;
  1164.                N) series_deselect_all $series; nobin_stat;;
  1165.                S) series_usersetup $series; nobin_stat;;
  1166.                L) series_list $series;;
  1167.                C) : ;;
  1168.              esac;;
  1169.           R) return;;
  1170.           Q) exit_on_confirm;;
  1171.         esac
  1172.     done
  1173. }
  1174.  
  1175. package_showinfo()
  1176. {
  1177.     p=$1
  1178.     cls
  1179.     eval p_current_du=\$p_${p}_du
  1180.     eval p_current_n=\$p_${p}_n
  1181.     eval p_current_l=\$p_${p}_l
  1182.     eval p_current_v=\$p_${p}_v
  1183.     echo "Package:          $p_current_n"
  1184.     echo "Series:           $series"
  1185.     if [ ! -z "$p_current_v" ] ; then
  1186.       echo "Version:          $p_current_v"
  1187.     fi
  1188.     echo "Status:           $p_current_l"
  1189.     echo "Disk space:       $p_current_du"
  1190.     textvar_show p_${p}_h
  1191. }
  1192.  
  1193. series_usersetup()
  1194. {
  1195.     su_series=$1
  1196.     eval all_packages=\"\$s_${su_series}_lf\"
  1197.     for p in $all_packages; do
  1198.         package_showinfo $p
  1199.         echo
  1200.         p_current_s=false
  1201.         yesno "install package $p_current_n" && p_current_s=true
  1202.         eval p_${p}_s=$p_current_s
  1203.     done
  1204.     series_stat $su_series
  1205. }
  1206.  
  1207. exit_on_confirm()
  1208. {
  1209.     cls
  1210.     yesno 'Really quit' && exit
  1211. }
  1212.  
  1213. ################################################################
  1214. # global variables
  1215. ################################################################
  1216. here=`pwd`
  1217. VERSION=0.4
  1218. # prefix in the archives. DO NOT CHANGE THE FOLLOWING LINE!!
  1219. tetex_prefix=teTeX
  1220. TETEXDIR=/usr/local/$tetex_prefix
  1221. TEXMF=$TETEXDIR/texmf
  1222. man_texmf_old_fallback=$TEXMF
  1223. man_tetexdir_old_fallback=$TETEXDIR
  1224. TMPDIR=${TMP-/tmp}/inst.tmp.$$
  1225. trap 'cd /; rm -rf "$TMPDIR"; rm -f "$TEXMF" 2>/dev/null; trap 0; exit 0' 0 1 2 15
  1226. while test -d $TMPDIR; do
  1227.   tra "temporal directory $TMPDIR already exists"
  1228. done
  1229. mkdirhier $TMPDIR
  1230. ERRLOG=${TMPDIR}/inst.errlog.$$
  1231. : ${PAGER=more}
  1232. mt_site_loc=maketex/maketex.site
  1233.  
  1234. envvars='
  1235. BIBINPUTS BSTINPUTS DVIPSHEADERS GFFONTS GLYPHFONTS MFBASES MFINPUTS
  1236. MFPOOL PKFONTS TEXCONFIG TEXFONTS TEXFORMATS TEXINPUTS TEXMFCNF TEXPICTS
  1237. TEXPKS TEXPOOL TFMFONTS VFFONTS DVIPSFONTS XDVIVFS XDVIFONTS DVILJFONTS
  1238. '
  1239.  
  1240. opt_varfonts=' '
  1241. opt_varfonts_dir=
  1242. opt_varfonts_dir_last=
  1243. opt_symlinks=' '
  1244. opt_symlinks_bin=
  1245. opt_symlinks_man=
  1246. opt_symlinks_info=
  1247. opt_symlinks_bin_last=
  1248. opt_symlinks_man_last=
  1249. opt_symlinks_info_last=
  1250. opt_savespace_man=' '
  1251. opt_savespace_man_rm=' '
  1252. opt_savespace_man_gzip=' '
  1253. opt_update=' '
  1254. opt_update_olddir=
  1255. opt_update_olddir_last=
  1256.  
  1257. this_platform=
  1258.  
  1259. S_nobin_la='
  1260.   base
  1261.   goodies
  1262.   fonts
  1263.   doc
  1264. '  
  1265.  
  1266. S_all_la="
  1267.   $S_nobin_la
  1268.   bin
  1269. "
  1270.  
  1271. s_base_la='
  1272.   tetex_base
  1273.   latex_base
  1274. '
  1275.  
  1276. # NEW PLATFORM: add entry in s_bin_la variable.
  1277. s_bin_la='
  1278.   alpha_linux
  1279.   alpha_osf32
  1280.   alpha_osf40
  1281.   c1_bsd
  1282.   c2_bsd
  1283.   hppa_nextstep3
  1284.   hppa11_hpux10
  1285.   hppa11_hpux9
  1286.   i386_freebsd215
  1287.   i386_linux
  1288.   i386_linuxaout
  1289.   i386_nextstep3
  1290.   i386_solaris25
  1291.   m68k_hpux9
  1292.   m68k_nextstep3
  1293.   mab_nextstep3
  1294.   mips_irix53
  1295.   mips_irix62
  1296.   mips_ultrix43
  1297.   rs6000_aix414
  1298.   rs6000_aix420
  1299.   sparc_nextstep3
  1300.   sparc_solaris24
  1301.   sparc_solaris25
  1302.   sparc_sunos413
  1303. '
  1304.  
  1305. s_doc_la='
  1306.   ams_doc
  1307.   bibtex_doc
  1308.   eplain_doc
  1309.   fonts_doc
  1310.   general_doc
  1311.   generic_doc
  1312.   latex_doc
  1313.   makeindex_doc
  1314.   metapost_doc
  1315.   programs_doc
  1316. '
  1317.  
  1318. s_fonts_la='
  1319.   ams_fonts
  1320.   dc_fonts
  1321.   misc_fonts
  1322.   postscript_fonts
  1323.   sauter_fonts
  1324. '
  1325.  
  1326. s_goodies_la='
  1327.   amstex
  1328.   bibtex
  1329.   eplain
  1330.   latex_extra
  1331.   metapost
  1332.   pictex
  1333.   pstricks
  1334.   texdraw
  1335.   xypic
  1336. '
  1337.  
  1338. s_base_n=base
  1339. s_bin_n=binaries
  1340. s_doc_n=documentation
  1341. s_fonts_n=fonts
  1342. s_goodies_n=goodies
  1343.  
  1344. s_base_d=base
  1345. s_bin_d=binaries
  1346. s_doc_d=doc
  1347. s_fonts_d=fonts
  1348. s_goodies_d=goodies
  1349.  
  1350. s_base_h='
  1351. This series contains the most basic packages that are needed for the
  1352. basic functionality of teTeX and a small LaTeX system.
  1353. '
  1354.  
  1355. s_bin_h='
  1356. This series contains the binaries for teTeX. There is one binary package
  1357. for each supported platform containing all teTeX binaries for that
  1358. platform.
  1359. '
  1360.  
  1361. s_doc_h='
  1362. This series contains a lot of documentation about teTeX and the packages
  1363. it contains. The whole series contains over 130 dvi files plus FAQs
  1364. and some other documentation.
  1365. '
  1366.  
  1367. s_fonts_h='
  1368. This series contains font packages: DC, oldgerman, sauter, bbold, bbm,
  1369. stmary, pandora, wasy, AMS, concrete and support for PostScript fonts
  1370. from Bitstream and Adobe.
  1371. '
  1372.  
  1373. s_goodies_h='
  1374. This series contains some additional packages: AMSTeX, BibTeX, eplain,
  1375. LaTeX-extra, METAPOST, PiCTeX, PStricks, TeXdraw and XYpic.
  1376. '
  1377.  
  1378. #############################################################################
  1379. # packages:
  1380. #############################################################################
  1381.  
  1382.  
  1383. p_latex_base_l=required
  1384. p_tetex_base_l=required
  1385.  
  1386. p_ams_doc_l=recommended
  1387. p_bibtex_doc_l=optional
  1388. p_eplain_doc_l=optional
  1389. p_fonts_doc_l=optional
  1390. p_general_doc_l=recommended
  1391. p_generic_doc_l=optional
  1392. p_latex_doc_l=recommended
  1393. p_makeindex_doc_l=optional
  1394. p_metapost_doc_l=optional
  1395. p_programs_doc_l=recommended
  1396.  
  1397. p_ams_fonts_l=recommended
  1398. p_dc_fonts_l=recommended
  1399. p_misc_fonts_l=optional
  1400. p_postscript_fonts_l=optional
  1401. p_sauter_fonts_l=optional
  1402.  
  1403. p_amstex_l=optional
  1404. p_bibtex_l=recommended
  1405. p_eplain_l=optional
  1406. p_latex_extra_l=recommended
  1407. p_metapost_l=optional
  1408. p_pictex_l=optional
  1409. p_pstricks_l=optional
  1410. p_texdraw_l=optional
  1411. p_xypic_l=optional
  1412.  
  1413. p_latex_base_d=latex-base
  1414. p_latex_base_du=1420
  1415. p_latex_base_n='LaTeX base'
  1416. p_latex_base_v='<1996/06/01>'
  1417. p_latex_base_h='
  1418. This package contains a minimal set of macros to use the LaTeX format.
  1419. '
  1420.  
  1421. p_tetex_base_d=tetex-base
  1422. p_tetex_base_du=5080
  1423. p_tetex_base_n='teTeX base'
  1424. p_tetex_base_h='
  1425. This package contains the most basic input files for teTeX: runtime
  1426. configuration files, hyphenation tables, manpages and the computer
  1427. modern fonts.
  1428. '
  1429.  
  1430. #############################################################################
  1431. # The supported binaries. Add new platforms to the s_bin_la list and create
  1432. # a p_PLATFORM st structure with the following variables:
  1433. #       _d: the directory name below bin for this platform
  1434. #      _du: disk usage
  1435. #       _n: name of the package
  1436. #       -h: help text
  1437. #############################################################################
  1438.  
  1439. # NEW PLATFORM: add p_*_{l,d,du,n,h} variables.
  1440. p_alpha_linux_l='optional'
  1441. p_alpha_linux_d=alpha-linux
  1442. p_alpha_linux_du=13940
  1443. p_alpha_linux_n='DEC Alpha/Linux'
  1444. p_alpha_linux_h='
  1445. This package contains all binaries for DEC Alpha/Linux platforms.
  1446. '
  1447.  
  1448. p_alpha_osf32_l='optional'
  1449. p_alpha_osf32_d=alpha-osf3.2
  1450. p_alpha_osf32_du=6840
  1451. p_alpha_osf32_n='DEC Alpha/Digital Unix 3.2'
  1452. p_alpha_osf32_h='
  1453. This package contains all binaries for DEC Alpha/Digital Unix 3.2 platforms.
  1454. '
  1455.  
  1456. p_alpha_osf40_l=optional
  1457. p_alpha_osf40_d=alpha-osf4.0
  1458. p_alpha_osf40_du=6840
  1459. p_alpha_osf40_n='DEC Alpha/Digital Unix 4.0'
  1460. p_alpha_osf40_h='
  1461. This package contains all binaries for DEC Alpha/Digital Unix 4.0 platforms.
  1462. '
  1463.  
  1464. p_c1_bsd_l='optional'
  1465. p_c1_bsd_d=c1-bsd
  1466. p_c1_bsd_du=12310
  1467. p_c1_bsd_n='Convex C-110'
  1468. p_c1_bsd_h='
  1469. This package contains all binaries for Convex C-110 platforms.
  1470. '
  1471.  
  1472. p_c2_bsd_l='optional'
  1473. p_c2_bsd_d=c2-bsd
  1474. p_c2_bsd_du=12250
  1475. p_c2_bsd_n='Convex C-210'
  1476. p_c2_bsd_h='
  1477. This package contains all binaries for Convex C-210 platforms.
  1478. '
  1479.  
  1480. p_hppa_nextstep3_l=optional
  1481. p_hppa_nextstep3_d=hppa-nextstep3
  1482. p_hppa_nextstep3_du=6307
  1483. p_hppa_nextstep3_n='HPPA/NEXTSTEP 3'
  1484. p_hppa_nextstep3_h='
  1485. This package contains all binaries for HPPA/NEXTSTEP 3 platforms.
  1486. '
  1487.  
  1488. p_hppa11_hpux9_l=optional
  1489. p_hppa11_hpux9_d=hppa1.1-hpux9
  1490. p_hppa11_hpux9_du=6260
  1491. p_hppa11_hpux9_n='HPPA/HP-UX 9.xx'
  1492. p_hppa11_hpux9_h='
  1493. This package contains all binaries for HPPA/HP-UX 9.xx platforms.
  1494. '
  1495.  
  1496. p_hppa11_hpux10_l=optional
  1497. p_hppa11_hpux10_d=hppa1.1-hpux10
  1498. p_hppa11_hpux10_du=6720
  1499. p_hppa11_hpux10_n='HPPA/HP-UX 10.xx'
  1500. p_hppa11_hpux10_h='
  1501. This package contains all binaries for HPPA/HP-UX 10.xx platforms.
  1502. '
  1503.  
  1504. p_i386_freebsd215_l=optional
  1505. p_i386_freebsd215_d=i386-freebsd2.1.5
  1506. p_i386_freebsd215_du=3720
  1507. p_i386_freebsd215_n='Intel x86/FreeBSD 2.1.5'
  1508. p_i386_freebsd215_h='
  1509. This package contains all binaries for Intel x86/FreeBSD 2.1.5 platforms.
  1510. '
  1511.  
  1512. p_i386_linux_l=optional
  1513. p_i386_linux_d=i386-linux
  1514. p_i386_linux_du=3430
  1515. p_i386_linux_n='Intel x86/Linux (ELF)'
  1516. p_i386_linux_h='
  1517. This package contains all binaries for Linux on Intel x86 machines.
  1518. The binaries are in ELF format and need ld.so version 1.7.3 or higher and
  1519. libc version 5.0.9 or higher.
  1520. '
  1521.  
  1522. p_i386_linuxaout_l=optional
  1523. p_i386_linuxaout_d=i386-linuxaout
  1524. p_i386_linuxaout_du=3520
  1525. p_i386_linuxaout_n='Intel x86/Linux (a.out)'
  1526. p_i386_linuxaout_h='
  1527. This package contains all binaries for Linux on x86 machines.
  1528. The binaries are in the old a.out format and need version 4 of the
  1529. C library (e.g. libc-4.6.26).
  1530. '
  1531.  
  1532. p_i386_nextstep3_l=optional
  1533. p_i386_nextstep3_d=i386-nextstep3
  1534. p_i386_nextstep3_du=4789
  1535. p_i386_nextstep3_n='Intel x86/NEXTSTEP 3'
  1536. p_i386_nextstep3_h='
  1537. This package contains all binaries for Intel x86/NEXTSTEP 3 platforms.
  1538. '
  1539.  
  1540. p_i386_solaris25_l=optional
  1541. p_i386_solaris25_d=i386-solaris2.5
  1542. p_i386_solaris25_du=3800
  1543. p_i386_solaris25_n='Intel x86/Solaris2.5'
  1544. p_i386_solaris25_h='
  1545. This package contains all binaries for Intel x86/Solaris2.5 platforms.
  1546. '
  1547.  
  1548. p_m68k_hpux9_l=optional
  1549. p_m68k_hpux9_d=m68k-hpux9
  1550. p_m68k_hpux9_du=7810
  1551. p_m68k_hpux9_n='HP 400/HP-UX 9.xx'
  1552. p_m68k_hpux9_h='
  1553. This package contains all binaries for HP 400/HP-UX 9.xx platforms.
  1554. '
  1555.  
  1556. p_m68k_nextstep3_l=optional
  1557. p_m68k_nextstep3_d=m68k-nextstep3
  1558. p_m68k_nextstep3_du=4637
  1559. p_m68k_nextstep3_n='Motorola 68k/NEXTSTEP 3'
  1560. p_m68k_nextstep3_h='
  1561. This package contains all binaries for Motorola 68k/NEXTSTEP 3 platforms.
  1562. '
  1563.  
  1564. p_mab_nextstep3_l=optional
  1565. p_mab_nextstep3_d=mab-nextstep3
  1566. p_mab_nextstep3_du=21419
  1567. p_mab_nextstep3_n='NEXTSTEP mab'
  1568. p_mab_nextstep3_h='
  1569. This package contains all binaries for NEXTSTEP (NeXT,Intel,HP-PA,SPARC)
  1570. platforms.
  1571. '
  1572.  
  1573. p_mips_irix53_l=optional
  1574. p_mips_irix53_d=mips-irix5.3
  1575. p_mips_irix53_du=6510
  1576. p_mips_irix53_n='SGI Irix 5.3'
  1577. p_mips_irix53_h='
  1578. This package contains all binaries for SGI Indigo machines running
  1579. Irix-5.3.
  1580. '
  1581.  
  1582. p_mips_irix62_l=optional
  1583. p_mips_irix62_d=mips-irix6.2
  1584. p_mips_irix62_du=6220
  1585. p_mips_irix62_n='SGI Irix 6.2'
  1586. p_mips_irix62_h='
  1587. This package contains all binaries for SGI Indigo machines running
  1588. Irix-6.2.
  1589. '
  1590.  
  1591. p_mips_ultrix43_l=optional
  1592. p_mips_ultrix43_d=mips-ultrix4.3
  1593. p_mips_ultrix43_du=9424
  1594. p_mips_ultrix43_n='Mips/Ultrix 4.3'
  1595. p_mips_ultrix43_h='
  1596. This package contains all binaries for Mips/Ultrix 4.3 platforms.
  1597. '
  1598.  
  1599. p_rs6000_aix414_l=optional
  1600. p_rs6000_aix414_d=rs6000-aix4.1.4
  1601. p_rs6000_aix414_du=5750
  1602. p_rs6000_aix414_n='IBM RS6000 AIX 4.1.4'
  1603. p_rs6000_aix414_h='
  1604. This package contains all binaries for IBM RS600 machines running
  1605. AIX 4.1.4.
  1606. '
  1607.  
  1608. p_rs6000_aix420_l=optional
  1609. p_rs6000_aix420_d=rs6000-aix4.2.0
  1610. p_rs6000_aix420_du=5390
  1611. p_rs6000_aix420_n='IBM RS6000 AIX 4.2.0'
  1612. p_rs6000_aix420_h='
  1613. This package contains all binaries for IBM RS600 machines running
  1614. AIX 4.2.0.
  1615. '
  1616.  
  1617. p_sparc_nextstep3_l=optional
  1618. p_sparc_nextstep3_d=sparc-nextstep3
  1619. p_sparc_nextstep3_du=5726
  1620. p_sparc_nextstep3_n='SUN Sparc/NEXTSTEP 3'
  1621. p_sparc_nextstep3_h='
  1622. This package contains all binaries for SUN Sparcs running NEXTSTEP 3.
  1623. '
  1624.  
  1625. p_sparc_solaris24_l=optional
  1626. p_sparc_solaris24_d=sparc-solaris2.4
  1627. p_sparc_solaris24_du=4540
  1628. p_sparc_solaris24_n='SUN Sparc Solaris 2.4'
  1629. p_sparc_solaris24_h='
  1630. This package contains all binaries for SUN Sparcs running Solaris 2.4.
  1631. '
  1632.  
  1633. p_sparc_solaris25_l=optional
  1634. p_sparc_solaris25_d=sparc-solaris2.5
  1635. p_sparc_solaris25_du=4510
  1636. p_sparc_solaris25_n='SUN Sparc Solaris 2.5'
  1637. p_sparc_solaris25_h='
  1638. This package contains all binaries for SUN Sparcs running Solaris 2.5.
  1639. '
  1640.  
  1641. p_sparc_sunos413_l=optional
  1642. p_sparc_sunos413_d=sparc-sunos4.1.3
  1643. p_sparc_sunos413_du=6080
  1644. p_sparc_sunos413_n='SUN Sparc SunOS 4.1.3'
  1645. p_sparc_sunos413_h='
  1646. This package contains all binaries for SUN Sparcs running SunOS 4.1.3.
  1647. '
  1648.  
  1649. p_ams_doc_d=ams-doc
  1650. p_ams_doc_du=600
  1651. p_ams_doc_n='AMS documentation'
  1652. p_ams_doc_h='
  1653. This package contains documentation for the AMS (= american mathematical
  1654. society) fonts, AMSLaTeX and AMSTeX. A good thing, if you need lots of
  1655. math in your documents.
  1656. '
  1657.  
  1658. p_bibtex_doc_d=bibtex-doc
  1659. p_bibtex_doc_du=170
  1660. p_bibtex_doc_n='BibTeX documentation'
  1661. p_bibtex_doc_h='
  1662. This package contains documentation for the BibTeX programm. BibTeX is
  1663. a tool to make a bibliography for (La)TeX.
  1664. '
  1665.  
  1666. p_eplain_doc_d=eplain-doc
  1667. p_eplain_doc_du=360
  1668. p_eplain_doc_n='eplain documentation'
  1669. p_eplain_doc_h='
  1670. This package contains documentation for the extended plain format (eplain).
  1671. '
  1672.  
  1673. p_fonts_doc_d=fonts-doc
  1674. p_fonts_doc_du=410
  1675. p_fonts_doc_n='fonts documentation'
  1676. p_fonts_doc_h='
  1677. This package contains documentation for some font packages.
  1678. '
  1679.  
  1680. p_general_doc_d=general-doc
  1681. p_general_doc_du=1510
  1682. p_general_doc_n='general documentation'
  1683. p_general_doc_h='
  1684. This package contains some general information about TeX: a list of
  1685. ftp servers, a draft for the TeX Directory Standard (TDS), The TeX and
  1686. LaTeX Catalogue, TeX FAQs from the German and UK TeX usergroups.
  1687. '
  1688.  
  1689. p_generic_doc_d=generic-doc
  1690. p_generic_doc_du=3840
  1691. p_generic_doc_n='generic documentation'
  1692. p_generic_doc_h='
  1693. This package contains documentation for macro packages that can be
  1694. used for several format files: babel, texdraw, pstricks, xypic.
  1695. '
  1696.  
  1697. p_latex_doc_d=latex-doc
  1698. p_latex_doc_du=5470
  1699. p_latex_doc_n='LaTeX documentation'
  1700. p_latex_doc_h='
  1701. This package contains documentation for LaTeX: over 100 dvi files and some
  1702. examples.
  1703. '
  1704.  
  1705. p_makeindex_doc_d=makeindex-doc
  1706. p_makeindex_doc_du=110
  1707. p_makeindex_doc_n='makeindex documentation'
  1708. p_makeindex_doc_h='
  1709. This package contains documentation for the Makeindex program.
  1710. '
  1711.  
  1712. p_metapost_doc_d=metapost-doc
  1713. p_metapost_doc_du=1560
  1714. p_metapost_doc_n='MetaPost documentation'
  1715. p_metapost_doc_h='
  1716. This package contains documentation for the MetaPost system.
  1717. '
  1718.  
  1719. p_programs_doc_d=programs-doc
  1720. p_programs_doc_du=1210
  1721. p_programs_doc_n='Kpathsea documentation'
  1722. p_programs_doc_h='
  1723. This package contains documentation about the Kpathsea library and some
  1724. programmes (dvipsk, info, makeinfo). The Kpathsea library is used by some
  1725. programmes in teTeX to locate files on the disk. Its most important
  1726. features are the filename database (ls-R) (speeds up recursive directory
  1727. searches), runtime configuration (search paths can be set up in file)
  1728. and automatic font generation.
  1729. '
  1730.  
  1731. p_ams_fonts_d=ams-fonts
  1732. p_ams_fonts_du=2270
  1733. p_ams_fonts_n='AMS fonts'
  1734. p_ams_fonts_h='
  1735. This package contains the AMS fonts.
  1736. '
  1737.  
  1738. p_dc_fonts_d=dc-fonts
  1739. p_dc_fonts_du=1110
  1740. p_dc_fonts_n='DC fonts'
  1741. p_dc_fonts_h='
  1742. This package contains the DC fonts. These are full 256 character fonts
  1743. containing lots of national characters.
  1744. '
  1745.  
  1746. p_misc_fonts_d=misc-fonts
  1747. p_misc_fonts_du=2100
  1748. p_misc_fonts_n='misc. fonts'
  1749. p_misc_fonts_h='
  1750. This package contains: symbol fonts (wasy), special fonts for math (rsfs,
  1751. stmary, bbm, bbold), alternate text fonts (concrete, gothic, pandora).
  1752. '
  1753.  
  1754. p_postscript_fonts_d=postscript-fonts
  1755. p_postscript_fonts_du=3010
  1756. p_postscript_fonts_n='PostScript fonts'
  1757. p_postscript_fonts_h='
  1758. This package contains support files to use some PostScript fonts
  1759. from Adobe and Bitstream for TeX.
  1760. '
  1761.  
  1762. p_sauter_fonts_d=sauter-fonts
  1763. p_sauter_fonts_du=410
  1764. p_sauter_fonts_n='sauter fonts'
  1765. p_sauter_fonts_h='
  1766. This package contains the sauter fonts. It allows to use some fonts
  1767. at (nearly) arbitrary sizes.
  1768. '
  1769.  
  1770. p_amstex_du=160
  1771. p_amstex_n='AMSTeX'
  1772. p_amstex_h='
  1773. This package contains the AMSTeX package. AMSTeX is an extension of the
  1774. plain TeX format with better support of mathematics and easy access to
  1775. the AMS fonts.
  1776. '
  1777.  
  1778. p_bibtex_du=300
  1779. p_bibtex_n='BibTeX'
  1780. p_bibtex_h='
  1781. This package contains some support files for the BibTeX program.
  1782. BibTeX is a tool to make a bibliography for (La)TeX.
  1783. '
  1784.  
  1785. p_eplain_d=eplain
  1786. p_eplain_du=80
  1787. p_eplain_n='expanded plain TeX'
  1788. p_eplain_h='
  1789. This package the expanded plain format (eplain).
  1790. '
  1791.  
  1792. p_latex_extra_d=latex-extra
  1793. p_latex_extra_du=2780
  1794. p_latex_extra_n='LaTeX extra'
  1795. p_latex_extra_h='
  1796. This package contains a lot of extra packages for LaTeX: amslatex, fancyhdr,
  1797. koma-script, mflogo, psnfss, seminar, cite and many many more...
  1798. '
  1799.  
  1800. p_metapost_d=metapost
  1801. p_metapost_du=150
  1802. p_metapost_n='MetaPost'
  1803. p_metapost_h='
  1804. This package contains files for the MetaPost program. MetaPost is similar
  1805. to Metafont, but it outputs to PostScript format.
  1806. '
  1807.  
  1808. p_pictex_d=pictex
  1809. p_pictex_du=280
  1810. p_pictex_n='PiCTeX'
  1811. p_pictex_h='
  1812. This package contains the PiCTeX macros to draw portable pictures with
  1813. TeX and LaTeX.
  1814. '
  1815.  
  1816. p_pstricks_d=pstricks
  1817. p_pstricks_du=220
  1818. p_pstricks_n='PS Tricks'
  1819. p_pstricks_h='
  1820. This package contains a package for PostScript macros for generic TeX.
  1821. '
  1822.  
  1823. p_texdraw_d=texdraw
  1824. p_texdraw_du=40
  1825. p_texdraw_n='TeXdraw macros'
  1826. p_texdraw_h='
  1827. This package contains macros for PostScript drawings for TeX.
  1828. '
  1829.  
  1830. p_xypic_d=xypic
  1831. p_xypic_du=830
  1832. p_xypic_n='XY-pic macros'
  1833. p_xypic_h='
  1834. This package contains macros for typesetting graphs and diagrams in TeX.
  1835. '
  1836.  
  1837. ################################################################
  1838. # screens:
  1839. ################################################################
  1840. screen_1='====================> teTeX $VERSION installation procedure <====================
  1841.  
  1842.         detected platform: $this_platform_n
  1843.  
  1844.     <S> series:
  1845.           binaries:           $s_bin_ns out of $s_bin_nf, disk space required: $s_bin_dus kB
  1846.           other (summary):    $S_nobin_ns out of $S_nobin_nf, disk space required: $S_nobin_dus kB
  1847.                                                total disk space: $s_total_dus kB
  1848.  
  1849.     <D> directories:
  1850.           TETEXDIR = $TETEXDIR
  1851.           TEXMF    = $TEXMF
  1852.  
  1853.     <O> options:
  1854.           [$opt_varfonts] alternate directory for automatically generated fonts
  1855.           [$opt_symlinks] create symlinks in standard directories
  1856.           [$opt_savespace_man] save space for manpages
  1857.  
  1858.     Other commands:
  1859.           <I> start installation,  <H> help,  <Q> quit
  1860.  
  1861. '
  1862.  
  1863. screen_2='Current directories setup:
  1864. ==============================================================================
  1865.  
  1866.   <1>  TETEXDIR:     $TETEXDIR
  1867.   <2>  TEXMF         $TEXMF
  1868.  
  1869. Other options:
  1870. ==============================================================================
  1871.   <R>   return to main menu
  1872.   <Q>   quit
  1873. '
  1874.  
  1875. screen_3='Current options setup:
  1876. ==============================================================================
  1877.  
  1878.   <A>  alternate directory for automatically generated fonts: [$opt_varfonts]
  1879.          directory name: $opt_varfonts_dir
  1880.   <S>  create symlinks in standard directories:               [$opt_symlinks]
  1881.             binaries to: $opt_symlinks_bin
  1882.             manpages to: $opt_symlinks_man
  1883.                 info to: $opt_symlinks_info
  1884.   <M>  save space for manpages                                [$opt_savespace_man]
  1885.           remove nroff sources                          [$opt_savespace_man_rm]
  1886.           compress preprocessed manpages with gzip      [$opt_savespace_man_gzip]
  1887.  
  1888. Other options:
  1889. ==============================================================================
  1890.   <R>   return to main menu
  1891.   <Q>   quit
  1892. '
  1893.  
  1894. screen_4='Current series setup:
  1895. ==============================================================================
  1896.   <P>   platforms: $s_bin_ns out of $s_bin_nf, disk space required: $s_bin_dus kB
  1897.   <B>   base:      $s_base_ns out of $s_base_nf, disk space required: $s_base_dus kB
  1898.   <G>   goodies:   $s_goodies_ns out of $s_goodies_nf, disk space required: $s_goodies_dus kB
  1899.   <F>   fonts:     $s_fonts_ns out of $s_fonts_nf, disk space required: $s_fonts_dus kB
  1900.   <D>   doc:       $s_doc_ns out of $s_doc_nf, disk space required: $s_doc_dus kB
  1901.                                     total disk space: $s_total_dus kB
  1902.  
  1903. ==============================================================================
  1904.   <R>   return to main menu
  1905.   <Q>   quit
  1906. '
  1907.  
  1908. screen_6='teTeX can be used on multiple platforms by having a subdirectory for each
  1909. installed binary package in $TETEXDIR/bin.
  1910.  
  1911. However, if you do not plan to add binaries for other platforms to
  1912. your teTeX installation, your binaries can directly be put into the
  1913. $TETEXDIR/bin directory.'
  1914.  
  1915. help_1='
  1916. This is the installation program of the teTeX distribution.
  1917.  
  1918. The installation procedure is really simple: just go through the
  1919. menus and select "start installation" if all options are set up
  1920. all right.
  1921.  
  1922. To select a menu item (a letter or a number makred with brackets)
  1923. just enter the corresponding letter or number and press return
  1924. (the letters are case insensitive).
  1925.  
  1926. Right now, the each menu item is explained in detail:
  1927.  
  1928. ======================================================================
  1929.   The detected platform:
  1930. ======================================================================
  1931.  
  1932. From the list of supported platforms, the installation procedure
  1933. tries to find out which binaries do run best on your system, if it
  1934. is supported. These binaries are then pre-selected. If you plan an
  1935. installation for a hetrogenous network, you may need to add binaries
  1936. for other platforms via the series menue (see below).
  1937.  
  1938.  
  1939. ======================================================================
  1940.   The series menu (<S>)
  1941. ======================================================================
  1942.  
  1943. The series menu allows you to select and deselect packages. The
  1944. packages are grouped in some series:
  1945.  
  1946.   binaries: you need one binary package for each platform you use
  1947.   base:     this series contains a minimal TeX+LaTeX system
  1948.  
  1949. All other series are "add-ons":
  1950.  
  1951.   goodies:  useful extra stuff, including much about LaTeX
  1952.   fonts:    many extra fonts: amsfonts, PostScript fonts, DC, ...
  1953.   doc:      much documentation. But one cannot have enough, right?
  1954.  
  1955. ======================================================================
  1956.   The directories menu (<D>)
  1957. ======================================================================
  1958.  
  1959. The teTeX distribution will be installed in a directory of your choice.
  1960. This directory is called TETEXDIR. You may choose any directory you like
  1961. since there are no absolute paths compiled into the binaries. Instead, a
  1962. extension of the Kpathsea library is used (selfdir extension) and all
  1963. paths are relative to the location of the binaries.
  1964.  
  1965. The platform independend files are stored in a directory tree called
  1966. TEXMF. TEXMF defaults to TETEXDIR/texmf, but you can change this, if you
  1967. want (many systems use /ust/lib/texmf or /usr/local/lib/texmf)
  1968.  
  1969. ======================================================================
  1970.   The options menu (<O>)
  1971. ======================================================================
  1972.  
  1973. The options are optional part of the installation, as they are not
  1974. always applicable or useful.
  1975.  
  1976. "alternate directory":
  1977. ======================
  1978.  
  1979. If you choose an alternate directory for automatically generated fonts,
  1980. you can mount your TEXMF tree readonly (as long as you do not want to
  1981. perform administrative tasks: change configuration, install new inputs
  1982. and the like).
  1983.  
  1984. There are two good reasons to do this:
  1985.   - TEXMF is in your /usr partition and you want to mount it readonly
  1986.     (or in another partition that you mount readonly)
  1987.   - TEXMF will be accessable via NFS and you do not want to give
  1988.     write permissions to your NFS clients
  1989.  
  1990. If the second case applies to you, please note that the filename
  1991. database (ls-R) and the automatically generated fonts will be installed
  1992. in the alternate directory you choose. If this directory is local to
  1993. each client, you need to run texhash on each machine to build the
  1994. filename database there. Another disadvantage is that new fonts are not
  1995. shared in that case.
  1996.  
  1997.  
  1998. "symlinks in standard directories"
  1999. ==================================
  2000.  
  2001. To make your binaries, manpages and infopages available to your system,
  2002. there are two common ways:
  2003.   1) install them in "standard places" that are searched for these files
  2004.   2) change your search paths to include the new directories
  2005.  
  2006. If you select the "symlinks" option, symbolic links will be installed in
  2007. the directories you choose. Note that if you share the teTeX installation
  2008. accross several machines via NFS and if the chosen "standard places" are
  2009. not shared, you need to create the symbolic links on each client, too
  2010. (or use method 2 on your clients).
  2011.  
  2012. If you do not use the "symlinks" option, you propably need to set up
  2013. your search paths (PATH, MANPATH, INFOPATH).
  2014.  
  2015.  
  2016. "save space for manpages"
  2017. =========================
  2018.  
  2019. Remove the sources for the manpages, if you do not want to keep them
  2020. (the distribution contains preprocessed manpages).
  2021.  
  2022. You may compress the preprocessed manpages with gzip, if your system
  2023. supports this.
  2024.  
  2025.  
  2026. "use configuration from a previous teTeX installation"
  2027. ======================================================
  2028.  
  2029. If you have an old version of teTeX, you may consider using some
  2030. configuration files from the old system and thus save the time for
  2031. reconfiguring. This option supports the xdvi and dvips configuration
  2032. (papertypes, modes, paper offsets for printers,...), but not your
  2033. hyphenation tables for (La)TeX.
  2034.  
  2035. ======================================================================
  2036.   Other commands (<I>, <H> and <Q>)
  2037. ======================================================================
  2038.  
  2039. Well, this is easy to explain:
  2040.   <I> starts the installation after you are confident with set setup
  2041.   <H> displays this help
  2042.   <Q> quits the installation program
  2043. '
  2044.  
  2045.  
  2046. guess()
  2047. {
  2048.   cat > $TMPDIR/config.guess <<'eof-for-guess'
  2049. #! /bin/sh
  2050. # Attempt to guess a canonical system name.
  2051. #   Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
  2052. #
  2053. # This file is free software; you can redistribute it and/or modify it
  2054. # under the terms of the GNU General Public License as published by
  2055. # the Free Software Foundation; either version 2 of the License, or
  2056. # (at your option) any later version.
  2057. #
  2058. # This program is distributed in the hope that it will be useful, but
  2059. # WITHOUT ANY WARRANTY; without even the implied warranty of
  2060. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  2061. # General Public License for more details.
  2062. #
  2063. # You should have received a copy of the GNU General Public License
  2064. # along with this program; if not, write to the Free Software
  2065. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  2066. #
  2067. # As a special exception to the GNU General Public License, if you
  2068. # distribute this file as part of a program that contains a
  2069. # configuration script generated by Autoconf, you may include it under
  2070. # the same distribution terms that you use for the rest of that program.
  2071.  
  2072. # Written by Per Bothner <bothner@cygnus.com>.
  2073. # The master version of this file is at the FSF in /home/gd/gnu/lib.
  2074. #
  2075. # This script attempts to guess a canonical system name similar to
  2076. # config.sub.  If it succeeds, it prints the system name on stdout, and
  2077. # exits with 0.  Otherwise, it exits with 1.
  2078. #
  2079. # The plan is that this can be called by configure scripts if you
  2080. # don't specify an explicit system type (host/target name).
  2081. #
  2082. # Only a few systems have been added to this list; please add others
  2083. # (but try to keep the structure clean).
  2084. #
  2085.  
  2086. # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
  2087. # (ghazi@noc.rutgers.edu 8/24/94.)
  2088. if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
  2089.     PATH=$PATH:/.attbin ; export PATH
  2090. fi
  2091.  
  2092. UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
  2093. UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
  2094. UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
  2095. UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
  2096.  
  2097. trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
  2098.  
  2099. # Note: order is significant - the case branches are not exclusive.
  2100.  
  2101. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
  2102.     alpha:OSF1:V*:*)
  2103.     # After 1.2, OSF1 uses "V1.3" for uname -r.
  2104.     echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^V//'`
  2105.     exit 0 ;;
  2106.     alpha:OSF1:*:*)
  2107.     # 1.2 uses "1.2" for uname -r.
  2108.     echo alpha-dec-osf${UNAME_RELEASE}
  2109.         exit 0 ;;
  2110.     21064:Windows_NT:50:3)
  2111.     echo alpha-dec-winnt3.5
  2112.     exit 0 ;;
  2113.     amiga:NetBSD:*:*)
  2114.       echo m68k-cbm-netbsd${UNAME_RELEASE}
  2115.       exit 0 ;;
  2116.     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
  2117.     echo arm-acorn-riscix${UNAME_RELEASE}
  2118.     exit 0;;
  2119.     Pyramid*:OSx*:*:*)
  2120.     if test "`(/bin/universe) 2>/dev/null`" = att ; then
  2121.         echo pyramid-pyramid-sysv3
  2122.     else
  2123.         echo pyramid-pyramid-bsd
  2124.     fi
  2125.     exit 0 ;;
  2126.     sun4*:SunOS:5.*:*)
  2127.     echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  2128.     exit 0 ;;
  2129.     i86pc:SunOS:5.*:*)
  2130.     echo i386-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  2131.     exit 0 ;;
  2132.     sun4*:SunOS:6*:*)
  2133.     # According to config.sub, this is the proper way to canonicalize
  2134.     # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
  2135.     # it's likely to be more like Solaris than SunOS4.
  2136.     echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  2137.     exit 0 ;;
  2138.     sun4*:SunOS:*:*)
  2139.     case "`/usr/bin/arch -k`" in
  2140.         Series*|S4*)
  2141.         UNAME_RELEASE=`uname -v`
  2142.         ;;
  2143.     esac
  2144.     # Japanese Language versions have a version number like `4.1.3-JL'.
  2145.     echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
  2146.     exit 0 ;;
  2147.     sun3*:SunOS:*:*)
  2148.     echo m68k-sun-sunos${UNAME_RELEASE}
  2149.     exit 0 ;;
  2150.     atari*:NetBSD:*:*)
  2151.     echo m68k-atari-netbsd${UNAME_RELEASE}
  2152.     exit 0 ;;
  2153.     sun3*:NetBSD:*:*)
  2154.     echo m68k-sun-netbsd${UNAME_RELEASE}
  2155.     exit 0 ;;
  2156.     mac68k:NetBSD:*:*)
  2157.     echo m68k-apple-netbsd${UNAME_RELEASE}
  2158.     exit 0 ;;
  2159.     RISC*:ULTRIX:*:*)
  2160.     echo mips-dec-ultrix${UNAME_RELEASE}
  2161.     exit 0 ;;
  2162.     VAX*:ULTRIX*:*:*)
  2163.     echo vax-dec-ultrix${UNAME_RELEASE}
  2164.     exit 0 ;;
  2165.     mips:*:4*:UMIPS)
  2166.     echo mips-mips-riscos4sysv
  2167.     exit 0 ;;
  2168.     mips:*:5*:RISCos)
  2169.     echo mips-mips-riscos${UNAME_RELEASE}
  2170.     exit 0 ;;
  2171.     m88k:CX/UX:7*:*)
  2172.     echo m88k-harris-cxux7
  2173.     exit 0 ;;
  2174.     m88k:*:4*:R4*)
  2175.     echo m88k-motorola-sysv4
  2176.     exit 0 ;;
  2177.     m88k:*:3*:R3*)
  2178.     echo m88k-motorola-sysv3
  2179.     exit 0 ;;
  2180.     AViiON:dgux:*:*)
  2181.         # DG/UX returns AViiON for all architectures
  2182.         UNAME_PROCESSOR=`uname -p`
  2183.         if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88100 ] ; then
  2184.     if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
  2185.          -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
  2186.         echo m88k-dg-dgux${UNAME_RELEASE}
  2187.     else
  2188.         echo m88k-dg-dguxbcs${UNAME_RELEASE}
  2189.     fi
  2190.         else echo i586-dg-dgux${UNAME_RELEASE}
  2191.         fi
  2192.      exit 0 ;;
  2193.     M88*:DolphinOS:*:*)    # DolphinOS (SVR3)
  2194.     echo m88k-dolphin-sysv3
  2195.     exit 0 ;;
  2196.     M88*:*:R3*:*)
  2197.     # Delta 88k system running SVR3
  2198.     echo m88k-motorola-sysv3
  2199.     exit 0 ;;
  2200.     XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
  2201.     echo m88k-tektronix-sysv3
  2202.     exit 0 ;;
  2203.     Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
  2204.     echo m68k-tektronix-bsd
  2205.     exit 0 ;;
  2206.     *:IRIX*:*:*)
  2207.     echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
  2208.     exit 0 ;;
  2209.    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
  2210.     echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
  2211.     exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
  2212.     i[34]86:AIX:*:*)
  2213.     echo i386-ibm-aix
  2214.     exit 0 ;;
  2215.     *:AIX:2:3)
  2216.     if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
  2217.         sed 's/^        //' << EOF >dummy.c
  2218.         #include <sys/systemcfg.h>
  2219.  
  2220.         main()
  2221.             {
  2222.             if (!__power_pc())
  2223.                 exit(1);
  2224.             puts("powerpc-ibm-aix3.2.5");
  2225.             exit(0);
  2226.             }
  2227. EOF
  2228.         ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
  2229.         rm -f dummy.c dummy
  2230.         echo rs6000-ibm-aix3.2.5
  2231.     elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
  2232.         echo rs6000-ibm-aix3.2.4
  2233.     else
  2234.         echo rs6000-ibm-aix3.2
  2235.     fi
  2236.     exit 0 ;;
  2237.     *:AIX:*:4)
  2238.     if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
  2239.         IBM_ARCH=rs6000
  2240.     else
  2241.         IBM_ARCH=powerpc
  2242.     fi
  2243.     if [ -x /usr/bin/oslevel ] ; then
  2244.         IBM_REV=`/usr/bin/oslevel`
  2245.     else
  2246.         IBM_REV=4.${UNAME_RELEASE}
  2247.     fi
  2248.     echo ${IBM_ARCH}-ibm-aix${IBM_REV}
  2249.     exit 0 ;;
  2250.     *:AIX:*:*)
  2251.     echo rs6000-ibm-aix
  2252.     exit 0 ;;
  2253.     ibmrt:4.4BSD:*|romp-ibm:BSD:*)
  2254.     echo romp-ibm-bsd4.4
  2255.     exit 0 ;;
  2256.     ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC NetBSD and
  2257.     echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to 
  2258.     exit 0 ;;                           # report: romp-ibm BSD 4.3
  2259.     *:BOSX:*:*)
  2260.     echo rs6000-bull-bosx
  2261.     exit 0 ;;
  2262.     DPX/2?00:B.O.S.:*:*)
  2263.     echo m68k-bull-sysv3
  2264.     exit 0 ;;
  2265.     9000/[34]??:4.3bsd:1.*:*)
  2266.     echo m68k-hp-bsd
  2267.     exit 0 ;;
  2268.     hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
  2269.     echo m68k-hp-bsd4.4
  2270.     exit 0 ;;
  2271.     9000/[3478]??:HP-UX:*:*)
  2272.     case "${UNAME_MACHINE}" in
  2273.         9000/31? )            HP_ARCH=m68000 ;;
  2274.         9000/[34]?? )         HP_ARCH=m68k ;;
  2275.         9000/7?? | 9000/8?[679] ) HP_ARCH=hppa1.1 ;;
  2276.         9000/8?? )            HP_ARCH=hppa1.0 ;;
  2277.     esac
  2278.     HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
  2279.     echo ${HP_ARCH}-hp-hpux${HPUX_REV}
  2280.     exit 0 ;;
  2281.     3050*:HI-UX:*:*)
  2282.     sed 's/^    //' << EOF >dummy.c
  2283.     #include <unistd.h>
  2284.     int
  2285.     main ()
  2286.     {
  2287.       long cpu = sysconf (_SC_CPU_VERSION);
  2288.       /* The order matters, because CPU_IS_HP_MC68K erroneously returns
  2289.          true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
  2290.          results, however.  */
  2291.       if (CPU_IS_PA_RISC (cpu))
  2292.         {
  2293.           switch (cpu)
  2294.         {
  2295.           case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
  2296.           case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
  2297.           case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
  2298.           default: puts ("hppa-hitachi-hiuxwe2"); break;
  2299.         }
  2300.         }
  2301.       else if (CPU_IS_HP_MC68K (cpu))
  2302.         puts ("m68k-hitachi-hiuxwe2");
  2303.       else puts ("unknown-hitachi-hiuxwe2");
  2304.       exit (0);
  2305.     }
  2306. EOF
  2307.     ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
  2308.     rm -f dummy.c dummy
  2309.     echo unknown-hitachi-hiuxwe2
  2310.     exit 0 ;;
  2311.     9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
  2312.     echo hppa1.1-hp-bsd
  2313.     exit 0 ;;
  2314.     9000/8??:4.3bsd:*:*)
  2315.     echo hppa1.0-hp-bsd
  2316.     exit 0 ;;
  2317.     hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
  2318.     echo hppa1.1-hp-osf
  2319.     exit 0 ;;
  2320.     hp8??:OSF1:*:*)
  2321.     echo hppa1.0-hp-osf
  2322.     exit 0 ;;
  2323.     parisc*:Lites*:*:*)
  2324.     echo hppa1.1-hp-lites
  2325.     exit 0 ;;
  2326.     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
  2327.     echo c1-convex-bsd
  2328.         exit 0 ;;
  2329.     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
  2330.     if getsysinfo -f scalar_acc
  2331.     then echo c32-convex-bsd
  2332.     else echo c2-convex-bsd
  2333.     fi
  2334.         exit 0 ;;
  2335.     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
  2336.     echo c34-convex-bsd
  2337.         exit 0 ;;
  2338.     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
  2339.     echo c38-convex-bsd
  2340.         exit 0 ;;
  2341.     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
  2342.     echo c4-convex-bsd
  2343.         exit 0 ;;
  2344.     CRAY*X-MP:*:*:*)
  2345.     echo xmp-cray-unicos
  2346.         exit 0 ;;
  2347.     CRAY*Y-MP:*:*:*)
  2348.     echo ymp-cray-unicos${UNAME_RELEASE}
  2349.     exit 0 ;;
  2350.     CRAY*C90:*:*:*)
  2351.     echo c90-cray-unicos${UNAME_RELEASE}
  2352.     exit 0 ;;
  2353.     CRAY-2:*:*:*)
  2354.     echo cray2-cray-unicos
  2355.         exit 0 ;;
  2356.     hp3[0-9][05]:NetBSD:*:*)
  2357.     echo m68k-hp-netbsd${UNAME_RELEASE}
  2358.     exit 0 ;;
  2359.     i[34]86:BSD/386:*:* | *:BSD/OS:*:*)
  2360.     echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
  2361.     exit 0 ;;
  2362.     *:FreeBSD:*:*)
  2363.     echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
  2364.     exit 0 ;;
  2365.     *:NetBSD:*:*)
  2366.     echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
  2367.     exit 0 ;;
  2368.     *:GNU:*:*)
  2369.     echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
  2370.     exit 0 ;;
  2371.     *:Linux:*:*)
  2372.     # The BFD linker knows what the default object file format is, so
  2373.     # first see if it will tell us.
  2374.     ld_help_string=`ld --help 2>&1`
  2375.     if echo $ld_help_string | grep >/dev/null 2>&1 "supported emulations: elf_i[345]86"; then
  2376.       echo "${UNAME_MACHINE}-unknown-linux" ; exit 0
  2377.     elif echo $ld_help_string | grep >/dev/null 2>&1 "supported emulations: i[345]86linux"; then
  2378.       echo "${UNAME_MACHINE}-unknown-linuxaout" ; exit 0
  2379.     elif echo $ld_help_string | grep >/dev/null 2>&1 "supported emulations: i[345]86coff"; then
  2380.       echo "${UNAME_MACHINE}-unknown-linuxcoff" ; exit 0
  2381.     elif test "${UNAME_MACHINE}" = "alpha" ; then
  2382.       echo alpha-unknown-linux ; exit 0
  2383.     else
  2384.       # Either a pre-BFD a.out linker (linuxoldld) or one that does not give us
  2385.       # useful --help.  Gcc wants to distinguish between linuxoldld and linuxaout.
  2386.       test ! -d /usr/lib/ldscripts/. \
  2387.         && echo "${UNAME_MACHINE}-unknown-linuxoldld" && exit 0
  2388.       # Determine whether the default compiler is a.out or elf
  2389.       cat >dummy.c <<EOF
  2390. main(argc, argv)
  2391. int argc;
  2392. char *argv[];
  2393. {
  2394. #ifdef __ELF__
  2395.   printf ("%s-unknown-linux\n", argv[1]);
  2396. #else
  2397.   printf ("%s-unknown-linuxaout\n", argv[1]);
  2398. #endif
  2399.   return 0;
  2400. }
  2401. EOF
  2402.       ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
  2403.       rm -f dummy.c dummy
  2404.     fi ;;
  2405. # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.  earlier versions
  2406. # are messed up and put the nodename in both sysname and nodename.
  2407.     i[34]86:DYNIX/ptx:4*:*)
  2408.     echo i386-sequent-sysv4
  2409.     exit 0 ;;
  2410.     i[34]86:*:4.*:* | i[34]86:SYSTEM_V:4.*:*)
  2411.     if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
  2412.         echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
  2413.     else
  2414.         echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}
  2415.     fi
  2416.     exit 0 ;;
  2417.     i[34]86:*:3.2:*)
  2418.     if test -f /usr/options/cb.name; then
  2419.         UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
  2420.         echo ${UNAME_MACHINE}-unknown-isc$UNAME_REL
  2421.     elif /bin/uname -X 2>/dev/null >/dev/null ; then
  2422.         UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
  2423.         (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
  2424.         (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
  2425.             && UNAME_MACHINE=i586
  2426.         echo ${UNAME_MACHINE}-unknown-sco$UNAME_REL
  2427.     else
  2428.         echo ${UNAME_MACHINE}-unknown-sysv32
  2429.     fi
  2430.     exit 0 ;;
  2431.     Intel:Mach:3*:*)
  2432.     echo i386-unknown-mach3
  2433.     exit 0 ;;
  2434.     paragon:*:*:*)
  2435.     echo i860-intel-osf1
  2436.     exit 0 ;;
  2437.     i860:*:4.*:*) # i860-SVR4
  2438.     if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
  2439.       echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
  2440.     else # Add other i860-SVR4 vendors below as they are discovered.
  2441.       echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
  2442.     fi
  2443.     exit 0 ;;
  2444.     mini*:CTIX:SYS*5:*)
  2445.     # "miniframe"
  2446.     echo m68010-convergent-sysv
  2447.     exit 0 ;;
  2448.     M680[234]0:*:R3V[567]*:*)
  2449.     test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
  2450.     3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0)
  2451.         uname -p 2>/dev/null | grep 86 >/dev/null \
  2452.           && echo i486-ncr-sysv4.3 && exit 0 ;;
  2453.     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
  2454.         uname -p 2>/dev/null | grep 86 >/dev/null \
  2455.           && echo i486-ncr-sysv4 && exit 0 ;;
  2456.     m680[234]0:LynxOS:2.[23]*:*)
  2457.     echo m68k-lynx-lynxos${UNAME_RELEASE}
  2458.     exit 0 ;;
  2459.     mc68030:UNIX_System_V:4.*:*)
  2460.     echo m68k-atari-sysv4
  2461.     exit 0 ;;
  2462.     i[34]86:LynxOS:2.[23]*:*)
  2463.     echo i386-lynx-lynxos${UNAME_RELEASE}
  2464.     exit 0 ;;
  2465.     TSUNAMI:LynxOS:2.[23]*:*)
  2466.     echo sparc-lynx-lynxos${UNAME_RELEASE}
  2467.     exit 0 ;;
  2468.     rs6000:LynxOS:2.[23]*:*)
  2469.     echo rs6000-lynx-lynxos${UNAME_RELEASE}
  2470.     exit 0 ;;
  2471.     RM*:SINIX-*:*:*)
  2472.     echo mips-sni-sysv4
  2473.     exit 0 ;;
  2474.     *:SINIX-*:*:*)
  2475.     if uname -p 2>/dev/null >/dev/null ; then
  2476.         UNAME_MACHINE=`(uname -p) 2>/dev/null`
  2477.         echo ${UNAME_MACHINE}-sni-sysv4
  2478.     else
  2479.         echo ns32k-sni-sysv
  2480.     fi
  2481.     exit 0 ;;
  2482. esac
  2483.  
  2484. #echo '(No uname command or uname output not recognized.)' 1>&2
  2485. #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
  2486.  
  2487. cat >dummy.c <<EOF
  2488. #ifdef _SEQUENT_
  2489. # include <sys/types.h>
  2490. # include <sys/utsname.h>
  2491. #endif
  2492. main ()
  2493. {
  2494. #if defined (sony)
  2495. #if defined (MIPSEB)
  2496.   /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
  2497.      I don't know....  */
  2498.   printf ("mips-sony-bsd\n"); exit (0);
  2499. #else
  2500. #include <sys/param.h>
  2501.   printf ("m68k-sony-newsos%s\n",
  2502. #ifdef NEWSOS4
  2503.           "4"
  2504. #else
  2505.       ""
  2506. #endif
  2507.          ); exit (0);
  2508. #endif
  2509. #endif
  2510.  
  2511. #if defined (__arm) && defined (__acorn) && defined (__unix)
  2512.   printf ("arm-acorn-riscix"); exit (0);
  2513. #endif
  2514.  
  2515. #if defined (hp300) && !defined (hpux)
  2516.   printf ("m68k-hp-bsd\n"); exit (0);
  2517. #endif
  2518.  
  2519. #if defined (NeXT)
  2520. #if !defined (__ARCHITECTURE__)
  2521. #define __ARCHITECTURE__ "m68k"
  2522. #endif
  2523.   int version;
  2524.   version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
  2525.   printf ("%s-next-nextstep%s\n", __ARCHITECTURE__,  version==2 ? "2" : "3");
  2526.   exit (0);
  2527. #endif
  2528.  
  2529. #if defined (MULTIMAX) || defined (n16)
  2530. #if defined (UMAXV)
  2531.   printf ("ns32k-encore-sysv\n"); exit (0);
  2532. #else
  2533. #if defined (CMU)
  2534.   printf ("ns32k-encore-mach\n"); exit (0);
  2535. #else
  2536.   printf ("ns32k-encore-bsd\n"); exit (0);
  2537. #endif
  2538. #endif
  2539. #endif
  2540.  
  2541. #if defined (__386BSD__)
  2542.   printf ("i386-unknown-bsd\n"); exit (0);
  2543. #endif
  2544.  
  2545. #if defined (sequent)
  2546. #if defined (i386)
  2547.   printf ("i386-sequent-dynix\n"); exit (0);
  2548. #endif
  2549. #if defined (ns32000)
  2550.   printf ("ns32k-sequent-dynix\n"); exit (0);
  2551. #endif
  2552. #endif
  2553.  
  2554. #if defined (_SEQUENT_)
  2555.     struct utsname un;
  2556.  
  2557.     uname(&un);
  2558.  
  2559.     if (strncmp(un.version, "V2", 2) == 0) {
  2560.     printf ("i386-sequent-ptx2\n"); exit (0);
  2561.     }
  2562.     if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
  2563.     printf ("i386-sequent-ptx1\n"); exit (0);
  2564.     }
  2565.     printf ("i386-sequent-ptx\n"); exit (0);
  2566.  
  2567. #endif
  2568.  
  2569. #if defined (vax)
  2570. #if !defined (ultrix)
  2571.   printf ("vax-dec-bsd\n"); exit (0);
  2572. #else
  2573.   printf ("vax-dec-ultrix\n"); exit (0);
  2574. #endif
  2575. #endif
  2576.  
  2577. #if defined (alliant) && defined (i860)
  2578.   printf ("i860-alliant-bsd\n"); exit (0);
  2579. #endif
  2580.  
  2581.   exit (1);
  2582. }
  2583. EOF
  2584.  
  2585. ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
  2586. rm -f dummy.c dummy
  2587.  
  2588. # Apollos put the system type in the environment.
  2589.  
  2590. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
  2591.  
  2592. # Convex versions that predate uname can use getsysinfo(1)
  2593.  
  2594. if [ -x /usr/convex/getsysinfo ]
  2595. then
  2596.     case `getsysinfo -f cpu_type` in
  2597.     c1*)
  2598.     echo c1-convex-bsd
  2599.     exit 0 ;;
  2600.     c2*)
  2601.     if getsysinfo -f scalar_acc
  2602.     then echo c32-convex-bsd
  2603.     else echo c2-convex-bsd
  2604.     fi
  2605.     exit 0 ;;
  2606.     c34*)
  2607.     echo c34-convex-bsd
  2608.     exit 0 ;;
  2609.     c38*)
  2610.     echo c38-convex-bsd
  2611.     exit 0 ;;
  2612.     c4*)
  2613.     echo c4-convex-bsd
  2614.     exit 0 ;;
  2615.     esac
  2616. fi
  2617.  
  2618. #echo '(Unable to guess system type)' 1>&2
  2619.  
  2620. exit 1
  2621. eof-for-guess
  2622.   cd $TMPDIR;
  2623.   sh $TMPDIR/config.guess
  2624. }
  2625.  
  2626. #debug=true
  2627. debug=
  2628.  
  2629. ################################################################
  2630. # main()
  2631. ################################################################
  2632. init
  2633. menu_main
  2634.