#!/bin/sh
cat /dev/null > /tmp/SeTnewtag
dialog --title "select pkgs from devel(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" "" "on" \
"autoconf213" "" "on" \
"automake" "" "on" \
"binutils" "" "on" \
"bison" "" "on" \
"cloog" "" "on" \
"cvs" "" "on" \
"diffutils" "" "on" \
"elfutils" "" "on" \
"flex" "" "on" \
"g++" "" "on" \
"gcc" "" "on" \
"gdb" "" "on" \
"gettext" "" "on" \
"gmp" "" "on" \
"indent" "indent for C source" "on" \
"intltool" "" "on" \
"kernel_headers" "Linux kernel headers" "on" \
"libc" "" "on" \
"libtool" "" "on" \
"m4" "" "on" \
"make" "" "on" \
"mpc" "" "on" \
"mpfr" "" "on" \
"onig" "" "on" \
"patch" "" "on" \
"pkg_config" "" "on" \
"plamobuild" "meta script for making Plamo Linux build script" "on" \
"ppl" "" "on" \
"pth" "" "on" \
"slang" "S-Lang interpreter" "on" \
"strace" "" "on" \
"yasm" "" "on" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/SeTpkgs
  > /tmp/SeTnewtag
  for pkg in autoconf autoconf213 automake binutils bison cloog cvs diffutils elfutils flex g++ gcc gdb gettext gmp indent intltool kernel_headers libc libtool m4 make mpc mpfr onig patch pkg_config plamobuild ppl pth slang strace yasm  ; do 
  echo "$pkg: SKP" >> /tmp/SeTnewtag
  done
  exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in autoconf autoconf213 automake binutils bison cloog cvs diffutils elfutils flex g++ gcc gdb gettext gmp indent intltool kernel_headers libc libtool m4 make mpc mpfr onig patch pkg_config plamobuild ppl pth slang strace yasm  ; 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
