TETEXDIR/man/man1/* .
    fi
    if test -d $TETEXDIR/man/man5 && test -w $opt_symlinks_man/man5; then
        cd $opt_symlinks_man/man5
        rm -f `ls $TETEXDIR/man/man5`; ln -s $TETEXDIR/man/man5/* .
    fi
    if test -d $TETEXDIR/man/cat1 && test -w $opt_symlinks_man/cat1; then
        cd $opt_symlinks_man/cat1
        rm -f `ls $TETEXDIR/man/cat1`; ln -s $TETEXDIR/man/cat1/* .
    fi
    if test -d $TETEXDIR/man/cat5 && test -w $opt_symlinks_man/cat5; then
        cd $opt_symlinks_man/cat5
        rm -f `ls $TETEXDIR/man/cat5`; ln -s $TETEXDIR/man/cat5/* .
    fi
    if test -d $TETEXDIR/info && test -w "$opt_symlinks_info"; then
        cd $opt_symlinks_info
        rm -f `ls $TETEXDIR/info`; ln -s $TETEXDIR/info/*info* .
    fi
    if test "$opt_symlinks" = X; then
        if test ! -z "$this_platform_bin"; then
          if test -w "$opt_symlinks_bin"; then
            cd $opt_symlinks_bin
            rm -f `ls $this_platform_bin`; ln -s $this_platform_bin/* .
            echo 'Done.'
          fi
        else
          cls
          echo '                              WARNING!                              '
          echo
          echo 'teTeX binaries for this platform are not installed. If you install'
          echo 'them later, you can create symbolic links to $opt_symlinks_bin'
          echo 'with a command like:'
          echo
          echo "  ln -s $TETEXDIR/bin/PLATFORM/* $opt_symlinks_bin"
          echo
          echo 'PLATFORM needs to be replaced by the name of the subdirectory that'
          echo 'contains the binaries for this platform.'
          echo
          readln
        fi
    fi
}

locate_binaties()
{
    this_platform_bin=
    lb_dir=$TETEXDIR/bin/$this_platform_d
    test -x "$lb_dir/initex" && this_platform_bin=$lb_dir
    test -x "$TETEXDIR/bin/initex" && this_platform_bin=$TETEXDIR/bin
    test ! -d $lb_dir && rm -f $lb_dir 2>/dev/null
    test -z "$this_platform_bin" && return
    PATH="${this_platform_bin}:${PATH}"; export PATH
}

untgz()
{
    cd $TMPDIR
    for u_series in $S_all_la; do
        eval selected=\$s_${u_series}_ls
        for u_package in $selected; do
          eval file=\$p_${u_package}_fn
          list=`basename $file| sed 's@.tar.gz$@@'`
          package_showinfo $u_package
          echo
          $echon "Testing integrity of file $file... "
          gzip --test $file
          if test $? = 0; then
            echo "Ok."
          else
            warn "Integrity of file $file is void."
            continue
          fi
          $echon "Extracting package $p_current_n... "
          gzip -dc < $file | tar -xvf - >$ERRLOG 2>&1
          if test $? = 0; then
            echo 'Done.'
            sed /$tetex_prefix/'!d; s@[^/]*'$tetex_prefix'/*@@; s/[,/]*[ 	].*//; /^$/d' $ERRLOG > $TEXMF/lists/$list
            if test -s $TEXMF/lists/$list; then
              chmod 755 $TEXMF/lists/$list
            else
              rm -f $TEXMF/lists/$list
            fi
          else
            show_error
            continue
          fi
        done
    done
    rmdir $TEXMF/lists 2>/dev/null
}

prepare_errorlog()
{
    trap 'cd /; rm -f "$ERRLOG" 2>/dev/null; trap '' 0; exit 0' 0 1 2 15
    touch "$ERRLOG"
    test -w "$ERRLOG" || fatal "cannot write to file '$ERRLOG'"
}

locate_binaries()
{
    require_binaries touch sed awk gzip ln rm ls tar tr mkdir cat `echo $PAGER | sed 's@ .*@@'` pwd
}

init()
{
    bad_sh
    prepare_errorlog
    locate_binaries
    find_echo
    unset_vars
    this_platform=`platform_guess`
    series_init
    nobin_stat    
}

linux_which_x()
{
    test -f $TETEXDIR/bin/i486-linuxaout/xdvi-X11R6 || return
    test -f $TETEXDIR/bin/i486-linuxaout/xdvi-X11R5 || return
    test -f $TETEXDIR/bin/i486-linuxaout/virmf-X11R5 || return
    test -f $TETEXDIR/bin/i486-linuxaout/virmf-X11R6 || return

    echo 'The a.out binaries for Linux contains 2 versions of xdvi and virmf.'
    echo 'One is for X11R5 (XFree86-2.X), the other one for X11R6 (XFree86-3.X).'
    echo
    rm -f $TETEXDIR/bin/i486-linuxaout/xdvi.bin $TETEXDIR/bin/i486-linuxaout/virmf.X
    if yesno 'Do you want to use the R6 versions as default'; then
        ln -s xdvi-X11R6 $TETEXDIR/bin/i486-linuxaout/xdvi.bin
        ln -s virmf-X11R6 $TETEXDIR/bin/i486-linuxaout/virmf.X
        other=X11R5
    else
        ln -s xdvi-X11R5 $TETEXDIR/bin/i486-linuxaout/xdvi.bin
        ln -s virmf-X11R5 $TETEXDIR/bin/i486-linuxaout/virmf.X
        other=X11R6
    fi
    if yesno "Remove the binaries for $other"; then
        rm -f $TETEXDIR/bin/i486-linuxaout/xdvi-$other
        rm -f $TETEXDIR/bin/i486-linuxaout/virmf-$other
    fi
}

fixperm()
{
    $echon 'Fixing permissions... '
    cd $TEXMF
    files=`find . -perm -2 \( -type d -o -type f \) -print`
    test -z "$files" || chmod go-w $files
    cd $TETEXDIR
    files=`find . -perm -2 \( -type d -o -type f \) -print`
    test -z "$files" || { chmod go-w $files 2>$ERRLOG; show_error; }
    dirs=`find $TEXMF/fonts/tfm $TEXMF/fonts/pk -type d -print 2>$ERRLOG`
    test -z "$dirs" || { chmod 1777 $dirs 2>$ERRLOG; show_error; }
    test -f $TEXMF/ls-R && { chmod 666 $TEXMF/ls-R 2>$ERRLOG; show_error; }
    echo 'Done.'
}

