#!/bin/sh
cat /dev/null > /tmp/SeTnewtag
dialog --title "select pkgs from devel(C/C++ Development tools)" \
  --checklist "select packages from devel series. \
You can move cursor with UP/DOWN key and push space \
key to select pkgs. After finish selecting, \
push Enter to start installation. " 24 72 15 \
"autoconf" "GNU autoconf utility" "off" \
"automake" "GNU auto make utility" "off" \
"binutils" "GNU binary utitiles" "on" \
"bison" "GNU bison parser generator version 2.0" "on" \
"cvs" "CVS : Concurrent versioning system" "on" \
"diff" "GNU diffutils" "on" \
"flex" "flex - fast lexical analyzer" "on" \
"gcc" "GNU Compiler Collection Core package" "on" \
"gcc_g++" "GCC C++ package" "on" \
"gdb" "GNU debugger" "on" \
"gettext" "gettext" "on" \
"gmake" "GNU make utilities" "on" \
"gmp" "GNU Multi-Precision library" "on" \
"indent" "indent for C source" "on" \
"intltool" "XML I18N Tool" "off" \
"kernel_headers" "kernel keaders" "on" \
"libc" "libraries for C compiler" "on" \
"libcinfo" "info files for C libraries" "off" \
"libtool" "libtool-1.4.2" "on" \
"m4" "macro language m4" "on" \
"mpfr" "Multi precision Floating point Reliable library" "on" \
"patch" "patch-2.5.4" "on" \
"pkg_config" "pkgconfig-0.20" "on" \
"pth" "GNU Portable Threads" "on" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/SeTpkgs
  > /tmp/SeTnewtag
  for pkg in autoconf automake binutils bison cvs diff flex gcc gcc_g++ gdb gettext gmake gmp indent intltool kernel_headers libc libcinfo libtool m4 mpfr patch pkg_config pth  ; do 
  echo "$pkg: SKP" >> /tmp/SeTnewtag
  done
  exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in autoconf automake binutils bison cvs diff flex gcc gcc_g++ gdb gettext gmake gmp indent intltool kernel_headers libc libcinfo libtool m4 mpfr patch pkg_config pth  ; do
    if grep "$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
