#!/bin/sh
#item   ####description                                      ###on off ###
TMP=/var/log/setup/tmp
if [ ! -d $TMP ]; then
  mkdir -p $TMP
fi
cat /dev/null > $TMP/SeTnewtag
dialog --title "SELECTING BINARY/MACRO PACKAGES FROM SERIES T (teTeX)" \
       --checklist "Use this menu to select the BINARY and MACRO packages you \
wish to install for series T (The teTeX distribution). Use the \
UP/DOWN keys to scroll through the list, and the SPACE key to toggle packages \
on or off. RECOMMENDED and REQUIRED packages have been preselected. REQUIRED \
packages have also been marked with a [*]. \
Press ENTER when you are \
done." 21 70 9 \
"te_ams" "AMStex" "on" \
"te_base" "teTeX base package *" "on" \
"te_bin" "teTeX binaries *" "on" \
"tm_lt" "Base LaTeX package *" "on" \
"tm_bibt" "BibTeX: maintain bibliographies" "on" \
"tm_eplai" "extended plain TeX" "on" \
"tm_lxtra" "LaTeX extra packages" "on" \
"tm_metap" "MetaPost" "off" \
"tm_pictx" "PicTeX" "off" \
"tm_pstr" "PS Tricks" "off" \
"tm_tdraw" "TeXdraw" "on" \
"tm_xypic" "XY-pic" "off" \
"tb_trans" "transfig (used by xfig)" "off" \
"tb_xfig" "drawing tool for LaTeX" "off" \
2> $TMP/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
 rm -f $TMP/SeTpkgs
 > $TMP/SeTnewtag
 for pkg in tb_trans tb_xfig td_bibt td_eplai td_fonts td_misc td_mkidx \
  tf_sautr tm_bibt tm_eplai td_gnric tf_dc tm_metap tm_pictx tm_tdraw \
  td_ltex td_metap tm_pstr td_progs te_ams te_base \
  tm_lt te_bin tf_misc tm_xypic tm_lxtra tf_ps ; do
  echo "$pkg: SKP" >> $TMP/SeTnewtag
 done
 exit
fi
cat /dev/null > $TMP/SeTnewtag
for PACKAGE in te_ams te_base te_bin tm_lt tm_bibt \
tm_eplai tm_lxtra tm_metap tm_pictx tm_pstr tm_tdraw tm_xypic \
tb_trans tb_xfig ; do
 if fgrep \"$PACKAGE\" $TMP/SeTpkgs 1> /dev/null 2> /dev/null ; then
  echo "$PACKAGE: ADD" >> $TMP/SeTnewtag
 else
  echo "$PACKAGE: SKP" >> $TMP/SeTnewtag
 fi
done
rm -f $TMP/SeTpkgs
dialog --title "SELECTING FONT PACKAGES FOR SERIES T (teTeX)" \
       --checklist "Use this menu to select the packages containing \
FONTS that you wish to install from series T. Use the \
UP/DOWN keys to scroll through the list, and the SPACE key to toggle packages \
on or off. RECOMMENDED packages are preselected. \
Press ENTER when you are \
done." 15 70 4 \
"tf_dc" "DC fonts" "on" \
"tf_misc" "Micellaneous fonts" "on" \
"tf_ps" "PostScript fonts" "off" \
"tf_sautr" "Sauter fonts" "on" \
2> $TMP/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
 rm -f $TMP/SeTpkgs
 exit
fi
for PACKAGE in tf_dc tf_misc tf_ps tf_sautr ; do
 if fgrep \"$PACKAGE\" $TMP/SeTpkgs 1> /dev/null 2> /dev/null ; then
  echo "$PACKAGE: ADD" >> $TMP/SeTnewtag
 else
  echo "$PACKAGE: SKP" >> $TMP/SeTnewtag
 fi
done
rm -f $TMP/SeTpkgs
dialog --title "SELECTING DOCUMENTATION FOR SERIES T (teTeX)" \
       --checklist "Use this menu to select the packages containing \
DOCUMENTATION that you wish to install from series T. Use the \
UP/DOWN keys to scroll through the list, and the SPACE key to toggle packages \
on or off. \
Press ENTER when you are \
done." 19 70 9 \
"td_bibt" "BibTeX docs" "off" \
"td_eplai" "Extended plain TeX docs" "off" \
"td_fonts" "Font package docs" "off" \
"td_gnric" "docs for babel, texdraw, pstricks, xypic" "off" \
"td_ltex" "LaTeX docs" "off" \
"td_metap" "MetaPost docs" "off" \
"td_misc" "general docs for TeX" "off" \
"td_mkidx" "Makeindex docs" "off" \
"td_progs" "Kpathsea and related programs docs" "off" \
2> $TMP/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
 rm -f $TMP/SeTpkgs
 exit
fi
for PACKAGE in td_bibt td_eplai td_fonts td_gnric td_ltex td_metap \
td_misc td_mkidx td_progs ; do
 if fgrep \"$PACKAGE\" $TMP/SeTpkgs 1> /dev/null 2> /dev/null ; then
  echo "$PACKAGE: ADD" >> $TMP/SeTnewtag
 else
  echo "$PACKAGE: SKP" >> $TMP/SeTnewtag
 fi
done
rm -f $TMP/SeTpkgs