install_now()
{
    umask 022
    cls; sanity_checks
    cls; prepare_directories
    umask 0
    cls; untgz
    cls; fixperm
    umask 022
    cls; linux_which_x
    cls; locate_binaties
    cls; man_fix_texmf
    cls; opt_do_symlinks
    cls; texmfcnf_fix_texmf
    cls; texmfcnf_fix_tetexdir
    cls; update
    cls; init_tetex
    cls
    if test ! -z "$this_platform_bin"; then
        if test -z "$opt_symlinks_bin"; then
          bin=$this_platform_bin
        else
          bin=$opt_symlinks_bin
        fi

        cat <<eof
We are done with install.sh. Please run texconfig by entering

    texconfig

at your shell prompt to complete the installation. You may need to add  
the directory $bin to your PATH first.
eof
    else
        echo '                         WARNING!                              '
        echo
        echo 'Binaries for this platform are not installed. Your installation'
        echo 'is not complete. If you install the missing binaries later, make'
        echo 'sure to run texconfig to create the bases for Metafont and the'
        echo 'format files for TeX.'
    fi
    cat<<eof

There is a mailing list for discussion about the teTeX distribution:
    tetex@informatik.uni-hannover.de

If you want to subscribe to the list, send a message containing the line:   
    subscribe tetex

to majordomo@informatik.uni-hannover.de. Have fun!
eof

    exit
}

tetex_dump()
{
    test "$opt_varfonts" = X && ln -s $opt_varfonts_dir/ls-R $TEXMF
    $echon "Building filename database... "
    echo '% This is file ls-R. Maintained by texhash and append_db.' > $TEXMF/ls-R
    (cd $TEXMF; ls -LAR ./ /dev/null 2>$ERRLOG) >> $TEXMF/ls-R
    show_error
    chmod 666 $TEXMF/ls-R
    echo 'Done.'

    if test ! -z "$this_platform_bin"; then
        test "$debug" = true && { set; sleep 5; }
        $echon 'Creating mf.base and tex format files... '
        eval TEXMF=$TEXMF $this_platform_bin/texconfig init >$ERRLOG 2>&1
        show_error
        echo 'Done.'
    fi
}

init_tetex()
{
    tetex_dump
    maketex_setopt
}

update()
{
    test "$opt_update" = X || return
    echo "locating files for update option... "
    update_get_texmf
    if test -d "$opt_update_oldtexmf"; then
        echo "  old TEXMF: $opt_update_oldtexmf"
    else
        echo "  old TEXMF: not found"
    fi
    update_get_xdvi_ad
    if test -f "$opt_update_xdviad"; then
        echo "  old app-defaults file for xdvi: $opt_update_xdviad"
        rm -f $TEXMF/xdvi/XDvi
        cp "$opt_update_xdviad" $TEXMF/xdvi/XDvi
    else
        echo "  old app-defaults file for xdvi: not found"
    fi
    if test -d "$opt_update_oldtexmf/dvips"; then
        echo "  old dvips config files: $opt_update_oldtexmf/dvips"
        (cd $TEXMF/dvips && rm -f `cd "$opt_update_oldtexmf/dvips"; ls config.*`)
        cp $opt_update_oldtexmf/dvips/config.* $TEXMF/dvips
    else
        echo "  old dvips config files: not found"
    fi
}

update_get_texmf()
{
    opt_update_oldtexmf=`sed -n '/^TEXMF[ 	]*=/!d; s/.*=[ 	]*//; s/[ 	].*//; s@\$TETEXDIR@'$opt_update_olddir'@; p' $opt_update_olddir/texmf.cnf 2>/dev/null`
    test ! -d "$opt_update_oldtexmf" && opt_update_oldtexmf="$opt_update_olddir/texmf"
}

update_get_xdvi_ad()
{
    opt_update_xdviad=`find $opt_update_olddir/xdvi* $opt_update_oldtexmf \( -name XDvi -o -name XDvi.ad \) -print | sed q 2>/dev/null`
    test ! -f "$opt_update_xdviad" && opt_update_xdviad=
}

################################################################
# menus:
################################################################
menu_main()
{
    while true; do
        cls
        opt_savespace_man=X
        test "$opt_savespace_man_rm" = X || test "$opt_savespace_man_gzip" = X ||
          opt_savespace_man=' '
        textvar_show screen_1; echo
        case `getopt PSDOIHQ 'Enter command'` in
          P) menu_platform;;
          S) menu_series;;
          D) menu_directories;;
          O) menu_options;;
          I) install_now;;
          H) help help_1;;
          Q) exit_on_confirm;;
        esac
    done
}

# NEW PLATFORM: change getopt call and add a new case.
menu_platform()
{
    while true; do
        cls
        textvar_show screen_5; echo
        case `getopt N123456789ABCDRQ 'Select the platform you are currently on'` in
          N) this_platform_set '';;
          1) this_platform_set $platform_1;;
          2) this_platform_set $platform_2;;
          3) this_platform_set $platform_3;;
          4) this_platform_set $platform_4;;
          5) this_platform_set $platform_5;;
          6) this_platform_set $platform_6;;
          7) this_platform_set $platform_7;;
          8) this_platform_set $platform_8;;
          9) this_platform_set $platform_9;;
          A) this_platform_set $platform_A;;
          B) this_platform_set $platform_B;;
          C) this_platform_set $platform_C;;
          D) this_platform_set $platform_D;;
          R) return;;
          Q) exit_on_confirm;;
        esac
    done
}

menu_directories()
{
    while true; do
        cls
        textvar_show screen_2; echo
        case `getopt 12RQ 'Enter command'` in
          1) gets TETEXDIR; TETEXDIR=`dirname "$TETEXDIR/x" | sed 's@//*@/@g'`
             TEXMF=`echo $TETEXDIR/texmf | sed 's@//*@/@g'`;;
          2) gets TEXMF; TEXMF=`dirname "$TEXMF/x" | sed 's@//*@/@g'`;;
          R) return;;
          Q) exit_on_confirm;;
        esac
    done
}

menu_options()
{
    while true; do
        cls
        textvar_show screen_3; echo
        case `getopt ASMCRQ 'Enter command'` in
          A) toggle opt_varfonts
             if test "$opt_varfonts" = X; then
               cls; textvar_show screen_3; echo
               opt_varfonts_dir=$opt_varfonts_dir_last
               test -z "$opt_varfonts_dir" && opt_varfonts_dir=/var/texfonts
               gets opt_varfonts_dir 'alternate directory'
             else
               opt_varfonts_dir_last=$opt_varfonts_dir
               opt_varfonts_dir=''
             fi
             ;;
          S) toggle opt_symlinks
             if test "$opt_symlinks" = X; then
               cls; textvar_show screen_3; echo
               opt_symlinks_bin=$opt_symlinks_bin_last
               test -z "$opt_symlinks_bin" && opt_symlinks_bin=/usr/local/bin
               gets opt_symlinks_bin 'binary directory'
               opt_symlinks_man=$opt_symlinks_man_last
               test -z "$opt_symlinks_man" && opt_symlinks_man=`dirname $opt_symlinks_bin`/man
               gets opt_symlinks_man 'man directory   '
               opt_symlinks_info=$opt_symlinks_info_last
               test -z "$opt_symlinks_info" && opt_symlinks_info=`dirname $opt_symlinks_bin`/info
               gets opt_symlinks_info 'info directory  '
             else
               opt_symlinks_bin_last=$opt_symlinks_bin
               opt_symlinks_man_last=$opt_symlinks_man
               opt_symlinks_info_last=$opt_symlinks_info
               opt_symlinks_bin=''; opt_symlinks_man=''; opt_symlinks_info=''
             fi
             ;;
          M) cls; textvar_show screen_3; echo
             opt_savespace_man=' '
             opt_savespace_man_rm=' '
             opt_savespace_man_gzip=' '
             yesno 'remove nroff sources' &&
                 { opt_savespace_man_rm=X; opt_savespace_man=X; }
             yesno 'compress preprocessed manpages with gzip' &&
                 { opt_savespace_man_gzip=X; opt_savespace_man=X; }
             ;;
          C) toggle opt_update
             if test "$opt_update" = X; then
               cls; textvar_show screen_3; echo
               opt_update_olddir=$opt_update_olddir_last
               test -z "$opt_update_olddir" && test -f /usr/local/tex/texmf.cnf &&
                 opt_update_olddir=/usr/local/tex
               gets opt_update_olddir 'old TETEXDIR'
               test -f $opt_update_olddir/texmf.cnf && continue
               echo "File $opt_update_olddir/texmf.cnf does not exist."
               readln
               opt_update=' '
               opt_update_olddir=''
             else
               opt_update_olddir_last=$opt_update_olddir
               opt_update_olddir=''
             fi
             ;;
          R) return;;
          Q) exit_on_confirm;;
        esac
    done
}

