#!/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 \
"a2ps" "Any to .ps filter (required by APSfilter)" "on" \
"aide" "AIDE File Integrity Scanner" "on" \
"at" "Schedule commands to execute at a later time" "on" \
"ash" "A small /bin/sh type shell" "on" \
"bc" "GNU bc - arbitrary precision math language" "on" \
"cdrtools" "CD-R/RW mastering/burning tools" "on" \
"cups-filters" "CUPS backend and filters" "on" \
"dansguardian" "Web Content Filter" "on" \
"diffutils" "GNU diffutils - find file differences" "on" \
"ddrescue" "ddrescue automatic data recovery tool" "on" \
"ddclient" "Dynamin dns updater" "on" \
"djvulibre" "djvulibre" "on" \
"expect" "A tool for automating interactive applications" "on" \
"foomatic-filters" "Print filter for gutenprint and hplip" "on" \
"ghostscript" "GPL Ghostscript PS/PDF interpreter" "on" \
"ghostscript-fonts-std" "Ghostscript Type1 fonts" "on" \
"groff" "GNU groff document formatting system" "on" \
"gutenprint" "Additional printer drivers for gs and CUPS" "on" \
"hplip" "HP printing and scanning software" "on" \
"htop" "An ncurses-based process viewer" "on" \
"imagemagick" "ImageMagick image utilities" "on" \
"ilmbase" "ilmbase" "on" \
"jfsrec" "JFS data recovery tool" "on" \
"libstatgrab" "A library that provides system statistics" "on" \
"lm_sensors" "Hardware monitoring package" "on" \
"lsof" "A tool to list open files" "on" \
"lsscsi" "Display infomation about SCSI devices" "on" \
"lxc" "Linux Containers tools" "on" \
"man" "Primary tool for reading online documentation" "on" \
"mc" "The Midnight Commander file manager" "on" \
"mcrypt" "mcrypt encrypt program" "on" \
"mysql" "MySQL database server" "on" \
"mysql-data" "MySQL preinstall databases" "on" \
"nano" "A simple editor with the look and feel of Pico" "on" \
"ntfsprogs" "Utilities for the NTFS filesystem" "on" \
"phpmyadmin" "phpMyAdmin" "on" \
"qpdf" "Command-line tools and library for transforming PDF files" "on" \
"rrdtool" "RRDTool Logging and Graphing" "on" \
"screen" "ANSI/vt100 virtual terminal emulator" "on" \
"slapt-get" "an APT like system for Slackware package management" "on" \
"sqlite" "A small SQL database server and library" "on" \
"sqlgrey" "SQLgrey Postfix greylisting service version 1.7.6" "on" \
"sudo" "give limited root privileges to certain users" "on" \
"terminator" "tool for arranging terminals" "on" \
"testdisk" "Testdisk & PhotoRec recovery software" "on" \
"tightvnc" "TightVNC is a free remote control software" "on" \
"tk" "The TK toolkit for TCL" "on" \
"hfsutils" "Tools for reading/writing Macintosh volumes" "on" \
"tcl" "The TCL script language" "on" \
2> $TMP/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
 rm -f $TMP/SeTpkgs
 > $TMP/SeTnewtag
 for pkg in \
a2ps aide at ash bc cdrtools cups-filters dansguardian diffutils ddrescue ddclient djvulibre expect foomatic-filters ghostscript ghostscript-fonts-std groff gutenprint ilmbase jfsrec hplip htop imagemagick libstatgrab lm_sensors lsof lsscsi lxc man mc mcrypt mysql mysql-data nano ntfsprogs phpmyadmin qpdf rrdtool screen slapt-get sqlite sqlgrey sudo terminator testdisk tightvnc tk hfsutils tcl \
  ; do
  echo "$pkg: SKP" >> $TMP/SeTnewtag
 done
 exit
fi
cat /dev/null > $TMP/SeTnewtag
for PACKAGE in \
a2ps aide at ash bc cdrtools cups-filters dansguardian diffutils ddrescue ddclient djvulibre expect foomatic-filters ghostscript ghostscript-fonts-std groff gutenprint ilmbase jfsrec hplip htop imagemagick libstatgrab lm_sensors lsof lsscsi lxc man mc mcrypt mysql mysql-data nano ntfsprogs phpmyadmin qpdf rrdtool screen slapt-get sqlite sqlgrey sudo terminator testdisk tightvnc tk hfsutils tcl \
 ; 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
