diff options
author | Karl Trygve Kalleberg <karltk@gentoo.org> | 2002-03-18 21:45:38 +0000 |
---|---|---|
committer | Karl Trygve Kalleberg <karltk@gentoo.org> | 2002-03-18 21:45:38 +0000 |
commit | f7cc8a8c9b7531cd29297efef1a926b64edb4e15 (patch) | |
tree | 3811736494a6f05bb2a9ec77aa3b5c87cd137d14 /dev-java/java-config | |
parent | Version bump, and dependency to >= from = (diff) | |
download | historical-f7cc8a8c9b7531cd29297efef1a926b64edb4e15.tar.gz historical-f7cc8a8c9b7531cd29297efef1a926b64edb4e15.tar.bz2 historical-f7cc8a8c9b7531cd29297efef1a926b64edb4e15.zip |
Major updates. #754
Diffstat (limited to 'dev-java/java-config')
-rw-r--r-- | dev-java/java-config/files/java-config | 94 | ||||
-rw-r--r-- | dev-java/java-config/files/java-config.1 | 80 | ||||
-rw-r--r-- | dev-java/java-config/java-config-0.2.0.ebuild (renamed from dev-java/java-config/java-config-0.1.3.ebuild) | 2 |
3 files changed, 163 insertions, 13 deletions
diff --git a/dev-java/java-config/files/java-config b/dev-java/java-config/files/java-config index 9536e96f0b71..2e9b6025fb2b 100644 --- a/dev-java/java-config/files/java-config +++ b/dev-java/java-config/files/java-config @@ -1,29 +1,27 @@ + #! /bin/sh # # Copyright 1999-2001 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later # Maintainer: Tools Team <tools@gentoo.org> # Author: Karl Trygve Kalleberg <karltk@gentoo.org> -# $Header: /var/cvsroot/gentoo-x86/dev-java/java-config/files/java-config,v 1.4 2002/01/29 14:12:47 karltk Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-java/java-config/files/java-config,v 1.5 2002/03/18 21:45:38 karltk Exp $ -version=0.1.3 +version=0.2.0 +all_params="$*" -if [ -e /etc/env.d/20jre ] ; then +if [ -e /etc/env.d/20java ] ; then oldpath=$PATH - . /etc/env.d/20jre + . /etc/env.d/20java PATH=$oldpath:$PATH fi -if [ -e /etc/env.d/21jdk ] ; then - oldpath=$PATH - . /etc/env.d/21jdk - PATH=$oldpath:$PATH +if [ -z "$JAVA_HOME" ] ; then + echo "!!! No Java installation found" > /dev/stderr + echo "!!! Use --set-system-vm to select default system JVM" > /dev/stderr fi -if [ -z $JAVA_HOME ] ; then - echo "No Java installation found!" > /dev/stderr -fi usage() { cat <<EOF Usage: java-config [OPTIONS] [LIBRARIES] @@ -38,6 +36,9 @@ Options: [--full-classpath=package-name] [--exec=filename] [--list-available-packages] + [--list-available-vms] + [--set-system-vm=<vm-id>] + [--set-user-vm=<vm-id>] EOF echo "Using ${JAVA_HOME}" exit $1 @@ -79,12 +80,14 @@ findpluginpath() { for i in ${rootpath}/{ns4,netscape4}/javaplugin.so ; do if [ -e $i ] ; then echo $i + break fi done elif [ $1 == "ns6" ] || [ $1 == "netscape6" ] || [ $1 == "moz" ] || [ $1 == "mozilla" ] ; then for i in ${rootpath}/{mozilla,ns600,netscape6}/{libjavaplugin_oji,javaplugin_oji}.so ; do if [ -e $i ] ; then echo $i + break fi done else @@ -98,17 +101,73 @@ findpluginpath() { for i in ${rootpath}/{,jre}/bin/javaplugin.so ; do if [ -e $i ] ; then echo $i + break fi done elif [ $1 == "ns6" ] || [ $1 == "netscape6" ] || [ $1 == "moz" ] || [ $1 == "mozilla" ] ; then for i in ${rootpath}/{,jre}/bin/libjavaplugin_oji.so ; do if [ -e $i ] ; then echo $i + break fi done fi } +function vm_shortname() { + basename $1 | sed -e "s/20//" #-e "s/-[0-9]\..*//" +} + +function vm_version() { + ( . $1 ; echo "$VERSION ($i)" ) +} + +function vm_envvars() { + local file=$1 + local system="$2" + + ( . $file ; + for i in $ENV_VARS ; do + if [ $i == "ADDPATH" ] && [ -z "$system" ]; then + echo "PATH=\${PATH}:${!i}" + elif [ $i == "ADDPATH" ] && [ "$system" ]; then + echo "PATH=${!i}" + elif [ $i == "ADDLDPATH" ] ; then + if [ "$system" ]; then + echo "LDPATH=${!i}" + fi + else + echo "${i}=${!i}" + fi + done + ) +} + +function set_vm() { + local vm=$1 + local cfgpath=$2 + local cfgfile=$3 + local system="" + if [ "$cfgpath" == "/etc/env.d" ] ; then + system="yes" + fi + local found="" + + for i in /etc/env.d/java/20*-* ; do + if [ $vm == `vm_shortname $i` ] ; then + echo "Now using `vm_version $i`" + mkdir -p $cfgpath + echo "# Autogenerated by java-config $version" > ${cfgpath}/${cfgfile} + echo "# Cmd: $0 $all_params" >> ${cfgpath}/${cfgfile} + vm_envvars $i $system >> ${cfgpath}/${cfgfile} + found="yes" + fi + done + if [ -z "$found" ] ; then + echo "$vm not found" + fi +} + while test $# -gt 0; do case "$1" in @@ -122,7 +181,7 @@ while test $# -gt 0; do ;; --browser-plugin=*) pluginpath=`findpluginpath $optarg` - if [ ! -z $pluginpath ] ; then + if [ -n "$pluginpath" ] ; then echo `basename $pluginpath` else echo "Plugin not found" > /dev/stderr @@ -170,6 +229,17 @@ while test $# -gt 0; do echo `basename $dn` done ;; + --list-available-vms) + for i in /etc/env.d/java/20*-* ; do + echo "[`vm_shortname $i`] `vm_version $i`" + done + ;; + --set-system-vm=*) + set_vm $optarg /etc/env.d 20java + ;; + --set-user-vm=*) + set_vm $optarg $HOME/.gentoo java-env + ;; *) usage ;; diff --git a/dev-java/java-config/files/java-config.1 b/dev-java/java-config/files/java-config.1 new file mode 100644 index 000000000000..acae29bb323b --- /dev/null +++ b/dev-java/java-config/files/java-config.1 @@ -0,0 +1,80 @@ +.TH java-config "1" "March 2002" "java-config 0.2.0" +.SH NAME +java-config \- manual page for java-config, the Java configuration tool for +Gentoo +.SH SYNOPSIS +.B java-config +\fI[options]\fB + +.SH DESCRIPTION +.PP +.I java-config +is used to query/set properties of your system's Java environment. It can be +used to list available VMs, java packages, set system default JVM and set user +default JVM. +.PP +In addition, it is used by Portage as a common interface to querying +properties about the various JVMs. +.SH OPTIONS +.TP +\fB--javac\fI +show full path to currently selected Java compiler. +.TP +\fB--jar\fI +show full path to currently selected +.I jar +command +.TP +\fB--jdk-home\fI +show path to currently selected JDK +.TP +\fB--jre-home\fI +show path to currently selected JRE +.TP +\fB--java-version\fI +query current JVM for version +.TP +\fB--classpath[=package-name]\fI +calculate classpath for a package. +.TP +\fB--full-classpath[=package-name]\fI +calculate classpath with absolute paths ready to be assigned to CLASSPATH. +.TP +\fB--exec=filename\fI +figure full path to one of the JDK/JRE utilities, such as +.I keytool +. +.TP +\fB--list-available-packages\fI +list available Java packages. Used for selection by +.I --classpath +and +.I --full-classpath +. +.TP +\fB--list-available-vms\fI +lists available JVMs. Used with +.I --set-system-vm +and +.I --set-user-vm +. +.TP +\fB--set-system-vm=<vm-id>\fI +sets the system-wide default JVM. +.TP +\fB--set-user-vm=<vm-id>\fI +sets the user-specific JVM by putting all necessary env vars into +.I $HOME/.gentoo/java-env +. + +.SH AUTHORS +Karl Trygve Kalleberg <karltk@gentoo.org> + +.SH BUGS +It cannot be used to set default browser plugin yet. + +.SH "SEE ALSO" +env-update(5) +.TP +The \fI/usr/bin/java-config\fR script. +.TP diff --git a/dev-java/java-config/java-config-0.1.3.ebuild b/dev-java/java-config/java-config-0.2.0.ebuild index 83546a8a7f2a..b6c086f4c995 100644 --- a/dev-java/java-config/java-config-0.1.3.ebuild +++ b/dev-java/java-config/java-config-0.2.0.ebuild @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License, v2 or later # Maintainer: Karl Trygve Kalleberg <karltk@gentoo.org> # Author: Karl Trygve Kalleberg <karltk@gentoo.org> -# $Header: /var/cvsroot/gentoo-x86/dev-java/java-config/java-config-0.1.3.ebuild,v 1.1 2002/01/29 14:12:47 karltk Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-java/java-config/java-config-0.2.0.ebuild,v 1.1 2002/03/18 21:45:38 karltk Exp $ S=${WORKDIR}/${P} DESCRIPTION="Gentoo-specific configuration for Java" |