menu_series()
{
    while true; do
        cls
        textvar_show screen_4; echo
        menu_series_ans=`getopt PBGFDRQ 'Enter command'`
        case "$menu_series_ans" in
          P) series=bin;;
          B) series=base;;
          G) series=goodies;;
          F) series=fonts;;
          D) series=doc;;
        esac
        case "$menu_series_ans" in
          [PBGFD])
             cls; textvar_show screen_4;
             textvar_show s_${series}_h; echo
             case `getopt ANSLC "install series $series ([A]ll, [N]o, [S]elect, [L]ist, [C]ancel)"` in
               A) series_select_all $series; nobin_stat;;
               N) series_deselect_all $series; nobin_stat;;
               S) series_usersetup $series; nobin_stat;;
               L) series_list $series;;
               C) : ;;
             esac;;
          R) return;;
          Q) exit_on_confirm;;
        esac
    done
}

package_showinfo()
{
    p=$1
    cls
    eval p_current_du=\$p_${p}_du
    eval p_current_n=\$p_${p}_n
    eval p_current_l=\$p_${p}_l
    eval p_current_v=\$p_${p}_v
    echo "Package:          $p_current_n"
    echo "Series:           $series"
    if [ ! -z "$p_current_v" ] ; then
      echo "Version:          $p_current_v"
    fi
    echo "Status:           $p_current_l"
    echo "Disk space:       $p_current_du"
    textvar_show p_${p}_h
}

series_usersetup()
{
    su_series=$1
    eval all_packages=\"\$s_${su_series}_lf\"
    for p in $all_packages; do
        package_showinfo $p
        echo
        p_current_s=false
        yesno "install package $p_current_n" && p_current_s=true
        eval p_${p}_s=$p_current_s
    done
    series_stat $su_series
}

exit_on_confirm()
{
    cls
    yesno 'Really quit' && exit
}

################################################################
# global variables
################################################################
VERSION=0.3.3
# prefix in the archives:
tetex_prefix=teTeX
TETEXDIR=/usr/local/$tetex_prefix
TEXMF=$TETEXDIR/texmf
man_texmf_old_fallback=$TEXMF
man_tetexdir_old_fallback=$TETEXDIR
TMPDIR=${TMP-/tmp}/inst.tmp.$$
ERRLOG=${TMP-/tmp}/inst.errlog.$$
: ${PAGER=more}
mt_site_loc=maketex/maketex.site
here=`pwd`

envvars='
BIBINPUTS BSTINPUTS DVIPSHEADERS GFFONTS GLYPHFONTS MFBASES MFINPUTS
MFPOOL PKFONTS TEXCONFIG TEXFONTS TEXFORMATS TEXINPUTS TEXMFCNF TEXPICTS
TEXPKS TEXPOOL TFMFONTS VFFONTS DVIPSFONTS XDVIVFS XDVIFONTS DVILJFONTS
'

opt_varfonts=' '
opt_varfonts_dir=''
opt_varfonts_dir_last=''
opt_symlinks=' '
opt_symlinks_bin=''
opt_symlinks_man=''
opt_symlinks_info=''
opt_symlinks_bin_last=''
opt_symlinks_man_last=''
opt_symlinks_info_last=''
opt_savespace_man=' '
opt_savespace_man_rm=' '
opt_savespace_man_gzip=' '
opt_update=' '
opt_update_olddir=''
opt_update_olddir_last=''

this_platform=

S_nobin_la='base goodies fonts doc'
S_all_la="$S_nobin_la bin"

#############################################################################
# The supported binaries. Add new platforms to the s_bin_la list and create
# a p_PLATFORM st structure with the following variables:
#       _d: the directory name below bin for this platform
#      _du: disk usage
#       _n: name of the package
#       -h: help text
#############################################################################

# NEW PLATFORM: add identifier.
platform_1=i486_linux
platform_2=i486_linuxaout
platform_3=m68k_linux
platform_4=m68k_linuxaout
platform_5=mips_irix53
platform_6=rs6000_aix32
platform_7=sparc_solaris24
platform_8=sparc_sunos413
platform_9=hppa11_hpux901
platform_A=alpha_osf20
platform_B=alpha_osf32
platform_C=mips_ultrix_44
platform_D=i386_netbsd10

# NEW PLATFORM: add entry in s_bin_la variable.
s_bin_la='i486_linux i486_linuxaout m68k_linux m68k_linuxaout
mips_irix53 rs6000_aix32 sparc_solaris24 sparc_sunos413 hppa11_hpux901
alpha_osf20 alpha_osf32 mips_ultrix_44 i386_netbsd10
'
s_bin_n=binaries
s_bin_d=binaries
s_bin_h='
This series contains the binaries for teTeX. There is one binary package
for each supported platform containing all teTeX binaries for that
platform.
'

