#! /bin/sh

set -e

jdkhome=@basedir@
priority=@priority@
jdk_tools='@jdk_tools@'
with_gfdl_docs='@WITH_GFDL@'

for program in $jdk_tools; do
    slave="--slave /usr/share/man/man1/$program.1.gz $program.1.gz $jdkhome/man/man1/$program.1.gz"
    if [ "$with_gfdl_docs" = no ]; then
	case "$program" in javac) slave= ;; esac
    fi
    update-alternatives --quiet \
	--install "/usr/bin/$program" "$program" \
	"$jdkhome/bin/$program" "$priority" \
	$slave
done

#DEBHELPER#
