#!/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 AP (APPLICATIONS)" \
       --checklist "Please confirm the packages you wish to install \
from series AP.  Use the UP/DOWN keys to scroll through the list, and \
the SPACE key to deselect any items you don't want to install.  \
Press ENTER when you are \
done." 22 72 12 \
"cdrtools" "CD-R/RW mastering/burning tools" "on" \
"diffutils" "GNU diffutils - find file differences" "on" \
"ddrescue" "ddrescue automatic data recovery tool" "on" \
"foomatic-filters" "Print filter for gutenprint and hplip" "on" \
"ghostscript" "GPL Ghostscript PS/PDF interpreter" "on" \
"hplip" "HP printing and scanning software" "on" \
"jfsrec" "JFS data recovery tool" "on" \
"man" "Primary tool for reading online documentation" "on" \
"mcrypt" "mcrypt encrypt program" "on" \
"mysql" "MySQL database server" "on" \
"nano" "A simple editor with the look and feel of Pico" "on" \
"ntfsprogs" "Utilities for the NTFS filesystem" "on" \
"phpmyadmin" "phpMyAdmin" "on" \
"sudo" "give limited root privileges to certain users" "on" \
"testdisk" "Testdisk & PhotoRec recovery software" "on" \
"tightvnc" "TightVNC is a free remote control software" "on" \
2> $TMP/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
 rm -f $TMP/SeTpkgs
 > $TMP/SeTnewtag
 for pkg in \
cdrtools diffutils ddrescue foomatic-filters ghostscript jfsrec hplip man mcrypt mysql nano ntfsprogs phpmyadmin sudo testdisk tightvnc \
  ; do
  echo "$pkg: SKP" >> $TMP/SeTnewtag
 done
 exit
fi
cat /dev/null > $TMP/SeTnewtag
for PACKAGE in \
cdrtools diffutils ddrescue foomatic-filters ghostscript jfsrec hplip man mcrypt mysql nano ntfsprogs phpmyadmin sudo testdisk tightvnc \
 ; 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