# NEW PLATFORM: add p_*_{l,d,du,n,h} variables.
p_i386_netbsd10_l='optional'
p_i386_netbsd10_d='i386-netbsd1.0'
p_i386_netbsd10_du='3571'
p_i386_netbsd10_n='NetBSD/i386 1.0'
p_i386_netbsd10_h='
This package contains all binaries for NetBSD/i386 1.0 platforms.
'
p_mips_ultrix_44_l='optional'
p_mips_ultrix_44_d='mips-ultrix4.4'
p_mips_ultrix_44_du='7920'
p_mips_ultrix_44_n='Mips ULTRIX 4.4 (RISC)'
p_mips_ultrix_44_h='
This package contains all binaries for Mips ULTRIX 4.4 (RISC) platforms.
'
p_m68k_linuxaout_l='optional'
p_m68k_linuxaout_d='m68k-linuxoldld'
p_m68k_linuxaout_du='2780'
p_m68k_linuxaout_n='Linux 68k (a.out)'
p_m68k_linuxaout_h='
This package contains all binaries for Linux 68k (a.out) platforms.
'
p_m68k_linux_l='optional'
p_m68k_linux_d='m68k-linux'
p_m68k_linux_du='2720'
p_m68k_linux_n='Linux 68k (ELF)'
p_m68k_linux_h='
This package contains all binaries for Linux 68k (ELF) platforms.
The binaries are in ELF format and need ld.so version 1.7.3 or higher and
libc version 5.0.9 or higher.
'
p_alpha_osf32_l='optional'
p_alpha_osf32_d='alpha-osf3.2'
p_alpha_osf32_du='6150'
p_alpha_osf32_n='DEC OSF/1 V3.2 Alpha-AXP'
p_alpha_osf32_h='
This package contains all binaries for DEC OSF/1 V3.2 Alpha-AXP platforms.
'
p_alpha_osf20_l=optional
p_alpha_osf20_d=alpha-osf2.0
p_alpha_osf20_du=6251
p_alpha_osf20_n='DEC OSF/1 V2.0 Alpha'
p_alpha_osf20_h='
This package contains all binaries for DEC OSF/1 V2.0 Alpha platforms.
'
p_hppa11_hpux901_l=optional
p_hppa11_hpux901_d=hppa1.1-hpux9.01
p_hppa11_hpux901_du=5767
p_hppa11_hpux901_n='HP-UX 9.01 9000/710'
p_hppa11_hpux901_h='
This package contains all binaries for HP-UX 9.01 9000/710 platforms.
'
p_i486_linux_l=optional
p_i486_linux_d=i486-linux
p_i486_linux_du=2976
p_i486_linux_n='Linux Intel x86 (ELF)'
p_i486_linux_h='
This package contains all binaries for Linux on x86 machines.
The binaries are in ELF format and need ld.so version 1.7.3 or higher and
libc version 5.0.9 or higher.
'
p_i486_linuxaout_l=optional
p_i486_linuxaout_d=i486-linuxaout
p_i486_linuxaout_du=3295
p_i486_linuxaout_n='Linux Intel x86 (a.out)'
p_i486_linuxaout_h='
This package contains all binaries for Linux on x86 machines.
The binaries are in the old a.out format and need version 4 of the
C library (e.g. libc-4.6.26).
'
p_mips_irix53_l=optional
p_mips_irix53_d=mips-irix5.3
p_mips_irix53_du=7038
p_mips_irix53_n='SGI Irix 5.3'
p_mips_irix53_h='
This package contains all binaries for SGI Indigo machines running
Irix-5.3.
'
p_rs6000_aix32_l=optional
p_rs6000_aix32_d=rs6000-aix3.2
p_rs6000_aix32_du=4604
p_rs6000_aix32_n='IBM RS6000 AIX 3.2'
p_rs6000_aix32_h='
This package contains all binaries for IBM RS600 machines running
AIX 3.2.
'
p_sparc_solaris24_l=optional
p_sparc_solaris24_d=sparc-solaris2.4
p_sparc_solaris24_du=4078
p_sparc_solaris24_n='SUN Sparc Solaris 2.4'
p_sparc_solaris24_h='
This package contains all binaries for SUN Sparcs running Solaris 2.4.
'
p_sparc_sunos413_l=optional
p_sparc_sunos413_d=sparc-sunos4.1.3
p_sparc_sunos413_du=4435
p_sparc_sunos413_n='SUN Sparc SunOS 4.1.3'
p_sparc_sunos413_h='
This package contains all binaries for SUN Sparcs running SunOS 4.1.3.
'

s_base_n=base
s_base_d=base
s_base_h='
This series contains the most basic packages that are needed for the
basic functionality of teTeX and a minimal LaTeX system.
'
s_base_la='tetex_base latex_base'

s_goodies_n=goodies
s_goodies_d=goodies
s_goodies_la='latex_extra amstex bibtex xtexsh pictex'
s_goodies_h='
This series contains some additional packages: XTeXShell, AMSTeX, PiCTeX,
BibTeX and LaTeX-extra. Note that most LaTeX add-ons are contained in the
LaTeX-extra package of this series.
'

s_fonts_n=fonts
s_fonts_d=fonts
s_fonts_la='dc_fonts gothic_fonts pandora_fonts urw_fonts wasy_fonts adobe_fonts ams_fonts bitstrea_fonts concrete_fonts'
s_fonts_h='
This series contains font packages: DC, oldgerman, pandora, wasy, AMS, concrete
and support for PostScript fonts from URW, Bitstream and Adobe.
'

s_doc_n=documentation
s_doc_d=doc
s_doc_la='dcfonts_doc eplain_doc general_doc german_doc fontname_doc latex_doc oldgerman_doc texdraw_doc ams_doc programs_doc babel_doc bibtex_doc makeindex_doc'
s_doc_h='
This series contains a lot of documentation about teTeX and the packages
it contains. The whole series contains over 100 dvi files plus TeX-FAQ
and some other documentation.
'

#############################################################################
# packages:
#############################################################################

p_latex_base_l=required
p_tetex_base_l=required
p_ams_doc_l=optional
p_babel_doc_l=optional
p_bibtex_doc_l=optional
p_dcfonts_doc_l=optional
p_eplain_doc_l=optional
p_fontname_doc_l=optional
p_general_doc_l=recommended
p_german_doc_l=optional
p_programs_doc_l=recommended
p_latex_doc_l=recommended
p_makeindex_doc_l=optional
p_oldgerman_doc_l=optional
p_texdraw_doc_l=optional
p_adobe_fonts_l=optional
p_ams_fonts_l=recommended
p_bitstrea_fonts_l=optional
p_concrete_fonts_l=optional
p_dc_fonts_l=recommended
p_gothic_fonts_l=optional
p_pandora_fonts_l=optional
p_urw_fonts_l=optional
p_wasy_fonts_l=recommended
p_amstex_l=optional
p_pictex_l=optional
p_bibtex_l=recommended
p_latex_extra_l=recommended
p_xtexsh_l=optional

