#!/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 PACKAGES FROM SERIES XAP (X APPLICATIONS)" \
       --checklist "Please select the packages you wish to install \
from series XAP. Use the \
UP/DOWN keys to scroll through the list, and the SPACE key to select \
the packages you wish to install. Recommended packages have \
already been selected for you, but you may unselect them if you wish. \
Press ENTER when you are \
done." 21 70 10 \
"freefont" "Extra fonts for X, GIMP, ghostscript, and groff" "on" \
"fvwm2" "FVWM window manager" "on" \
"fvwmicns" "Color icons from xpm3icons.tar.Z" "on" \
"fvwm95" "A Win95-like window manager for X" "on" \
"gnuchess" "GNU chess and xboard" "on" \
"gnuplot" "Gnuplot function plotting utility" "off" \
"gs_x11" "Adds X11 driver to Ghostscript" "on" \
"gv" ".ps/.pdf viewer based on Ghostview" "on" \
"imagick" "ImageMagick image utilities" "on" \
"netscape" "Netscape Communicator Internet browser" "on" \
"rxvt" "Lightweight xterm alternative" "on" \
"seyon" "A complete telecommunications package" "off" \
"xfm" "xfm, a filemanager for X" "off" \
"x3270" "x3270 - IBM host access tool" "off" \
"xgames" "A collection of games for X" "on" \
"xfract" "Fractint for X" "on" \
"xlock" "A screensaver/locker for X" "on" \
"xpaint" "A color painting/image editing program" "off" \
"xpdf" "Portable Document Format (PDF) viewer" "off" \
"xspread" "A spreadsheet for X" "off" \
"xv" "XV GIF/TIFF/JPEG/PostScript Image Viewer" "on" \
"xxgdb" "X frontend for the GNU gdb debugger" "on" \
2> $TMP/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
 rm -f $TMP/SeTpkgs
 > $TMP/SeTnewtag
 for pkg in freefont fvwm2 fvwmicns fvwm95 gnuchess gnuplot gs_x11 \
  gv imagick netscape rxvt seyon x3270 xfm xfract xlock \
  xgames xpaint xpdf xspread xv xxgdb ; do
  echo "$pkg: SKP" >> $TMP/SeTnewtag
 done
 exit
fi
cat /dev/null > $TMP/SeTnewtag
for PACKAGE in freefont fvwm2 fvwmicns fvwm95 gnuchess gnuplot gs_x11 \
 gv imagick netscape rxvt seyon x3270 xfm xfract xlock xgames \
 xpaint xpdf xspread xv xxgdb ; 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
