#!/bin/sh
# This script is used within the Slackware installer to present
# a package series selection menu.  If not present, a default list
# built into the installer is used.

# Protected tmp directory:
TMP=/var/log/setup/tmp
if [ ! -d $TMP ]; then
  mkdir -p $TMP
fi
# If the distribution source is already known, we can avoid listing
# stuff that isn't there.
if [ ! -r $TMP/SeTT_PX -o ! -r $TMP/SeTDS ]; then
  unset T_PX
  unset DS
else
  T_PX="`cat $TMP/SeTT_PX`"
  DS="`cat $TMP/SeTDS`"
fi
rm -rf $TMP/SeTSERIES $TMP/tmpscript $TMP/series 


dialog --title "PACKAGE SERIES SELECTION" --item-help --output-separator "#" --checklist \
"Now it's time to select which general categories of software to install \
on your system.  Use the spacebar to select or unselect the software you \
wish to install.  You can use the up and down arrows to see all the \
possible choices.  Recommended choices have been preselected.  Press the \
ENTER key when you are finished." \
20 75 9 \
"A" "Base Linux system" on "The A (base) series contains the kernel and main system utilities." \
"AP" "Various Applications that do not need X" on "The AP series is a collection of useful applications." \
"D" "Program Development (C, C++, Lisp, Perl, etc.)" on "The D series contains compilers, debuggers, and other programming tools." \
"L" "System Libraries (needed by KDE, GNOME, X, and more)" on "The L series contains important libraries needed by the rest of the system." \
"N" "Networking (TCP/IP, UUCP, Mail, News)" on "The N series contains network related clients and servers." \
"DEVEL" "Development packages" off "Those are the development packages, compilers, debuggers and other programming tools." \
"X" "X Window System" on "This series contains X, the window system (or GUI) used by Linux." \
2> $TMP/series
if [ ! $? = 0 ]; then
  rm -f $TMP/SeTSERIES $TMP/series
  exit
fi
# Save this "just in case":
#"GNOME" "The GNOME desktop for X" on "The GNOME series contains the GNOME desktop environment and related libraries." 
#
# Rewrite the list into a single # delimited line:
INSTSETS="`cat $TMP/series | tr -d " "`"
INSTSETS="`echo $INSTSETS | tr "\042" "#" `"
INSTSETS="`echo $INSTSETS | tr "," "#" `"
# Store the selection list:
echo "$INSTSETS" > $TMP/SeTSERIES