p_latex_base_d=latex-base
p_latex_base_du=1360
p_latex_base_n='LaTeX base'
p_latex_base_v='<1995/06/01> patch level 3'
p_latex_base_h='
This package contains a minimal set of macros to use the LaTeX format.
If you really want to use LaTeX regularly, you should install the LaTeX
extra package as well.
'
p_tetex_base_d=tetex-base
p_tetex_base_du=4315
p_tetex_base_n='teTeX base'
p_tetex_base_h='
This package contains the most basic input files for teTeX: runtime
configuration files, hyphenation tables, manpages and the computer
modern fonts.
'
p_ams_doc_d=ams-doc
p_ams_doc_du=675
p_ams_doc_n='AMS documentation'
p_ams_doc_h='
This package contains documentation for the AMS (= american mathematical
society) fonts, AMSLaTeX and AMSTeX. A good thing, if you need lots of
math in your documents.
'
p_babel_doc_d=babel-doc
p_babel_doc_du=805
p_babel_doc_n='Babel documentation'
p_babel_doc_h='
This package contains documentation for the babel system. Babel is a
package to support multiple languages in plain TeX and LaTeX.
'
p_bibtex_doc_d=bibtex-doc
p_bibtex_doc_du=165
p_bibtex_doc_n='BibTeX documentation'
p_bibtex_doc_h='
This package contains documentation for the BibTeX programm. BibTeX is
a tool to make a bibliography for (La)TeX.
'
p_dcfonts_doc_d=dcfonts-doc
p_dcfonts_doc_du=45
p_dcfonts_doc_n='DC fonts documentation'
p_dcfonts_doc_h='
This package contains documentation about the DC fonts (in french, english,
german) and about the Corc encoding (in german).
'
p_eplain_doc_d=eplain-doc
p_eplain_doc_du=360
p_eplain_doc_n='eplain documentation'
p_eplain_doc_h='
This package contains documentation for the extended plain format (eplain).
'
p_fontname_doc_d=fontname-doc
p_fontname_doc_du=220
p_fontname_doc_n='Filenames for TeX Fonts'
p_fontname_doc_v=1.94
p_fontname_doc_h='
This package contains the \"Filenames for TeX Fonts\" document from Karl
Berry. It describes a scheme to find filenames for font files.
'
p_general_doc_d=general-doc
p_general_doc_du=679
p_general_doc_n='General documentation'
p_general_doc_h='
This package contains some general information about TeX: the TeX-FAQ, a
list of ftp servers and a draft for the TeX Directory Standard (TDS).
'
p_german_doc_d=german-doc
p_german_doc_du=710
p_german_doc_n='german documentation'
p_german_doc_h='
This package contains some documentation in german about: letter styles
(dinbrief, g-brief), LaTeX packages (koma-script, script, picinpar,
german.sty) and a short introduction into LaTeX2e.
'
p_programs_doc_d=programs-doc
p_programs_doc_du=658
p_programs_doc_n='Kpathsea documentation'
p_programs_doc_h='
This package contains documentation about the Kpathsea library and some
programmes (dvipsk, info, makeinfo). The Kpathsea library is used by some
programmes in teTeX to locate files on the disk. Its most important
features are the filename database (ls-R) (speeds up recursive directory
searches), runtime configuration (search paths can be set up in file)
and automatic font generation.
'
p_latex_doc_d=latex-doc
p_latex_doc_du=3255
p_latex_doc_n='LaTeX documentation'
p_latex_doc_h='
This package contains documentation for LaTeX: over 70 dvi files and some
examples.
'
p_makeindex_doc_d=makeindex-doc
p_makeindex_doc_du=110
p_makeindex_doc_n='Makeindex documentation'
p_makeindex_doc_h='
This package contains documentation for the Makeindex program.
'
p_oldgerman_doc_d=oldgerman-doc
p_oldgerman_doc_du=45
p_oldgerman_doc_n='oldgerman documentation'
p_oldgerman_doc_h='
This package contains documentation for some old german fonts.
'
p_texdraw_doc_d=texdraw-doc
p_texdraw_doc_du=270
p_texdraw_doc_n='TeXdraw documentation'
p_texdraw_doc_h='
This package contains documentation for the TeXdraw package. It allows to
use PostScript graphics within TeX documents.
'
p_adobe_fonts_d=adobe-fonts
p_adobe_fonts_du=2810
p_adobe_fonts_n='Adobe fonts'
p_adobe_fonts_h='
This package contains support files to use some PostScript fonts from
Adobe within (La)TeX.
'
p_ams_fonts_d=ams-fonts
p_ams_fonts_du=2180
p_ams_fonts_n='AMS fonts'
p_ams_fonts_h='
This package contains the AMS fonts.
'
p_bitstrea_fonts_d=bitstrea-fonts
p_bitstrea_fonts_du=400
p_bitstrea_fonts_n='Bitstream fonts'
p_bitstrea_fonts_h='
This package some PostScript fonts from Bitstream and support files to
use them within (La)TeX.
'
p_concrete_fonts_d=concrete-fonts
p_concrete_fonts_du=70
p_concrete_fonts_n='Concrete fonts'
p_concrete_fonts_h='
This package contains the Concrete fonts. These fonts are designed by D.E.
Knuth and he used them for typesetting the book "Concrete Mathematics".
'
p_dc_fonts_d=dc-fonts
p_dc_fonts_du=1110
p_dc_fonts_n='DC fonts'
p_dc_fonts_h='
This package contains the DC fonts. These are full 256 character fonts
containing lots of national characters.
'
p_gothic_fonts_d=gothic-fonts
p_gothic_fonts_du=905
p_gothic_fonts_n='old german fonts'
p_gothic_fonts_h='
This package contains some "old german" fonts.
'
p_pandora_fonts_d=pandora-fonts
p_pandora_fonts_du=335
p_pandora_fonts_n='Pandora fonts'
p_pandora_fonts_h='
This package contains the Pandora fonts.
'
p_urw_fonts_d=urw-fonts
p_urw_fonts_du=485
p_urw_fonts_n='URW fonts'
p_urw_fonts_h='
This package some PostScript fonts from URW and support files to
use them within (La)TeX.
'
p_wasy_fonts_d=wasy-fonts
p_wasy_fonts_du=135
p_wasy_fonts_n='WASY fonts'
p_wasy_fonts_h='
This package contains the symbol font WASY.
'
p_amstex_du=160
p_amstex_n='AMSTeX'
p_amstex_h='
This package contains the AMSTeX package. AMSTeX is an extension of the
plain TeX format with better support of mathematics and easy access to
the AMS fonts.
'
p_pictex_d=pictex
p_pictex_du=279
p_pictex_n='PiCTeX'
p_pictex_h='
This package contains the PiCTeX macros to draw portable pictures with
TeX and LaTeX.
'
p_bibtex_du=220
p_bibtex_n='BibTeX'
p_bibtex_h='
This package contains some support files for the BibTeX program.
BibTeX is a tool to make a bibliography for (La)TeX.
'
p_latex_extra_d=latex-extra
p_latex_extra_du=2215
p_latex_extra_n='LaTeX extra'
p_latex_extra_h='
This package contains a lot of extra packages for LaTeX: the tools, graphics,
amslatex, mfnfss, psnfss packages and many more...
'
p_xtexsh_du=1320
p_xtexsh_n='XTeXShell'
p_xtexsh_h='
This package contains the XTeXShell, a system independent X-Windows
shell for TeXing, where you do not need to care about program calls,
operating system dependencies and other stuff. It has a built-in editor
(similar to the IDE of some Borland products) and on-line help for LaTeX
commands. This package requites Tcl(7.3), Tk(3.6) and TclX(7.3) to be
installed.
'

################################################################
# screens:
################################################################
screen_1='====================> teTeX $VERSION installation procedure <====================

    <P> this platform: $this_platform_n

    <S> series:
          binaries:           $s_bin_ns out of $s_bin_nf, disk space required: $s_bin_dus kB
          other (summary):    $S_nobin_ns out of $S_nobin_nf, disk space required: $S_nobin_dus kB
                                               total disk space: $s_total_dus kB

    <D> directories:
          TETEXDIR = $TETEXDIR
          TEXMF    = $TEXMF

    <O> options:
          [$opt_varfonts] alternate directory for automatically generated fonts
          [$opt_symlinks] create symlinks in standard directories
          [$opt_savespace_man] save space for manpages
          [$opt_update] update

    Other commands:
          <I> start installation,  <H> help,  <Q> quit

