aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rwxr-xr-xjava-config14
-rw-r--r--java-config.1123
-rw-r--r--java_config/EnvFileParser.py (renamed from EnvFileParser.py)0
-rw-r--r--java_config/EnvironmentManager.py (renamed from EnvironmentManager.py)0
-rw-r--r--java_config/Errors.py (renamed from Errors.py)4
-rw-r--r--java_config/OutputFormatter.py (renamed from OutputFormatter.py)0
-rw-r--r--java_config/Package.py (renamed from Package.py)0
-rw-r--r--java_config/PreferenceManager.py (renamed from PreferenceManager.py)0
-rw-r--r--java_config/PrefsFileParser.py (renamed from PrefsFileParser.py)0
-rw-r--r--java_config/VM.py (renamed from VM.py)0
-rw-r--r--java_config/__init__.py5
-rw-r--r--java_config/versionator.py (renamed from versionator.py)0
-rw-r--r--setup.py23
-rwxr-xr-xtarball.sh98
15 files changed, 260 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..bbf394a
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,5 @@
+
+ Saleem A. <compnerd@gentoo.org>
+ December 30, 2004 - Initial Rewrite
+ - Based on the collective works of the following:
+ {karltk,axxo,aether}@gentoo.org
diff --git a/java-config b/java-config
index 69fa7f2..247fe0e 100755
--- a/java-config
+++ b/java-config
@@ -9,17 +9,11 @@
# Maintainer: Gentoo Java Herd <java@gentoo.org>
# Java Subsystem Configuration Utility for Gentoo Linux
-# ChangeLog
-# Saleem A. <compnerd@gentoo.org>
-# December 30, 2004 - Initial Rewrite
-# - Based on the collective works of the following:
-# {karltk,axxo,aether}@gentoo.org
-
__version__ = '$Revision: 2.0$'[11:-1]
-from OutputFormatter import OutputFormatter
-from EnvironmentManager import EnvironmentManager
-from JavaErrors import *
+from java_config.OutputFormatter import OutputFormatter
+from java_config.EnvironmentManager import EnvironmentManager
+from java_config.Errors import *
import os
from commands import getoutput
@@ -287,4 +281,4 @@ if __name__ == '__main__':
(options, args) = parser.parse_args()
-# vim:set expandtab tabstop=3 shiftwidth=3 softtabstop=3:
+# vim:set expandtab tabstop=3 shiftwidth=3 softtabstop=3 nowrap:
diff --git a/java-config.1 b/java-config.1
new file mode 100644
index 0000000..86d199a
--- /dev/null
+++ b/java-config.1
@@ -0,0 +1,123 @@
+.TH "JAVA-CONFIG" "1" "June 2005" "java-config 2.0.0" "User Commands"
+.SH "NAME"
+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\-c \-\-javac\fI
+Show full path to currently selected Java compiler.
+.TP
+\fB\-j \-\-jar\fI
+Show full path to currently selected
+.I jar
+command.
+.TP
+\fB\-O \-\-jdk\-home\fI
+Show path to currently selected JDK.
+.TP
+\fB\-o \-\-jre\-home\fI
+Show path to currently selected JRE.
+.TP
+\fB\-v \-\-java\-version\fI
+Query current JVM for version.
+.TP
+\fB\-p [pkg1[\-SLOT],pkg2[\-SLOT],...] \-\-classpath[=package1,package2,...]\fI
+Calculate classpath for a package. If a package is installed in different
+slots you can also specify the slot to get the specific classpath informations.
+.TP
+\fB\-e filename \-\-exec=filename\fI
+Figure full path to one of the JDK/JRE utilities, such as
+.I keytool
+,
+.I rmic
+and others.
+.
+.TP
+\fB\-l \-\-list\-available\-packages\fI
+List available Java packages. Used for selection by
+.I \-\-classpath
+,
+.I \-\-set\-system\-classpath
+and
+.I \-\-set\-user\-classpath
+.
+.TP
+\fB\-L \-\-list\-available\-vms\fI
+Lists available JVMs. Used with
+.I \-\-set\-system\-vm
+and
+.I \-\-set\-user\-vm
+.
+.TP
+\fB\-S <vm\-id> \-\-set\-system\-vm=<vm\-id>\fI
+Sets the system\-wide default JVM.
+.TP
+\fB\-s <vm\-id> \-\-set\-user\-vm=<vm\-id>\fI
+Sets the user\-specific JVM by putting all necessary env vars into
+.I $HOME/.gentoo/java\-env .
+.TP
+\fB\-f \-\-show\-active\-vm\fI
+Show the JVM that's currently active, as set via \-\-set\-system\-vm or \-\-set\-user\-vm.
+.TP
+\fB\-A <pkg1>,<pkg2>,... \-\-set\-system\-classpath=<package1>,<package2>,...\fI
+Sets the system\-wide default CLASSPATH.
+.TP
+\fB\-a <pkg1>,<pkg2>,... \-\-set\-user\-classpath=<package1>,<package2>,...\fI
+Sets the user\-specific CLASSPATH by putting all necessary env vars into
+.I $HOME/.gentoo/java\-env\-classpath
+(sourced from $HOME/.gentoo/java\-env).
+.TP
+\fB\-X \-\-clean\-system\-classpath\fI
+Cleans the system\-wide default classpath, leaving only vm needed jars
+on it.
+.TP
+\fB\-x \-\-clean\-user\-classpath\fI
+Cleans the user specific classpath that was specified by
+.I \-\-set\-user\-classpath
+by deleting
+.I $HOME/.gentoo/java\-env\-classpath .
+.
+.TP
+\fB\-n \-\-nocolor\fI
+Turn off all colors.
+.TP
+\fB\-P <vm\-id> \-\-print=<vm\-id>\fI
+Print the environment information for the specified virtual machine.
+.
+
+.SH "NOTES"
+You can get the <vm\-id> that is used with
+.I \-\-set\-system\-vm=<vm\-id>
+and
+.I \-\-set\-user\-vm=<vm\-id>
+in the output of
+.I java\-config \-\-list\-available\-vms
+inside the brackets. Ex. [blackdown\-jdk\-1.4.1] and you can use this to
+set your default Java Virtual Machine.
+
+.SH "AUTHORS"
+Karl Trygve Kalleberg <karltk@gentoo.org>
+.br
+Adrian Almenar <strider@gentoo.org>
+.br
+Jason Mobarak <aether@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/EnvFileParser.py b/java_config/EnvFileParser.py
index 0ebac77..0ebac77 100644
--- a/EnvFileParser.py
+++ b/java_config/EnvFileParser.py
diff --git a/EnvironmentManager.py b/java_config/EnvironmentManager.py
index dc099bd..dc099bd 100644
--- a/EnvironmentManager.py
+++ b/java_config/EnvironmentManager.py
diff --git a/Errors.py b/java_config/Errors.py
index 1c55422..6755759 100644
--- a/Errors.py
+++ b/java_config/Errors.py
@@ -16,12 +16,12 @@
# April 20, 2005 - Modified Error classes
# - Moved to Errors.py
-class EnvironmentUndefinedError():
+class EnvironmentUndefinedError:
"""
Environment Variable is undefined!
"""
-class RuntimeError():
+class RuntimeError:
"""
General Exception for the java-config utility
"""
diff --git a/OutputFormatter.py b/java_config/OutputFormatter.py
index e4354d8..e4354d8 100644
--- a/OutputFormatter.py
+++ b/java_config/OutputFormatter.py
diff --git a/Package.py b/java_config/Package.py
index 2978ee4..2978ee4 100644
--- a/Package.py
+++ b/java_config/Package.py
diff --git a/PreferenceManager.py b/java_config/PreferenceManager.py
index aec6c9c..aec6c9c 100644
--- a/PreferenceManager.py
+++ b/java_config/PreferenceManager.py
diff --git a/PrefsFileParser.py b/java_config/PrefsFileParser.py
index df607b3..df607b3 100644
--- a/PrefsFileParser.py
+++ b/java_config/PrefsFileParser.py
diff --git a/VM.py b/java_config/VM.py
index e8cdd41..e8cdd41 100644
--- a/VM.py
+++ b/java_config/VM.py
diff --git a/java_config/__init__.py b/java_config/__init__.py
new file mode 100644
index 0000000..16f4ddd
--- /dev/null
+++ b/java_config/__init__.py
@@ -0,0 +1,5 @@
+'''
+java-config support files
+'''
+
+version = '2.0.0'
diff --git a/versionator.py b/java_config/versionator.py
index b5ced4b..b5ced4b 100644
--- a/versionator.py
+++ b/java_config/versionator.py
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..e5b64fa
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,23 @@
+#!/usr/bin/env python
+
+from distutils.core import setup
+import os
+import java_config
+
+setup (
+ name = 'java-config',
+ version = java_config.version,
+ description = 'java enviroment configuration tool',
+ long_description = \
+ """
+ java-config is a tool for configuring various enviroment
+ variables and configuration files involved in the java
+ enviroment for Gentoo Linux.
+ """,
+ author = 'Gentoo Java Herd',
+ author_email = 'java@gentoo.org',
+ packages = ['', 'java_config'],
+ package_dir = { '' : os.curdir, 'java_config' : os.curdir + '/java_config' }
+)
+
+# vim: noet:ts=4:
diff --git a/tarball.sh b/tarball.sh
new file mode 100755
index 0000000..bccc421
--- /dev/null
+++ b/tarball.sh
@@ -0,0 +1,98 @@
+#!/bin/bash
+# $Header: /var/cvsroot/gentoo-src/java-config/python/tarball.sh,v 1.10 2004/02/18 01:40:36 aether Exp $
+
+if [ -z "$1" ]; then
+ echo
+ echo "you need to have the version specified."
+ echo "e.g.: $0 1.1.0-r3"
+ echo
+ exit 0
+fi
+
+export PKG="java-config"
+export TMP="/tmp"
+export V="$1"
+export DEST="${TMP}/${PKG}-${V}"
+
+
+die () {
+ echo "!!! $1"
+ exit $2
+}
+
+LOG="/tmp/tarball.log"
+!(test -e ${LOG}) || test -w ${LOG} || die "Error creating log files!" $?
+rm -rf ${LOG}
+touch ${LOG}
+
+pod () {
+ echo "popd" >> ${LOG}
+ popd >/dev/null
+}
+
+pud () {
+ echo "pushd, $@" >> ${LOG}
+ pushd "$@" >/dev/null
+}
+
+sed -i -e "s:__portage_version__.*=.*:__portage_version__ = \"$V\":" java-config
+
+tabnanny_output=`python -c "import tabnanny; tabnanny.check('.')"`
+
+if [[ -z ${tabnanny_output} ]]; then
+ echo ">>> Tabnanny said everything was ok!"
+else
+ echo ">>> Tabnanny failed !!"
+ echo ${tabnanny_output}
+ exit 1
+fi
+
+test -e ${DEST} && (
+ echo ">>> Removing any existing package directory"
+ rm -rf ${DEST} 1>>${LOG} 2>>${LOG} || \
+ die "Removing existing package directory failed" $?
+)
+
+echo ">>> Creating new package directory (${DEST})"
+install -d -m0755 ${DEST} || die "Error creating package dir" $?
+
+echo ">>> Normalizing ChangeLog"
+sed -i -e "s:\t: :g" ChangeLog
+
+
+echo ">>> Copying package contents to package directory"
+
+test -w ${DEST} || die "Copying package contents failed" $?
+(
+ cp ChangeLog ${DEST}
+ cp -a java_config ${DEST}
+ cp setup.py ${DEST}
+ cp 30java-finalclasspath ${DEST}
+ cp java-config ${DEST}
+ cp java-config.1 ${DEST}
+
+) 1>>${LOG} 2>>${LOG}
+
+echo ">>> Cleaning package directory"
+pud ${DEST}
+echo ">>> ${PWD}" && sleep 2
+
+(
+ find -name CVS -exec rm -rf {} \;
+ find -name '*~' -exec rm -rf {} \;
+ find -name '*.pyc' -exec rm -rf {} \;
+ find -name '.cvsignore' -exec rm -rf {} \;
+ find -name '.*swp' -exec rm -rf {} \;
+
+) 1>>${LOG} 2>>${LOG}
+
+echo ">>> Changing ownership of package directory to root.root"
+chown -R root.root 1>&2 2>/dev/null ${DEST} \
+ || echo "*** Changing package directory to root.root failed!"
+
+TARBALL="${TMP}/${PKG}-${V}.tar.bz2"
+echo ">>> Creating tarball ($TARBALL)"
+pud ${TMP}
+tar cjf $TARBALL ${PKG}-${V}
+
+for C in `seq 2`; do pod; done