#!/usr/bin/perl -w

# Quick program to setup java sdk links in Debian
#
# see http://www.debian.org/doc/manuals/debian-java-faq/ch11.html#s11.2
#
# Quicker recipe to install the dummy packages:
#
#  apt-get install equivs
#  cd /tmp
#  apt-get source java-common
#  cd java-common-022/dummy
#  for i in *.control; do equivs-build $i; done
#  dpkg -i *.deb

use strict;

# Set the root of you jsdk path to your environment

#my $jsdk = "/usr/local/lib/jdk";
my $jsdk = "~/jsdk";

my @list = qw{ HtmlConverter appletviewer extcheck idlj jar jarsigner
               java java-rmi.cgi javac javadoc javah javap jdb keytool
               kinit klist ktab native2ascii orbd policytool rmic rmid
               rmiregistry serialver servertool tnameserv };

for (@list) {
    system "update-alternatives --auto $_";
    system "update-alternatives --verbose --install /usr/bin/$_ $_ " .
      "$jsdk/bin/$_ 500 --slave /usr/share/man/man1/$_.1 $_.1 " .
        "$jsdk/man/man1/$_.1";
}

# Copyright (C) 2004,5,6,7 Ivan Kanis
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program (gpl.html); if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