'

screen_2='Current directories setup:
==============================================================================

  <1>  TETEXDIR:     $TETEXDIR
  <2>  TEXMF         $TEXMF

Other options:
==============================================================================
  <R>   return to main menu
  <Q>   quit
'

screen_3='Current options setup:
==============================================================================

  <A>  alternate directory for automatically generated fonts: [$opt_varfonts]
         directory name: $opt_varfonts_dir
  <S>  create symlinks in standard directories:               [$opt_symlinks]
            binaries to: $opt_symlinks_bin
            manpages to: $opt_symlinks_man
                info to: $opt_symlinks_info
  <M>  save space for manpages                                [$opt_savespace_man]
          remove nroff sources                          [$opt_savespace_man_rm]
          compress preprocessed manpages with gzip      [$opt_savespace_man_gzip]
  <C>  use configuration (xdvi/dvips) from a previous teTeX installation   [$opt_update]
           old TETEXDIR: $opt_update_olddir

Other options:
==============================================================================
  <R>   return to main menu
  <Q>   quit
'

screen_4='Current series setup:
==============================================================================
  <P>   platforms: $s_bin_ns out of $s_bin_nf, disk space required: $s_bin_dus kB
  <B>   base:      $s_base_ns out of $s_base_nf, disk space required: $s_base_dus kB
  <G>   goodies:   $s_goodies_ns out of $s_goodies_nf, disk space required: $s_goodies_dus kB
  <F>   fonts:     $s_fonts_ns out of $s_fonts_nf, disk space required: $s_fonts_dus kB
  <D>   doc:       $s_doc_ns out of $s_doc_nf, disk space required: $s_doc_dus kB
                                    total disk space: $s_total_dus kB

==============================================================================
  <R>   return to main menu
  <Q>   quit
'

# NEW PLATFORM: change the screen:
screen_5='Current platform: $this_platform_n
==============================================================================
  <N>  none of the entries below
  <1>  $p_i486_linux_n
  <2>  $p_i486_linuxaout_n
  <3>  $p_m68k_linux_n
  <4>  $p_m68k_linuxaout_n
  <5>  $p_mips_irix53_n
  <6>  $p_rs6000_aix32_n
  <7>  $p_sparc_solaris24_n
  <8>  $p_sparc_sunos413_n
  <9>  $p_hppa11_hpux901_n
  <A>  $p_alpha_osf20_n
  <B>  $p_alpha_osf32_n
  <C>  $p_mips_ultrix_44_n
  <D>  $p_i386_netbsd10_n

==============================================================================
  <R>   return to main menu
  <Q>   quit
'

screen_6='teTeX can be used on multiple platforms by having a subdirectory for each
installed binary package in $TETEXDIR/bin.

However, if you do not plan to add binaries for other platforms to
your teTeX installation, your binaries can directly be put into the
$TETEXDIR/bin directory.'

help_1='
This is the installation program of the teTeX distribution.

The installation procedure is really simple: just go through the
menus and select "start installation" if all options are set up
all right.

To select a menu item (a letter or a number makred with brackets)
just enter the corresponding letter or number and press return
(the letters are case insensitive).

Right now, the each menu item is explained in detail:

======================================================================
  The platform menu (<P>)
======================================================================

Here, you can tell the installation script, which binaries can run on
your machine. If the correct platform is selected and you install the
package with the binaries for that platform, the script does some
post-installation steps automatically. Otherwise, the necessary commands
are displayed afer the installation. You can execute these commands
later, e.g. after creating the binaries by compiling the sources on your
machine.

======================================================================
  The series menu (<S>)
======================================================================

The series menu allows you to select and deselect packages. The
packages are grouped in some series:

  binaries: you need one binary package for each platform you use
  base:     this series contains a minimal TeX+LaTeX system

All other series are "add-ons":

  goodies:  useful extra stuff, including much about LaTeX
  fonts:    many extra fonts: amsfonts, PostScript fonts, DC, ...
  doc:      much documentation. But one cannot have enough, right?

======================================================================
  The directories menu (<D>)
======================================================================

The teTeX distribution will be installed in a directory of your choice.
This directory is called TETEXDIR. You may choose any directory you like
since there are no absolute paths compiled into the binaries. Instead, a
extension of the Kpathsea library is used (selfdir extension) and all
paths are relative to the location of the binaries.

The platform independend files are stored in a directory tree called
TEXMF. TEXMF defaults to TETEXDIR/texmf, but you can change this, if you
want (many systems use /ust/lib/texmf or /usr/local/lib/texmf)

======================================================================
  The options menu (<O>)
======================================================================

The options are optional part of the installation, as they are not
always applicable or useful.

"alternate directory":
======================

If you choose an alternate directory for automatically generated fonts,
you can mount your TEXMF tree readonly (as long as you do not want to
perform administrative tasks: change configuration, install new inputs
and the like).

There are two good reasons to do this:
  - TEXMF is in your /usr partition and you want to mount it readonly
    (or in another partition that you mount readonly)
  - TEXMF will be accessable via NFS and you do not want to give
    write permissions to your NFS clients

If the second case applies to you, please note that the filename
database (ls-R) and the automatically generated fonts will be installed
in the alternate directory you choose. If this directory is local to
each client, you need to run texhash on each machine to build the
filename database there. Another disadvantage is that new fonts are not
shared in that case.


"symlinks in standard directories"
==================================

To make your binaries, manpages and infopages available to your system,
there are two common ways:
  1) install them in "standard places" that are searched for these files
  2) change your search paths to include the new directories

If you select the "symlinks" option, symbolic links will be installed in
the directories you choose. Note that if you share the teTeX installation
accross several machines via NFS and if the chosen "standard places" are
not shared, you need to create the symbolic links on each client, too
(or use method 2 on your clients).

If you do not use the "symlinks" option, you propably need to set up
your search paths (PATH, MANPATH, INFOPATH).


"save space for manpages"
=========================

Remove the sources for the manpages, if you do not want to keep them
(the distribution contains preprocessed manpages).

You may compress the preprocessed manpages with gzip, if your system
supports this.


"use configuration from a previous teTeX installation"
======================================================

If you have an old version of teTeX, you may consider using some
configuration files from the old system and thus save the time for
reconfiguring. This option supports the xdvi and dvips configuration
(papertypes, modes, paper offsets for printers,...), but not your
hyphenation tables for (La)TeX.

======================================================================
  Other commands (<I>, <H> and <Q>
======================================================================

Well, this is easy to explain:
  <I> starts the installation after you are confident with set setup
  <H> displays this help
  <Q> quits the installation program
'


#debug=true
debug=

################################################################
# main()
################################################################
init
menu_main
                                                                                                                                                                                         =============================================================================

	teTeX-0.3.3 installation instructions (compiling the sources)

=============================================================================

  1) getting the files
  2) make sure to have recent versions of gcc, GNU-make and flex
  3) install the inputs-tree
  4) unpack the sources and apply patches (if there are any):
  5) adjust the Makefile
  6) run make
  7) post installation steps
  A) appendix: notes on some platforms

=============================================================================
  1) getting the files
============================================================================

