update javavmwrapper

This commit is contained in:
ziggi
2020-07-22 08:04:14 +00:00
parent c446ed9fed
commit 5716a55103
6 changed files with 116 additions and 58 deletions

View File

@@ -2,7 +2,7 @@
# $Id$
#
PORTNAME= javavmwrapper
PORTVERSION= 2.5
PORTVERSION= 2.7.5
CATEGORIES= java
MASTER_SITES= # none
DISTFILES= # none

View File

@@ -1,6 +1,6 @@
#!/bin/sh
#
# $FreeBSD: /tmp/pcvs/ports/java/javavmwrapper/files/pkg-install.in,v 1.3 2006-06-03 17:32:24 glewis Exp $
# $FreeBSD: head/java/javavmwrapper/files/pkg-install.in 508503 2019-08-10 19:28:18Z glewis $
LOCALBASE=%%LOCALBASE%%
@@ -10,16 +10,19 @@ if [ "x${2}" != "xPOST-INSTALL" ]; then
fi
# Ensure all JDKs and JREs are installed
_excl_dirs='bootstrap-openjdk'
jdirs=$(cd "${LOCALBASE}" && find *jdk* *jre* -depth 0 -type d 2> /dev/null)
set -o noglob
_excl_dirs='bootstrap-openjdk.*'
_find_expr='-depth 2 -regex .*/bin/java'
for dir in ${_excl_dirs}; do
_find_expr="${_find_expr} ! -regex ${dir}/bin/java"
done
for jvm in `cd "${LOCALBASE}" && find *jdk* *jre* ${_find_expr} 2> /dev/null`; do
for jvm in `cd "${LOCALBASE}" && find $jdirs ${_find_expr} 2> /dev/null`; do
if [ -x "${LOCALBASE}/${jvm}" ]; then
"${PKG_PREFIX}"/bin/registervm "${LOCALBASE}/${jvm}" > /dev/null 2>&1
fi
done
set +o noglob
# Ensure all VMs are configured correctly
"${PKG_PREFIX}"/bin/checkvms

View File

@@ -23,9 +23,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $FreeBSD: head/java/javavmwrapper/src/javavm.1 340872 2014-01-24 00:14:07Z mat $
.\" $FreeBSD: head/java/javavmwrapper/src/javavm.1 518486 2019-11-27 00:56:24Z glewis $
.\"
.Dd February 24, 2005
.Dd November 12, 2019
.Os
.Dt JAVAVM 1
.Sh NAME
@@ -100,9 +100,8 @@ A space delimited list of Java VM vendors.
The selected Java VM must have been released by one of the vendors in the list.
.Pp
Currently allowed vendors are
.Ql bsdjava ,
.Ql freebsd ,
.Ql openjdk
.Ql openjdk ,
.Ql oracle ,
and
.Ql sun .
.It Ev JAVA_VERSION
@@ -113,13 +112,27 @@ to a version, any Java VM with a version greater than or
equal to the given version will be used.
.Pp
Currently allowed versions are
.Ql 1.5 ,
.Ql 1.5+ ,
.Ql 1.6 ,
.Ql 1.6+ ,
.Ql 1.7
.Ql 1.7 ,
.Ql 1.7+ ,
.Ql 1.8 ,
.Ql 1.8+ ,
.Ql 1.9 ,
.Ql 1.9+ ,
.Ql 7 ,
.Ql 7+ ,
.Ql 8 ,
.Ql 8+ ,
.Ql 9 ,
.Ql 9+ ,
.Ql 10 ,
.Ql 10+ ,
.Ql 11 ,
.Ql 11+ ,
.Ql 12 ,
.Ql 12+ ,
.Ql 13 ,
and
.Ql 1.7+ .
.Ql 13+ .
.It Ev JAVAVM_OPTS
The contents of this environment variable will be passed to the invoked
Java VM as options.
@@ -179,16 +192,16 @@ Execute the most up to date and
.Dq native
Java VM registered with
.Nm .
.It Ev JAVA_VERSION=1.5+ Pa %%LOCALBASE%%/bin/javac MyClass.java
.It Ev JAVA_VERSION=8+ Pa %%LOCALBASE%%/bin/javac MyClass.java
Compile MyClass.java with a registered Java VM's javac that is at least
version 1.5.
version 8.
.It Ev JAVA_OS=native Pa %%LOCALBASE%%/bin/java Fl jar Pa MyApp.jar
Execute MyApp with the most up to date native Java VM that is registered
with
.Nm .
This is necessary if MyApp uses JNI, for instance.
.It Ev JAVA_VERSION="1.5 1.7" Pa %%LOCALBASE%%/bin/java Fl jar Pa MyApp.jar
Execute MyApp with either a Java VM that is either version 1.5 or version 1.7.
.It Ev JAVA_VERSION="8 11" Pa %%LOCALBASE%%/bin/java Fl jar Pa MyApp.jar
Execute MyApp with either a Java VM that is either version 8 or version 11.
.It Ev JAVAVM_DRYRUN=yes Pa %%LOCALBASE%%/bin/java
Don't invoke the Java VM, but print out information about what would have
been done.

