#!/bin/sh
T_PX="`cat /tmp/SeTT_PX`"
rm -f /tmp/SeTSERIES
if [ "$T_PX" = "/" ]; then
 BASE=off
else
 BASE=on
fi


dialog --title "󥹥ȡ뤹륫ƥ" --checklist \
"\n\
ڡǥ󥹥ȡ뤹륽եȥƥ \n\
򤷤ƤPlamo LinuxεưɬܤΥեȥ \n\
ưŪ˥󥹥ȡ뤵ޤ  ʳΥեȥ \n\
ƥ꡼ñ̤ǥ󥹥ȡ̵ͭǤޤ\n\
X11 ʲΥƥ꡼򤹤ˤ minimum ƥ꡼ɬפǡ\n\
ext ʲΥƥ꡼ˤ X11 ɬפȤ¸طޤ \n\
(¸륫ƥ꡼ϲǽϰϤǼưŪ˥󥹥ȡ뤵ޤ) \n\
ext ʲΥƥ꡼Ω˻Ǥޤ\n" 25 74 8 \
"minimum" "Plamo Linux ܴĶ(1.2GBɬ)" on \
"x11" "X11 ɥƥ(0.7GB)" on \
"ext" "ǥȥå״ĶѤζ̥饤֥(1GB)" on \
"xfce" "XFce4 ǥȥå״Ķ(0.1GB)" on \
"kde" "KDE4 ǥȥå״Ķ(1.6GB)" off \
"gnome" "GNOME2 ǥȥå״Ķ(1GB)" off \
"OOo" "祪եե OOpenOffice.org(0.5GB)" "off" \
"tex" "pteTex3 Ȥߥƥ(0.4GB)" off \
"kernel" "Linux ͥΥ(0.4GB)" on \
"webdb" "Webץѥץåȥե(0.3GB)" "off" \
"gis" "GIS(Ͽ޾󥷥ƥѥץ(0.2GB)" "off" \
2> /tmp/tmpseries
if [ $? = 1 -o $? = 255 ]; then
 rm -f /tmp/tmpseries
 exit
fi
SELECTED="`cat /tmp/tmpseries`"
# rm -f /tmp/tmpseries
INSTSETS='00_base'

# for base
for cat in minimum x11 ext xfce kde gnome tex kernel webdb gis OOo; do
    chk=`echo $SELECTED | grep $cat`
    if [ $? == 0 ]; then
       echo "$cat is selected"
       INSTSETS="$INSTSETS 01_minimum"
       break
    fi
done

#for x11
for cat in x11 ext xfce kde gnm tex webdb gis OOo ; do
    chk=`echo $SELECTED | grep $cat`
    if [ $? == 0 ]; then
       echo "$cat is selected"
       INSTSETS="$INSTSETS 02_x11"
       break
    fi
done

#for ext
for cat in ext xfce kde gnm webdb gis OOo ; do
    chk=`echo $SELECTED | grep $cat`
    if [ $? == 0 ]; then
       echo "$cat is selected"
       INSTSETS="$INSTSETS 03_ext"
       break
    fi
done

#for xfce
chk=`echo $SELECTED | grep xfce`
if [ $? == 0 ]; then
    echo "xfce is selected"
    INSTSETS="$INSTSETS 04_xfce"
fi

#for kde
chk=`echo $SELECTED | grep kde`
if [ $? == 0 ]; then
    echo "kde is selected"
    INSTSETS="$INSTSETS 05_kde"
fi

#for gnm
chk=`echo $SELECTED | grep gnome`
if [ $? == 0 ]; then
    echo "gnome is selected"
    INSTSETS="$INSTSETS 06_gnome"
fi

#for tex
chk=`echo $SELECTED | grep tex`
if [ $? == 0 ]; then
    echo "tex is selected"
    INSTSETS="$INSTSETS 07_tex"
fi

#for kernel
chk=`echo $SELECTED | grep kernel`
if [ $? == 0 ]; then
    echo "kernel is selected"
    INSTSETS="$INSTSETS 08_kernel"
fi

# for webdb
for cat in webdb gis ; do
    chk=`echo $SELECTED | grep $cat`
    if [ $? == 0 ]; then
       echo "$cat is selected"
       INSTSETS="$INSTSETS 09_webdb"
       break
    fi
done

# for gis
chk=`echo $SELECTED | grep gis`
if [ $? == 0 ]; then
    echo "gis is selected"
    INSTSETS="$INSTSETS 10_gis"
fi

# for OOo
chk=`echo $SELECTED | grep OOo`
if [ $? == 0 ]; then
    echo "OOo is selected"
    INSTSETS="$INSTSETS 11_OOo"
fi

echo "$INSTSETS" > /tmp/SeTSERIES