What you need:
    sources/teTeX-src-0.3.3.tar.gz  # the sources
    sources/teTeX-src-patch-*.gz    # all patches (if available)
    sources/teTeX-lib-0.3.3.tar.gz  # the lib-tree with the fonts, macros, ...

Instead of the complete lib-tree, you can get the smaller files with
fonts, documentation, ... from teh other subdirectories. See INSTALL.bin
for notes on installing these files. You do not need to install binaries
when installing via INSTALL.bin.

============================================================================
  2) make sure to have recent versions of gcc, GNU-make and flex
============================================================================

To compile teTeX, you need gcc, flex and a recent version of GNU make.
gcc-2.5.8, flex-2.4.7 and GNU make-3.72.1 or newer should be ok.

============================================================================
  3) install the inputs-tree
============================================================================

Unpack teTeX-lib-0.3.3.tar.gz at its "final" destination, e.g.

	cd /usr/local
	gzip -dc /usr/local/src/teTeX-lib-0.3.3.tar.gz | tar xpvf -

You may choose a different directory instead of /usr/local and you may
rename the teTeX directory. Just make sure to have the TETEXDIR
variable in the top-level Makefile right before starting make.

Note: if you omnit the "p" option of tar, you may have trouble with
      permissions later.

If you install the smaller packages from the base, fonts, doc and goodies
directories, use install.sh (see INSTALL.bin for details).

============================================================================
  4) unpack the sources and apply patches (if there are any):
============================================================================

Unpack the sources, e.g.:
	cd /usr/local/src
	gzip -dc teTeX-src-0.3.3.tar.gz | tar xpvf -
Apply patches:
	gzip -dc teTeX-src-0.3.3-patch-* | patch -p0 -s

NOTE: if you unpack as root on a SYSV system, you need to chown -R
  afterwards, to fix wrong ownerships.

============================================================================
  5) adjust the Makefile
============================================================================

Have a look at the Makefile and adjust what needs to be adjusted. E.g.:

	cd teTeX-src-0.3.3
	vi Makefile

============================================================================
  6) run make
============================================================================

Type "make world" and relax :-)

This is equivalent to
  make config clean texhash all install ini

If you need special previleges for 'make install' and 'make ini', you can
run two make in two separate runs:
  make config clean texhash all
  su
  make install ini

If you install for a second, third, ... platform, you can omit the 'texhash'
and 'ini' targets and simply run:
  make config clean all
  make install

Please note that calling make with an absolute path breaks the configure
scripts.

The following example _does_not_work_:
	/usr/local/bin/make world
	...
	checking whether /usr/local/bin/make sets $MAKE... ./configure:
	${ac_cv_prog_make_/usr/bin/make_set+set}: bad substitution
	...

============================================================================
  7) post installation steps
============================================================================

Set up your PATH and run texconfig (you may want to set up MANPATH and
INFOPATH as well). Note that the search paths for all programs that use
the Kpathsea library can be configured by changing the paths in
TETEXDIR/texmf.cnf.

=============================================================================
 A) appendix: notes on some platforms
=============================================================================

SGI-IRIX-6.0.1: (reported by bottoms@radar.nrl.navy.mil (Maitland Bottoms))
	successfully compiled using:
		CC=cc
		CFLAGS=-O2 -s -32
		LDFLAGS=-s -32


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  This is version 0.3.3 of teTeX, a TeX distribution for UNIX.

===========================================================================
 Here - in short - the main features of teTeX, as listed in the file
 FEATURES:
===========================================================================

Main features of the teTeX distribution:

- file organisation orientated at the upcoming TDS (TeX Directory Standard)
- very easy to install and customize (install.sh and texconfig utility)
- LaTeX2e (June 1995) patch level 3 together with lots of
  extra LaTeX packages (most packages mentioned in the LaTeX Companion)
- much documentation: more than 100 dvi-files, teTeX manual, teTeX FAQ and
  TeX FAQ
- support for read-only inputs tree (i.e. possible to use alternate
  destination for newly created fonts)
- ready for a multi platform setup
- fast file searching. web2c was patched to work with kpathsea-2.6. The
  search paths are chosen to give high performance.
- run-time configuration files for dvi-drivers and tex+friends.
- a nice set of fonts to play with: PostScript fonts, ams, pandora, cm,
  dc, oldgerman. All easily accessable by LaTeX.
- the whole distribution can be installed anywhere in the
  filesystem (e.g. /usr/TeX or /usr/local/tex). You do not
  need to set any environment variable as long as you keep
  the original structure of the package.
- mailing list for discussion: tetex@informatik.uni-hannover.de

===========================================================================
 Included packages:
===========================================================================

Programs:
  web2c:       tex, mf, bibtex, gftopk, ...
  dvi drivers: xdvi, dvips, dvilj, dvilj2p, dvilj4, dvilj4l
  texinfo:     info, makeinfo, texindex, ...
  scripts:     dvi2fax, dvihp, ps2frag (perl), xtexsh (tclX-7.3),
               fontimport, fontexport, texconfig, allneeded, allcm,
               alldc, ...
  others:      makeindex, kpsetool, gsftopk, ps2pk, afm2tfm, ...

Macro packages (La)TeX:
  amsfonts amslatex amstex babel dinbrief eepic eplain eplain
  fancyheadings foiltex g-brief graphics koma-script labels mflogo
  mfnfss minitoc myletter ntgclass pictex psfrag psnfss seminar
  supertabular texinfo textmerg tools umlaute wasysym

  +lots of one-file packages (e.g. calc.sty, rotating.sty, ...)

Supported fonts:
  avantgar bookman courier helvetic mathptm ncntrsbk palatino symbol
  times utopia zapfchan zapfding cyrillic euler extracm symbols charter
  cm concrete dc gothic latex mflogo misc pandora wasy antiqua grotesq
  nimbus

===========================================================================
 Documentation
===========================================================================

There is the teTeX manual (TETEXDOC.dvi) a teTeX FAQ (FAQ-teTeX) and
lots of documentation for the included programs and macros.

===========================================================================
 Installation
===========================================================================

To install teTeX follow the instructions in
  INSTALL.src: if you want to compile the binaries yourself
  INSTALL.bin: if you want to use precompiled binaries.

===========================================================================
 mailing list:
===========================================================================

There exists a mailing-list for teTeX (tetex@informatik.uni-hannover.de).

Get help with:
	echo help | mail majordomo@informatik.uni-hannover.de

To subscribe the tetex list, do:
	echo subscribe tetex | mail majordomo@informatik.uni-hannover.de

Get an archive of the list:
	echo get tetex archive | mail majordomo@informatik.uni-hannover.de

===========================================================================
 Copyright License: GNU GPL Version 2 (or later)
===========================================================================

Please send feedback to the autor:

	Thomas Esser
	Email: te@informatik.uni-hannover.de

	07.08.1995
                                                                                         There are too many changes from teTeX-0.2.2 to teTeX-0.3.3. Here are
the ones, I still remember:

- from Knuth (TeX95): TeX 3.14159, Metafont 2.718, CM fonts update
- LaTeX2e <1995/06/01> patch level 3
- xdvi find its app-defaults via XAPPLRESDIR variable (no link in
  /usr/lib/X11/app-defaults or whatever necessary)
