#!/bin/sh
cat /dev/null > /tmp/SeTnewtag
dialog --title "GIS(Geographical Information System)シリーズの選択" \
  --checklist "GIS シリーズの中からインストールしたいパッケージを \
選んでください．カーソルの上下キーで \
対象を選択し，space キーでマーク(X)します． \
Enter キーでインストールを開始します．" 24 72 15 \
"OpenLayers" "OpenLayers" "on" \
"aaa_proj" "proj-4.6.x" "on" \
"bbb_geos" "GEOS(Geometry Engine - Open Source)" "on" \
"cfitsio" "cfitsio 2.490" "on" \
"gdal" "gdal 1.4.x" "on" \
"grass" "grass 6.2.x" "on" \
"mapserver" "MapServer 4.10.x" "on" \
"postgis" "PostGIS" "on" \
"qgis" "qgis : GIS クライアント・オン Qt" "on" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/SeTpkgs
  > /tmp/SeTnewtag
  for pkg in OpenLayers aaa_proj bbb_geos cfitsio gdal grass mapserver postgis qgis  ; do 
  echo "$pkg: SKP" >> /tmp/SeTnewtag
  done
  exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in OpenLayers aaa_proj bbb_geos cfitsio gdal grass mapserver postgis qgis  ; 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
