#!/bin/sh
cat /dev/null > /tmp/SeTnewtag
dialog --title "select pkgs from AV(Audio/Video tools)" \
  --checklist "select packages from AV 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 \
"aumix" "audio mixer" "on" \
"cdparanoia" "CD Ripper CDparanoia" "off" \
"dvgrab" "DV video grabber" "on" \
"esound" "esound" "on" \
"faac" "Free Advanced Audio Codec" "on" \
"faad2" "Free Advanced Audio Decoder" "on" \
"ffmpeg" "FFmpeg stream audio/video library" "on" \
"ffmpegthumbnailer" "FFmpeg thumbnailer" "on" \
"flac" "FLAC, A Free Loseless Audio Codec" "on" \
"gpac" "GPAC multimedia framework" "on" \
"id3lib" "ID3tag Access Library" "on" \
"jack_audio_connection_kit" "Jack audio connection kit" "on" \
"lame" "MP3 Encoder LAME" "off" \
"liba52" "AC-3 Codec Decoder Library" "on" \
"libao" "autio output library" "on" \
"libavc1394" "libavc1394" "on" \
"libcddb" "CDDB access library" "on" \
"libcdio" "libcdio" "on" \
"libdv" "libdv:Quaser DV codec" "on" \
"libdvdcss" "DVD CSS Decode Library" "on" \
"libdvdnav" "DVD Navigation Library" "on" \
"libdvdread" "DVD-Video Reading Library" "on" \
"libid3tag" "ID3tag Access Library for Libmad" "on" \
"libmad" "MPEG Audio Decoder Library" "on" \
"libmp4v2" "libmp4v2" "on" \
"libmpeg2" "MPEG-2 Decoder Library" "on" \
"libogg" "Ogg library for Ogg Vorbis" "on" \
"libsamplerate" "libsamplerate" "on" \
"libsndfile" "libsndfile" "on" \
"libtheora" "libtheora" "off" \
"libvorbis" "libvorbis 1.0.1" "on" \
"mp3gain" "MP3 volume smoothen tool" "off" \
"sox" "Sound eXchange" "on" \
"speex" "Speex audio codec" "on" \
"taglib" "ID3 tag library" "on" \
"twolame" "Optimized MPEG Audio Layer 2 encoder" "on" \
"vorbis_tools" "ogg vorbis tool" "off" \
"wavpack" "loss-less compressed format wavpack" "on" \
"x264" "H.264/AVC encoder" "on" \
"xvidcore" "Xvid video codec" "on" \
2> /tmp/SeTpkgs
if [ $? = 1 -o $? = 255 ]; then
  rm -f /tmp/SeTpkgs
  > /tmp/SeTnewtag
  for pkg in aumix cdparanoia dvgrab esound faac faad2 ffmpeg ffmpegthumbnailer flac gpac id3lib jack_audio_connection_kit lame liba52 libao libavc1394 libcddb libcdio libdv libdvdcss libdvdnav libdvdread libid3tag libmad libmp4v2 libmpeg2 libogg libsamplerate libsndfile libtheora libvorbis mp3gain sox speex taglib twolame vorbis_tools wavpack x264 xvidcore  ; do 
  echo "$pkg: SKP" >> /tmp/SeTnewtag
  done
  exit
fi
cat /dev/null > /tmp/SeTnewtag
for PACKAGE in aumix cdparanoia dvgrab esound faac faad2 ffmpeg ffmpegthumbnailer flac gpac id3lib jack_audio_connection_kit lame liba52 libao libavc1394 libcddb libcdio libdv libdvdcss libdvdnav libdvdread libid3tag libmad libmp4v2 libmpeg2 libogg libsamplerate libsndfile libtheora libvorbis mp3gain sox speex taglib twolame vorbis_tools wavpack x264 xvidcore  ; 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
