#!/bin/sh
cat /dev/null > /tmp/SeTnewtag
dialog --title "select pkgs from minimum(Plamo Linux Minimum System)" \
  --checklist "select packages from minimum 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 \
"FDclone" "FD-clone" "on" \
"JFdocs" "translated FAQs and HOWTOs by JF project" "off" \
"Jcode" "Japanse Language library for perl" "on" \
"alsa" "ALSA library/tools" "on" \
"aspell" "advanced fast spell checker aspell" "off" \
"autofs" "autofs" "on" \
"banner" "banner" "on" \
"bc" "Gnu bc - arbitrary calculator language" "off" \
"berkeley_db" "Berkeley DB" "on" \
"bsdgames" "Classic games from BSD(1.3)" "on" \
"cpio" "GNU cpio" "on" \
"cpufreqd" "CPU frequency control daemon" "on" \
"cpufrequtils" "cpufrequtils" "on" \
"devel" "C/C++ language development tools" "off" \
"emacs" "emacs and related tools" "off" \
"fdutils" "floppy disk utilities" "on" \
"gc" "Boehm GC" "off" \
"gdbm" "GNU Database Management tool" "on" \
"gnupg_tls" "GnuPG andl GnuTLS" "on" \
"gpm" "GPM(General purpose mouse)" "on" \
"hddtemp" "HDD temperature monitoring tool" "on" \
"hdparm" "hdparm" "on" \
"help2man" "help2man" "on" \
"kakasi" "KAKASI(KAnji KAna Simple Inverter)" "off" \
"lha" "lha-1.14i with patches" "on" \
"libelf" "library for ELF" "off" \
"libusb" "libusb" "on" \
"libusb_compat" "libusb-compat library" "on" \
"libzip" "libzip" "on" \
"linux_howto" "HOWTO's from LDP" "off" \
"lm_sensors" "lm_sensors: sensoring motherboard information" "on" \
"lshw" "lshw" "on" \
"lsof" "lsof" "on" \
"lv" "lv" "on" \
"lzma" "LZMA compress/decompress tools" "on" \
"man_pages" "Man-pages(on line man pages)" "on" \
"man_pages_ja" "Japanese man" "on" \
"mt_st" "MT controller" "on" \
"mtools" "mtools" "on" \
"namazu" "Namazu - a fulltext search engine version 2.0.19" "off" \
"netpbm" "netpbm - graphic formats interchage commands" "on" \
"network" "network tools" "off" \
"nfs" "NFS tools" "on" \
"nilfs_utils" "Nilfs2 Utils" "on" \
"nkf" "Network Kanji Filter" "on" \
"nmzindex_s" "Namazu index for Plamo(small)" "off" \
"pcre" "pcre" "on" \
"perl" "multifunctional scripting language Perl" "on" \
"perl_File_MMagic" "File-MMagic by perl" "on" \
"popt" "popt-1.7" "on" \
"psmisc" "psmisc process management utilty" "on" \
"psmisc" "psmisc process management utilty" "on" \
"python" "Object Oriented scripting Language Python" "on" \
"quota" "quota" "off" \
"rpm2targz" "rpm2targz" "on" \
"ruby" "Ruby: Object Oriented Scripting Language" "on" \
"sane_backends" "sane-backends 1.0.17" "on" \
"sg3_utils" "SG(SCSI Generic) utils ver3" "on" \
"sharutils" "sharutils" "on" \
"squashfs_lzma" "Squash FS utility" "on" \
"tcl" "Tcl/Tk" "off" \
"texinfo" "GNU texinfo" "on" \
"time" "time" "on" \
"tree" "tree" "on" \
"unzip" "unzip" "on" \
"usbutils" "usbutils" "on" \
"which" "which" "on" \
"zip" "zip" "on" \
"zsh" "zsh" "off" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/SeTpkgs
  > /tmp/SeTnewtag
  for pkg in FDclone JFdocs Jcode alsa aspell autofs banner bc berkeley_db bsdgames cpio cpufreqd cpufrequtils devel emacs fdutils gc gdbm gnupg_tls gpm hddtemp hdparm help2man kakasi lha libelf libusb libusb_compat libzip linux_howto lm_sensors lshw lsof lv lzma man_pages man_pages_ja mt_st mtools namazu netpbm network nfs nilfs_utils nkf nmzindex_s pcre perl perl_File_MMagic popt psmisc psmisc python quota rpm2targz ruby sane_backends sg3_utils sharutils squashfs_lzma tcl texinfo time tree unzip usbutils which zip zsh  ; do 
  echo "$pkg: SKP" >> /tmp/SeTnewtag
  done
  exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in FDclone JFdocs Jcode alsa aspell autofs banner bc berkeley_db bsdgames cpio cpufreqd cpufrequtils devel emacs fdutils gc gdbm gnupg_tls gpm hddtemp hdparm help2man kakasi lha libelf libusb libusb_compat libzip linux_howto lm_sensors lshw lsof lv lzma man_pages man_pages_ja mt_st mtools namazu netpbm network nfs nilfs_utils nkf nmzindex_s pcre perl perl_File_MMagic popt psmisc psmisc python quota rpm2targz ruby sane_backends sg3_utils sharutils squashfs_lzma tcl texinfo time tree unzip usbutils which zip zsh  ; 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