- new babel system
- new PostScript font setup
- texconfig and MakeTeX{PK,TFM} are rewritten:
	texconfig can now be used to configure MakeTeX{PK,TFM}
	texconfig can set a global default mode (xdvi/dvips/mf/MakeTeXTFM)
	texconfig can run in batch mode
	dvips can be configured to save to a file by default
- psfrag added (needs perl)
- ps2pk added
- mathptm fonts. Theese math fonts look much better with times than the
  standard Computer Modern Math fonts.
- more TDS (TeX Directory Standard) compliant (see texmf/doc/help/tds.dvi)
- gsftopk now works with gs3.X, but gs2.6.2 is still recommended
- shell scripts ported to run with /bin/sh on most UNIX systems
  (/bin/sh5 on Ultrix)
- some new LaTeX packages
- some more documentation
- fontimport improved
- new scripts: allneeded, dvihp (replaces dvilj)
- dvilj driver for Laserjer 2 compatible printers
- font directory tree conforms to TDS (TeX Directory Standard) and
  fontname-2.0 specifications
- virmf.X with X11 support, virmf without
- now uses Kpathsea-2.6 and newer drivers:
	dvipsk-5.58f
	xdvik-18f
	dviljk-2.5
	gsftopkk-1.10
- automatic font generation via lpd on Linux now works
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      F ANNOUNCE.;1                       	ANNOUNCE
D BASE                              	base
D BINARIES                          	binaries
F CHECKSUM.;1                       	CHECKSUMS
D DOC                               	doc
F FAQ-TETE.;1                       	FAQ-teTeX
F FEATURES.;1                       	FEATURES
D FONTS                             	fonts
D GOODIES                           	goodies
F INSTALL.BIN;1                     	INSTALL.bin
F INSTALL.SH;1                      	install.sh
F INSTALL.SRC;1                     	INSTALL.src
F README.;1                         	README
F RELEASE-.3;1                      	RELEASE-0.3.3
D SOURCES                           	sources
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               #!/bin/sh

#RISC:ULTRIX:4.4:0
#6830
#mips-ultrix4.4

################################################################
# Basic IO:
################################################################

################################################################
# read: called with the name of a variable and (optionally) a
#       different message text. Keeps the old value of the
#       variable, if the empty string in entered.
################################################################
gets()
{
    gets_var=$1; gets_text=${2-$gets_var}
    eval old=\$$gets_var
    eval $echon \""New value for $gets_text [$old]: "\"
    read $gets_var
    eval test -z \"\$$gets_var\" && eval $gets_var=\'$old\'
}

################################################################
# getopt: get a menu choice.
#   $1: string with valid characters
#   $2: message for prompting
################################################################
getopt()
{
    chars=$1; msg=$2
    while true; do
        #$echon "$msg ([$chars]): "
        $echon "$msg: " >&2
        read ans
        ans=`echo $ans | tr '[a-z]' '[A-Z]'`
        case "$ans" in
          [$chars])
            echo "$ans"
            return
        esac
    done
}

################################################################
# toolge: given the name of a variable, toogle switches between
#         the values ' ' and X.
################################################################
toggle()
{
    if eval test \"\$$1\" = X; then
        eval $1=\' \'
    else
        eval $1=X
    fi
}

################################################################
# This tricky function displays the value of a variable that can
# contain newline characters. Variables will be expanded, too.
# Arguments:
#       1: the name of the variable
################################################################
textvar_show()
{
    OLDIFS=$IFS; IFS='';
    eval echo \"`eval echo \\$${1}`\"
    IFS=$OLDIFS
}

readln()
{
    $echon 'Press return to continue... '
    read foo
}

help()
{
    var=$1
    cls
    textvar_show $var 2>&1 | $PAGER
    echo
    readln
}

################################################################
# Use the yesno functions to ask the user a simple yes/no
# question.
# Arguments:
#   $1: test to display for the question (" (Y/N)? " will
#       automatically be appended).
################################################################
yesno()
{
    while true; do
    $echon "$1 (Y/N)? "
    read ans
    case $ans in
        y|Y)    return 0;;
        n|N)    return 1;;
        esac
    done
}

################################################################
# A set of functions the might do an echo without linefeed in
# the end. Function find_echo sets the variable "echon" to a
# suitable function.
################################################################
echo_a() { echo      -n "$@";   }
echo_b() { echo         "$@\c"; }
echo_c() { echo      -e "$@\c"; }
echo_d() { /bin/echo -n "$@";   }
echo_e() { /bin/echo    "$@\c"; }
echo_f() { /bin/echo -e "$@\c"; }

################################################################
# Test which of the above functions does the trick. We set
# the variable "echon" to the first function that works
# correctly.
################################################################
find_echo()
{
    for i in a b c d e f; do
        test "`echo_$i c``echo_$i a`"  = ca && echon=echo_$i && return
    done
    echon=echo
}


################################################################
# series and packages management:
################################################################

###############################################################################
# The series structure:
#  s_${series}_la:   "list of all packages"
#  s_${series}_lf:   "list of packages we found on the disk"
#  s_${series}_ls:   "list of selected packages"
#  s_${series}_mis:  "list of packages that are missing"
#  s_${series}_nf:   "number of packages we find"
#  s_${series}_ns:   "number of selected packages"
#  s_${series}_nmis: "number of packages that are missing"
#  s_${series}_du:   "disk space usage of all packages found"
#  s_${series}_dus:  "disk space usage of selected packages"
#  s_${series}_h:    "help text"
###############################################################################

###############################################################################
# The package structure:
#  p_${package}_n:  "the name of the package"
#  p_${package}_s:  "is the package selected?"
#  p_${package}_l:  "level: required, recommended or optional"
#  p_${package}_da: "did we find the package?"
#  p_${package}_fn: "the filename of a package the we found"
#  p_${package}_h:  "help text"
###############################################################################

allseries_locate()
{
    for al_series in $S_all_la;
    do
        series_locate $al_series;
    done
}

allseries_locate_check()
{
    notall=false
    hasbin=false
    test "$this_platform" != "" &&
        eval test \"\$p_${this_platform}_da\" = true &&
        hasbin=true
    for alc_series in $S_all_la; do
        test $alc_series = bin && $hasbin && continue
        eval alc_all_packages=\"\$s_${alc_series}_la\"
        for alc_p in $alc_all_packages; do
          if eval test \"\$p_${alc_p}_da\" = false; then
            notall=true
            eval echo \""Warning: package not found: \${p_${alc_p}_d-$alc_p} (series: $alc_series)."\"
          fi
        done
    done
    if test "$notall" = true; then
        echo
        echo "Notice: ignore the warnings, if the packages are missing intentionally."
        echo
        $echon "Press return to continue or Control-C to abort... "
        read foo
    fi
}

series_locate()
{
    sl_series=$1
    eval sl_all_packages=\"\$s_${sl_series}_la\"
    eval dft_dir=\"\$s_${sl_series}_d\"
    lf=; mis=; nmis=0; nf=0
    for sl_p in $sl_all_packages; do
        eval bn=