#!/bin/sh
cat /dev/null > /tmp/SeTnewtag
dialog --title "print(printing  related packages)シリーズの選択" \
  --checklist "print シリーズの中からインストールしたいパッケージを \
選んでください．カーソルの上下キーで \
対象を選択し，space キーでマーク(X)します． \
Enter キーでインストールを開始します．" 24 72 15 \
"a2ps" "テキストファイル変換ツール" "on" \
"cups" "UNIX用プリンティングシステム CUPS" "on" \
"cups_filters" "CUPSフィルター集" "on" \
"foomatic_db" "Foomaticプリンタデータベース" "on" \
"foomatic_db_engine" "Foomatic DB エンジン" "on" \
"foomatic_filters" "Foomatic用フィルタ" "on" \
"gutenprint" "インクジェット用プリンタドライバ集 Gutenprint" "on" \
"hplip" "HP Linux Imaging and Printing" "off" \
"ijs" "ビットマップデータ送信用ライブラリ" "on" \
"libpaper" "用紙サイズ取扱用ライブラリ" "on" \
"psutils" "PostScript用ユーティリティ" "on" \
"qpdf" "PDF操作用ツール" "on" \
"system_config_printer" "CUPSプリントシステム設定ツール" "on" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/SeTpkgs
  > /tmp/SeTnewtag
  for pkg in a2ps cups cups_filters foomatic_db foomatic_db_engine foomatic_filters gutenprint hplip ijs libpaper psutils qpdf system_config_printer  ; do 
  echo "$pkg: SKP" >> /tmp/SeTnewtag
  done
  exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in a2ps cups cups_filters foomatic_db foomatic_db_engine foomatic_filters gutenprint hplip ijs libpaper psutils qpdf system_config_printer  ; 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
