#!/bin/sh
cat /dev/null > /tmp/SeTnewtag
dialog --title "select pkgs from fonts(additional fonts and tools for X11)" \
  --checklist "select packages from fonts 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 \
"IPAfont" "IPA font" "on" \
"VLGothic" "VLGothic font" "on" \
"fontconfig" "libfontconfig" "on" \
"fonts_append" "fonts appendix" "on" \
"freetype2" "libfreetype2" "on" \
"mkbold_mkitalic" "bold/italic font builder" "on" \
"pcf2bdf" "PCF/BDF convertor" "on" \
"ttf_bitstream_vera" "Vera Bitstream font" "on" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/SeTpkgs
  > /tmp/SeTnewtag
  for pkg in IPAfont VLGothic fontconfig fonts_append freetype2 mkbold_mkitalic pcf2bdf ttf_bitstream_vera  ; do 
  echo "$pkg: SKP" >> /tmp/SeTnewtag
  done
  exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in IPAfont VLGothic fontconfig fonts_append freetype2 mkbold_mkitalic pcf2bdf ttf_bitstream_vera  ; 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
