#!/bin/sh -e 

# policy 3.1.0.0: fsstnd -> fhs

if [ "$1" = "configure" ]; then
  if [ -d /usr/doc -a ! -e /usr/doc/dhelp \
       -a -d /usr/share/doc/dhelp ]; then
    ln -sf ../share/doc/dhelp /usr/doc/dhelp
  fi

  if [ -d /usr/doc -a ! -e /usr/doc/HTML ]; then
    ln -sf ../share/doc/HTML /usr/doc/HTML
  fi
fi

if [ -x /usr/sbin/dhelp_parse ]; then
  echo -n "Building HTML tree ..."
  /usr/sbin/dhelp_parse -r
  /usr/sbin/dhelp_parse_fsstnd -r
  echo " done"
fi

if [ -x /etc/cron.weekly/dhelp -a -x /usr/bin/glimpseindex ]; then
  echo "Starting glimpseindex ..."
  /etc/cron.weekly/dhelp 2>/dev/null >/dev/null &
fi

#DEBHELPER#

echo "Run dhelp to read documentation or browse "
echo "http://localhost/doc/HTML/index.html."

