#!/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 HAM" \
       --checklist "Please select the packages you wish to install. \
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 74 10 \
"7plus" "7+ file encoder - RECOMMENDED" "on" \
"aprsd" "APRS server, RF to Inet gate" "off" \
"aprsdigi" "UI-frame digipeater for APRS" "off" \
"ax25_apps" "Essential AX.25 application - REQUIRED" "on" \
"ax25_tools" "AX.25 tools - REQUIRED" "on" \
"baken" "Visualisation of VHF/UHF and microwave beacons" "off" \
"baken_data" "Satellite-, location- and user profile-data" "off" \
"baken_map" "Maps belonging to the baken program" "off" \
"baycomusb" "Driver for Bacom USB packet modem" "off" \
"cwdaemon" "Morse daemon for the parallel or serial port" "off" \
"fftw" "Fourier transformation (Needed by gMFSK)" "off" \
"gmfsk" "Digital communications terminal program" "off" \
"hamlib" "Run-time library to control radio transceivers" "off" \
"libax25" "AX.25 libraries - REQUIRED" "on" \
"libgeotiff" "GEOTIFF library. (Needed by Xastir)" "off" \
"libproj" "PROJ library. (Needed by Xastir)" "off" \
"node" "Linuxnode - RECOMMENDED" "on" \
"opie" "One-time password calculator" "off" \
"predict" "Satellite tracking program" "off" \
"shapelib" "ESRI Shapefile library. (Needed by Xastir)" "off" \
"soundmodem" "Userspace soundmodem" "off" \
"tlf" "Logging program for hamradio operators" "off" \
"tlfdoc" "TLF manual" "off" \
"xastir" "X11 APRS program" "off" \
"xcall" "X11 packet radio terminal" "on" \
"xconvers" "X11 convers client" "on" \
"xfbb" "F6FBB's packet radio BBS server" "off" \
"xlog" "X11 logging program for hamradio operators" "on" \
"z8530drv_utils" "Utilities for Z8530 SCC boards" "on" \
2> $TMP/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
 rm -f $TMP/SeTpkgs
 > $TMP/SeTnewtag
 for pkg in 7plus aprsd aprsdigi ax25_apps ax25_tools baken baken_data baken_map baycomusb cwdaemon fftw gmfsk hamlib libax25 libgeotiff libproj node opie predict shapelib soundmodem tlf tlfdoc xastir xcall xconvers xfbb xlog z8530drv_utils ; do
  echo "$pkg: SKP" >> $TMP/SeTnewtag
 done
 exit
fi
cat /dev/null > $TMP/SeTnewtag
for PACKAGE in 7plus aprsd aprsdigi ax25_apps ax25_tools baken baken_data baken_map baycomusb cwdaemon fftw gmfsk hamlib libax25 libgeotiff libproj node opie predict shapelib soundmodem tlf tlfdoc xastir xcall xconvers xfbb xlog z8530drv_utils ; 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