#!/bin/sh
cat /dev/null > /tmp/SeTnewtag
dialog --title "select pkgs from x11(X11 Window System)" \
  --checklist "select packages from x11 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 \
"AV" "Audio/Video related tools" "off" \
"AfterStepClassic" "AfterStep with Japanese extensions" "on" \
"ConsoleKit" "ConsoleKit" "off" \
"PolicyKit" "Policy Kit" "off" \
"SDL" "SDL-1.2.9" "on" \
"SDL_image" "SDL_image" "on" \
"X11R74" "X11R74" "on" \
"Xaw3d" "libXaw3d" "on" \
"atk" "GLib Accessibility Toolkit" "off" \
"audiofile" "audiofile" "on" \
"cairo" "Cairo, A 2D Graphics Library" "off" \
"dbus" "D-BUS, An IPC Library" "on" \
"dbus_glib" "D-Bus glib binding" "on" \
"easytag" "ID3 tag editor" "on" \
"eggx" "An easy graphic library for X" "off" \
"emiclock" "Emiclock 2.0.2" "on" \
"epdfview" "simple PDF viewer: epdfview" "on" \
"expat" "XML parsing library expat" "on" \
"fep" "old style Japanese Input Method" "on" \
"firefox" "Minefield Web Browser" "off" \
"font" "fonts for X Window" "on" \
"freefont" "free TTF font" "on" \
"ghostscript" "ESP Ghostsciprt" "on" \
"glew" "GLEW : OpenGL Extension Wrangler" "on" \
"glib" "GTK+ Basic Routines Library" "off" \
"glitz" "OpenGL image compositing library" "off" \
"gnuplot" "gnuplot 4.0" "on" \
"gtk+" "GTK+ Toolkit Library" "off" \
"gtk_engines" "Themes for GTK+2" "off" \
"gtk_engines1" "Themes for GTK+1" "on" \
"gv" "Ghostscript Viewer" "on" \
"hal" "HAL, Hardware Abstraction Layer" "on" \
"hal_info" "HAL info" "on" \
"imlib" "Image Manipulation library" "on" \
"kterm" "Japanese terminal emulator : kterm" "on" \
"lcms" "litteleCMS" "off" \
"libart_lgpl" "LGPL'ed ART Library" "off" \
"libglade" "Glade Runtime Library" "off" \
"libglib" "glib version 1 series" "on" \
"libgtk" "GIMP Tool Kit library 1.2.10" "on" \
"libjpeg" "libjpeg-6b" "on" \
"libpng" "libpng-1.2.8" "on" \
"libpthread_stubs" "Stubs for libpthread" "on" \
"libtiff" "libtiff-3.7.2" "on" \
"libungif" "libungif-4.1.3" "on" \
"libxklavier" "libxklavier - utility library to make XKB stuff easier" "on" \
"nicolatter" "nicolatter - Japanese input server" "on" \
"openjpeg" "OpenJpeg: Jpeg2000 library" "on" \
"openmotif" "OpenMotif widget" "off" \
"oyatu" "oyatu - Typing trainer" "on" \
"pango" "GTK+ I18N Text Rendering Library" "off" \
"pixman" "low-level pixel manipulation library" "on" \
"plotutils" "Plot utils" "on" \
"plugger" "Multimedia Plugin Plugger" "on" \
"pm_utils" "Power Management Utility for Hal" "on" \
"poppler" "popler: shared library for PDF" "on" \
"poppler_data" "poppler data" "on" \
"potrace" "bitmap data/vector graphic converter" "on" \
"print" "printing tools" "on" \
"pstoedit" "Postscript utilities" "off" \
"qvwm" "qvwm" "on" \
"rxvt" "rxvt 2.7.3 terminal software for X" "on" \
"smix" "simple audio mixer smix" "on" \
"smpeg" "SDL MPEG library" "on" \
"tango_icon_theme" "Tango Icon Theme" "off" \
"tgif" "tgif" "on" \
"thunderbird" "Mail and News Client" "off" \
"unclutter" "unclutter" "on" \
"uuid" "Universal Uniq IDentifier maker" "on" \
"vendor_driver" "X drivers developed by HW vendors." "on" \
"wxWidgets" "wxWdigets" "on" \
"xbitmapfonts" "Bitmap fonts collection for X" "on" \
"xcalendar" "scheduler software xcalender" "on" \
"xchat" "IRC chat program" "on" \
"xengine" "X engine" "on" \
"xforms" "Xforms library" "on" \
"xfplamoconfig" "xfplamoconfig - Configuration tool for Xorg/XFree86" "on" \
"xine_lib" "xine-lib-1.1.0" "on" \
"xine_ui" "xine-ui-0.99.4" "on" \
"xkeyboard_config" "keyboard configurations for X" "on" \
"xlockmore" "Xlock for X-Windows" "on" \
"xmascot" "Mascot program for X xmascot 2.6a" "on" \
"xmms" "XMMS music player" "on" \
"xosview" "System usage viewer xosview" "on" \
"xscreensaver" "Screen Saver" "on" \
"xshisen" "Mahjong Puzzle game xshisen 1.51" "on" \
"xsnow" "xsnow" "on" \
"xterm" "xterm terminal emulator" "on" \
"xv" "xv" "on" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/SeTpkgs
  > /tmp/SeTnewtag
  for pkg in AV AfterStepClassic ConsoleKit PolicyKit SDL SDL_image X11R74 Xaw3d atk audiofile cairo dbus dbus_glib easytag eggx emiclock epdfview expat fep firefox font freefont ghostscript glew glib glitz gnuplot gtk+ gtk_engines gtk_engines1 gv hal hal_info imlib kterm lcms libart_lgpl libglade libglib libgtk libjpeg libpng libpthread_stubs libtiff libungif libxklavier nicolatter openjpeg openmotif oyatu pango pixman plotutils plugger pm_utils poppler poppler_data potrace print pstoedit qvwm rxvt smix smpeg tango_icon_theme tgif thunderbird unclutter uuid vendor_driver wxWidgets xbitmapfonts xcalendar xchat xengine xforms xfplamoconfig xine_lib xine_ui xkeyboard_config xlockmore xmascot xmms xosview xscreensaver xshisen xsnow xterm xv  ; do 
  echo "$pkg: SKP" >> /tmp/SeTnewtag
  done
  exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in AV AfterStepClassic ConsoleKit PolicyKit SDL SDL_image X11R74 Xaw3d atk audiofile cairo dbus dbus_glib easytag eggx emiclock epdfview expat fep firefox font freefont ghostscript glew glib glitz gnuplot gtk+ gtk_engines gtk_engines1 gv hal hal_info imlib kterm lcms libart_lgpl libglade libglib libgtk libjpeg libpng libpthread_stubs libtiff libungif libxklavier nicolatter openjpeg openmotif oyatu pango pixman plotutils plugger pm_utils poppler poppler_data potrace print pstoedit qvwm rxvt smix smpeg tango_icon_theme tgif thunderbird unclutter uuid vendor_driver wxWidgets xbitmapfonts xcalendar xchat xengine xforms xfplamoconfig xine_lib xine_ui xkeyboard_config xlockmore xmascot xmms xosview xscreensaver xshisen xsnow xterm xv  ; 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
