# hooks addon embedded web browser
# need links2 or dillo
# dillo copy some system fonts (25 Mb)


if [ "${TCOS_WEB_BROWSER}" = "dillo" ]; then
 if [ ! -d /usr/share/doc/dillo ]; then
        echo "WARNING"
        echo ""
        echo "Please install dillo package or disable WEB BROWSER support."
        echo "  => apt-get install dillo"
        echo ""
 else
    stat_before
    cpifexists /usr/bin/dillo           /usr/bin/
    cpifexists /usr/bin/dillocfg        /usr/bin/
    cpifexists /usr/bin/dpid            /usr/bin/
    #cpifexists /usr/bin/dpidc           /usr/bin/ # FIXME this need perl :(
    cpifexists /etc/dillorc              /etc/
    cpifexists /etc/dpidrc               /etc/

    mkdir -p $DESTDIR/usr/lib/dillo/
    copydir /usr/lib/dillo/dpi           /usr/lib/dillo/
    mkdir -p $DESTDIR/etc/fonts/
    cpifexists /etc/fonts/fonts.conf     /etc/fonts/
    copydir /usr/share/fonts             /usr/share/
    rm -rf $DESTDIR/usr/share/fonts/X11/
    stat_after "Dillo, web browser"
  fi
fi


if [ "${TCOS_WEB_BROWSER}" = "links2" ]; then
 if [ ! -d /usr/share/doc/links2 ]; then
        echo "WARNING"
        echo ""
        echo "Please install links2 package or disable WEB BROWSER support."
        echo "  => apt-get install links2"
        echo ""
 else
    stat_before
    cpifexists /usr/bin/links2         /usr/bin/
    cpifexists /usr/bin/xlinks2        /usr/bin/

    stat_after "Links2, web browser"
  fi
fi

if [ ! $TCOS_WEB_BROWSER ]; then
  _verbose "(65web_browser) TCOS_WEB_BROWSER disabled"
fi
