#!/bin/sh
cat /dev/null > /tmp/SeTnewtag
dialog --title "bluez(Bluetooth utilities)シリーズの選択" \
  --checklist "bluez シリーズの中からインストールしたいパッケージを \
選んでください．カーソルの上下キーで \
対象を選択し，space キーでマーク(X)します． \
Enter キーでインストールを開始します．" 24 72 15 \
"bluez" "Linux用Bluetoothスタック" "on" \
"bluez_firmware" "Bluetooth機器用firmware" "on" \
"bluez_hcidump" "HCIデータダンプツール" "on" \
"obex_data_server" "OBEXデータサーバ" "on" \
"obexd" "OBEXデーモン/クライアント" "on" \
"openobex" "フリーなOBEXプロトコルの実装" "on" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/SeTpkgs
  > /tmp/SeTnewtag
  for pkg in bluez bluez_firmware bluez_hcidump obex_data_server obexd openobex  ; do 
  echo "$pkg: SKP" >> /tmp/SeTnewtag
  done
  exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in bluez bluez_firmware bluez_hcidump obex_data_server obexd openobex  ; 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
