diff options
author | Ralph Sennhauser <sera@gentoo.org> | 2012-12-30 12:13:19 +0000 |
---|---|---|
committer | Ralph Sennhauser <sera@gentoo.org> | 2012-12-30 12:13:19 +0000 |
commit | c2a21ed469caf2712660e03ec08a31f082ff9356 (patch) | |
tree | 6e9178ba781acbd2d828a65de8444f25eb8bfe20 /src | |
download | baselayout-java-c2a21ed469caf2712660e03ec08a31f082ff9356.tar.gz baselayout-java-c2a21ed469caf2712660e03ec08a31f082ff9356.tar.bz2 baselayout-java-c2a21ed469caf2712660e03ec08a31f082ff9356.zip |
New project baselayout-java, new home of random files needed by Java on Gentoo.
Import files from java-config-2.1.12 which ended up there soly for java-config being early in the dep chain.
svn path=/projects/baselayout-java/trunk/; revision=9129
Diffstat (limited to 'src')
-rw-r--r-- | src/20java-config | 1 | ||||
-rw-r--r-- | src/60-java | 9 | ||||
-rw-r--r-- | src/java-config-2.csh | 22 | ||||
-rw-r--r-- | src/java-config-2.sh | 34 | ||||
-rw-r--r-- | src/javaws.desktop | 12 | ||||
-rw-r--r-- | src/run-java-tool | 50 |
6 files changed, 128 insertions, 0 deletions
diff --git a/src/20java-config b/src/20java-config new file mode 100644 index 0000000..1128b5d --- /dev/null +++ b/src/20java-config @@ -0,0 +1 @@ +MANPATH="/etc/java-config-2/current-system-vm/man/" diff --git a/src/60-java b/src/60-java new file mode 100644 index 0000000..1aca594 --- /dev/null +++ b/src/60-java @@ -0,0 +1,9 @@ +# The VM dynamically loads these at runtime so they will end up as missing +# but actually work just fine. See for example +# https://bugs.gentoo.org/show_bug.cgi?id=152039 +# +# This file should only have files the are used by things like swt. If there +# are "broken" links inside the jre itself, the jre should install it's own +# control file. + +LD_LIBRARY_MASK="libjvm.so libjawt.so" diff --git a/src/java-config-2.csh b/src/java-config-2.csh new file mode 100644 index 0000000..517a054 --- /dev/null +++ b/src/java-config-2.csh @@ -0,0 +1,22 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later +# $Header: /var/cvsroot/gentoo-x86/dev-java/java-config/files/java-config-2.profiled.csh,v 1.3 2007/01/13 17:17:08 grobian Exp $ + +set gentoo_user_vm = "${HOME}/.gentoo/java-config-2/current-user-vm" +set gentoo_system_vm = "/etc/java-config-2/current-system-vm" + +## If we have a current-user-vm (and aren't root)... set it to JAVA_HOME +## Otherwise set to the current system vm +if ( ( "$uid" != "0" ) && ( -l $gentoo_user_vm ) ) then + setenv JAVA_HOME $gentoo_user_vm +else if ( -l $gentoo_system_vm ) then + setenv JAVA_HOME $gentoo_system_vm +endif +unset gentoo_user_vm gentoo_system_vm + +if ( $?JAVA_HOME ) then + # prepending to come before generation 1 + setenv MANPATH "${JAVA_HOME}/man:${MANPATH}" + setenv JDK_HOME $JAVA_HOME + setenv JAVAC ${JDK_HOME}/bin/javac +endif diff --git a/src/java-config-2.sh b/src/java-config-2.sh new file mode 100644 index 0000000..49155d1 --- /dev/null +++ b/src/java-config-2.sh @@ -0,0 +1,34 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later +# $Header: /var/cvsroot/gentoo-x86/dev-java/java-config/files/java-config-2.profiled.sh-r1,v 1.1 2007/03/16 11:13:16 betelgeuse Exp $ + +# If we have a current-user-vm (and aren't root)... set it to JAVA_HOME +gentoo_user_vm="${HOME}/.gentoo/java-config-2/current-user-vm" +gentoo_system_vm="/etc/java-config-2/current-system-vm" + +# Please make sure that this script is POSIX compliant +# See https://bugs.gentoo.org/show_bug.cgi?id=169925 +# for more details" + +if [ -z "${UID}" ] ; then + # id lives in /usr/bin which might not be mounted + if type id >/dev/null 2>/dev/null ; then + user_id=$(id -u) + else + [ "${USER}" = "root" ] && user_id=0 + fi +fi + +# The root user uses the system vm +if [ "${user_id}" != 0 -a -L "${gentoo_user_vm}" ]; then + export JAVA_HOME=${gentoo_user_vm} +# Otherwise set to the current system vm +elif [ -L /etc/java-config-2/current-system-vm ]; then + export JAVA_HOME=${gentoo_system_vm} +fi + +# prepending to come before generation 1 +export MANPATH="${JAVA_HOME}/man:${MANPATH}" +export JDK_HOME=${JAVA_HOME} +export JAVAC=${JDK_HOME}/bin/javac +unset gentoo_user_vm gentoo_system_vm user_id diff --git a/src/javaws.desktop b/src/javaws.desktop new file mode 100644 index 0000000..1f1bdd7 --- /dev/null +++ b/src/javaws.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Name=Java Web Start +GenericName=Java Web Start +Comment=Start Java Web Start applications +Exec=javaws %u +NoDisplay=true +Terminal=false +Icon=java-icon48 +MimeType=application/x-java-jnlp-file; +Categories=Network; diff --git a/src/run-java-tool b/src/run-java-tool new file mode 100644 index 0000000..46f804b --- /dev/null +++ b/src/run-java-tool @@ -0,0 +1,50 @@ +#!/bin/bash + +user_vm="${HOME}/.gentoo/java-config-2/current-user-vm" +system_vm="/etc/java-config-2/current-system-vm" +# Try GENTOO_VM +if [[ -n ${GENTOO_VM} ]]; then + vmpath="/usr/lib/jvm/${GENTOO_VM}/" +# Then user VM +elif [[ -h ${user_vm} ]]; then + vmpath=$(readlink ${user_vm}) +# And fall back to the system VM +else + vmpath=$(readlink ${system_vm}) +fi +tool=$(basename $0) +bin=${vmpath}/bin/${tool} +jrebin=${vmpath}/jre/bin/${tool} + +vm_handle=$(basename ${vmpath}) +if [[ -x ${bin} ]]; then + exec ${bin} "${@}" +elif [[ -x ${jrebin} ]]; then + exec ${jrebin} "${@}" +else + if [[ ! -d ${vmpath} ]]; then + echo "* Home for VM '${vm_handle}' does not exist: ${vmpath}" >&2 + if [[ -n ${GENTOO_VM} ]]; then + echo "* Invalid value for GENTOO_VM: ${GENTOO_VM}" + elif [[ -h ${user_vm} ]]; then + echo "* Invalid User VM: ${vm_handle}" >&2 + else + echo "* Invalid System VM: ${vm_handle}" >&2 + fi + else + if [[ ${tool} = "run-java-tool" ]]; then + echo "* run-java-tool was invoked directly" >&2 + echo "* run-java-tool should only be used via symlinks to it" >&2 + else + echo "* ${tool} is not available for ${vm_handle} on $(uname -m)" >&2 + echo "* IMPORTANT: some Java tools are not available on some VMs on some architectures" >&2 + if (( ${EUID} != 0 )) && [[ "${DISPLAY}" ]] && type -p notify-send > /dev/null; then + notify-send -i java-icon48 "Gentoo Java Launcher" "<b>${tool}</b> is not available for ${vm_handle} +<a href=\"http://www.gentoo.org/doc/en/java.xml\">Gentoo Java User Guide</a>" + fi + fi + fi + exit 1 +fi + + |