default_install  &&

if is_depends_enabled $SPELL $(get_spell_provider $SPELL NS-PLUGIN-COMPATIBLE)
then
  # gtk-vnc only installs to libdir/mozilla/plugins :/
  message "${MESSAGE_COLOR}Determine which browser plugins to install${DEFAULT_COLOR}" &&
  if [[ -d ${INSTALL_ROOT}/usr/lib/xulrunner/plugins ]]
  then
    message "${MESSAGE_COLOR}Installing plugin for xulrunner${DEFAULT_COLOR}" &&
    install -m 0755 $SOURCE_DIRECTORY/plugin/gtk-vnc-plugin.so  \
                    $INSTALL_ROOT/usr/lib/xulrunner/plugins
  fi  &&

  if [[ -d ${INSTALL_ROOT}/opt/firefox/plugins ]]
  then
    message "${MESSAGE_COLOR}Installing plugin for firefox-bin${DEFAULT_COLOR}" &&
    install -m 0755 $SOURCE_DIRECTORY/plugin/gtk-vnc-plugin.so  \
                    $INSTALL_ROOT/opt/firefox/plugins
  fi  &&

  if [[ -d ${INSTALL_ROOT}/usr/lib/seamonkey/plugins ]]
  then
    message "${MESSAGE_COLOR}Installing plugin for seamonkey${DEFAULT_COLOR}" &&
    install -m 0755 $SOURCE_DIRECTORY/plugin/gtk-vnc-plugin.so  \
                    $INSTALL_ROOT/usr/lib/seamonkey/plugins
  fi  &&

  mkdir -p $INSTALL_ROOT/usr/share/doc/$SPELL                       &&
  install -m 0644 $SOURCE_DIRECTORY/plugin/README                   \
                  $INSTALL_ROOT/usr/share/doc/$SPELL/README.plugin
fi