View File

@@ -25,7 +25,7 @@
# Greg Lewis
# ----------------------------------------------------------------------------
#
# $FreeBSD: head/java/javavmwrapper/src/javavmwrapper.sh 351127 2014-04-12 19:43:17Z glewis $
# $FreeBSD: head/java/javavmwrapper/src/javavmwrapper.sh 528867 2020-03-21 19:24:52Z glewis $
#
# MAINTAINER=java@FreeBSD.org
@@ -173,17 +173,22 @@ sortConfiguration () {
_VM=`dirname "${_VM}"`
_VM=`dirname "${_VM}"`
_VM=`basename "${_VM}"`
# Consistent version numbering for various install directory names
# including 'openjdk6', 'jdk1.6.0', 'linux-sun-jdk1.6.0', etc.
VERSION=`echo ${VM} | sed -e 's|[^0-9]*||' -e 's|1\.||' \
-e 's|\.[0-9]||' 2>/dev/null`
_VERSION=`echo ${_VM} | sed -e 's|[^0-9]*||' -e 's|1\.||' \
-e 's|\.[0-9]||' 2>/dev/null`
if [ "${VERSION}" \> "${_VERSION}" ]; then
# Consistent version numbering for various install directory names.
VERSION=`echo ${VM} | sed -e 's|[^0-9]*||' \
-e 's|1\.\([0-9][0-9]*\)|\1|' \
-e 's|\([0-9][0-9]*\)\.[0-9]|\1|' \
-e 's|[^0-9]*\([0-9][0-9]*\)[^0-9]*|\1|'
2>/dev/null`
_VERSION=`echo ${_VM} | sed -e 's|[^0-9]*||' \
-e 's|1\.\([0-9][0-9]*\)|\1|' \
-e 's|\([0-9][0-9]*\)\.[0-9]|\1|' \
-e 's|[^0-9]*\([0-9][0-9]*\)[^0-9]*|\1|'
2>/dev/null`
if [ "${VERSION}" -gt "${_VERSION}" ]; then
_JAVAVMS="${_JAVAVMS}:${JAVAVM}:${_JAVAVM}"
JAVAVM=
continue
elif [ "${VERSION}" \< "${_VERSION}" ]; then
elif [ "${VERSION}" -lt "${_VERSION}" ]; then
_JAVAVMS="${_JAVAVMS}:${_JAVAVM}"
continue
else
@@ -500,21 +505,45 @@ setJavaHome() {
_JAVAVM_VERSION=
for version in ${JAVA_VERSION}; do
case "${version}" in
1.6+)
_JAVAVM_VERSION="${_JAVAVM_VERSION} 1.6 1.7 1.8"
*7+)
_JAVAVM_VERSION="${_JAVAVM_VERSION} 7 8 9 10 11 12 13 14"
;;
1.7+)
_JAVAVM_VERSION="${_JAVAVM_VERSION} 1.7 1.8"
*8+)
_JAVAVM_VERSION="${_JAVAVM_VERSION} 8 9 10 11 12 13 14"
;;
1.8+)
_JAVAVM_VERSION="${_JAVAVM_VERSION} 1.8"
*9+)
_JAVAVM_VERSION="${_JAVAVM_VERSION} 9 10 11 12 13 14"
;;
10+)
_JAVAVM_VERSION="${_JAVAVM_VERSION} 10 11 12 13 14"
;;
11+)
_JAVAVM_VERSION="${_JAVAVM_VERSION} 11 12 13 14"
;;
12+)
_JAVAVM_VERSION="${_JAVAVM_VERSION} 12 13 14"
;;
13+)
_JAVAVM_VERSION="${_JAVAVM_VERSION} 13 14"
;;
14+)
_JAVAVM_VERSION="${_JAVAVM_VERSION} 14"
;;
1.7)
_JAVAVM_VERSION="${_JAVAVM_VERSION} 7"
;;
1.8)
_JAVAVM_VERSION="${_JAVAVM_VERSION} 8"
;;
1.9)
_JAVAVM_VERSION="${_JAVAVM_VERSION} 9"
;;
*)
_JAVAVM_VERSION="${_JAVAVM_VERSION} ${version}"
;;
esac
done
JAVA_VERSION=`echo "${_JAVAVM_VERSION}" | sort | uniq`
JAVA_VERSION=`echo "${_JAVAVM_VERSION}" | sort -n | uniq`
fi
# Finally try to run one of the ${_JAVAVM_VMS}
@@ -525,8 +554,8 @@ setJavaHome() {
# Respect JAVA_VERSION
if [ -n "${JAVA_VERSION}" ]; then
_JAVAVM_VERSION=`echo ${_JAVAVM_VM} | \
sed -e 's|^[^0-9]*\([0-9]\)\.\([0-9]\)\.[0-9]$|\1.\2|' \
-e 's|^[^0-9]*\([0-9]\)$|1.\1|'`
sed -e 's|^[^0-9]*\([0-9]\)\.\([0-9]\)\.[0-9]$|\2|' \
-e 's|^[^0-9]*\([0-9][0-9]*\)$|\1|'`
for _JAVAVM_REQUESTED_VERSION in ${JAVA_VERSION}; do
if [ "${_JAVAVM_VERSION}" = "${_JAVAVM_REQUESTED_VERSION}" ]; then
_JAVAVM_VERSION=

View File

@@ -23,9 +23,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $FreeBSD: head/java/javavmwrapper/src/manvm.1 340872 2014-01-24 00:14:07Z mat $
.\" $FreeBSD: head/java/javavmwrapper/src/manvm.1 518486 2019-11-27 00:56:24Z glewis $
.\"
.Dd June 12, 2006
.Dd November 12, 2019
.Os
.Dt MANVM 1
.Sh NAME
@@ -87,9 +87,8 @@ The on-line manual pages to be displayed must come from a Java VM that has
been released by one of the vendors in the list.
.Pp
Currently allowed vendors are
.Ql bsdjava ,
.Ql freebsd ,
.Ql openjdk
.Ql openjdk ,
.Ql oracle ,
and
.Ql sun .
.It Ev JAVA_VERSION
@@ -101,13 +100,27 @@ to a version, the on-line manual pages from any Java VM with a version
greater than or equal to the given version will be used.
.Pp
Currently allowed versions are
.Ql 1.5 ,
.Ql 1.5+ ,
.Ql 1.6 ,
.Ql 1.6+ ,
.Ql 1.7
.Ql 1.7 ,
.Ql 1.7+ ,
.Ql 1.8 ,
.Ql 1.8+ ,
.Ql 1.9 ,
.Ql 1.9+ ,
.Ql 7 ,
.Ql 7+ ,
.Ql 8 ,
.Ql 8+ ,
.Ql 9 ,
.Ql 9+ ,
.Ql 10 ,
.Ql 10+ ,
.Ql 11 ,
.Ql 11+ ,
.Ql 12 ,
.Ql 12+ ,
.Ql 13 ,
and
.Ql 1.7+ .
.Ql 13+ .
.It Ev JAVAVM_OPTS
The contents of this environment variable will be passed to the invoked
.Nm man
@@ -125,10 +138,10 @@ programme of the the most up to date and
.Dq native
Java VM registered with
.Nm javavm .
.It Ev JAVA_VERSION=1.5 Pa %%LOCALBASE%%/bin/manvm javac
.It Ev JAVA_VERSION=8 Pa %%LOCALBASE%%/bin/manvm javac
Display the on-line manual page for the
.Nm javac
programme for a Java VM which is version 1.5.
programme for a Java VM which is version 8.
.El
.Sh SEE ALSO
.Xr javavm 1 ,

View File

@@ -1,6 +1,6 @@
.\"
.\" Copyright (C) 2005 Greg Lewis. All rights reserved.
.\"
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
@@ -10,7 +10,7 @@
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\"
.\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -23,9 +23,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $FreeBSD: head/java/javavmwrapper/src/registervm.1 340872 2014-01-24 00:14:07Z mat $
.\" $FreeBSD: head/java/javavmwrapper/src/registervm.1 518486 2019-11-27 00:56:24Z glewis $
.\"
.Dd February 24, 2005
.Dd November 12, 2019
.Os
.Dt REGISTERVM 1
.Sh NAME
@@ -58,12 +58,12 @@ The location of the Java VM wrapper configuration file.
.El
.Sh EXAMPLES
.Bl -tag -width indent
.It %%PREFIX%%/bin/registervm %%LOCALBASE%%/jdk1.6.0/bin/java
Register %%LOCALBASE%%/jdk1.6.0/bin/java as a possible choice of
.It %%PREFIX%%/bin/registervm %%LOCALBASE%%/openjdk11/bin/java
Register %%LOCALBASE%%/openjdk11/bin/java as a possible choice of
Java VM for
.Nm javavm .
.It %%PREFIX%%/bin/unregistervm %%LOCALBASE%%/jdk1.6.0/bin/java
Remove %%LOCALBASE%%/jdk1.6.0/bin/java as a possible choice of
.It %%PREFIX%%/bin/unregistervm %%LOCALBASE%%/openjdk11/bin/java
Remove %%LOCALBASE%%/openjdk11/bin/java as a possible choice of
Java VM for
.Nm javavm .
.El