mirror of
https://github.com/void-linux/void-packages.git
synced 2025-06-05 06:33:50 +02:00
openjdk-common: update to 2.
adds /usr/bin/java script to bridge the gap between fully profile-based and fully /usr/bin symlinks
This commit is contained in:
parent
1129a5bdb2
commit
0a643c793a
3 changed files with 15 additions and 3 deletions
11
srcpkgs/openjdk-common/files/java.sh
Normal file
11
srcpkgs/openjdk-common/files/java.sh
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# allows scripts that assume java exists on PATH to work
|
||||||
|
# and helps users use java without logging out/in for the profile script
|
||||||
|
die() {
|
||||||
|
echo "java: $@" >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
. /etc/profile.d/jdk.sh
|
||||||
|
[ -d "$JAVA_HOME" ] || die "/usr/lib/jvm/default-jre not found. Check xbps-alternatives -lg java"
|
||||||
|
[ -x "$JAVA_HOME"/bin/java ] || die "$JAVA_HOME/bin/java does not exist or is not executable"
|
||||||
|
exec "$JAVA_HOME"/bin/java "$@"
|
|
@ -1,7 +1,7 @@
|
||||||
# only modify the environment if an openjdk*-jre package is installed
|
# only modify the environment if an openjdk*-jre package is installed
|
||||||
if [ -e "/usr/lib/jvm/default-jre" ]; then
|
if [ -d "/usr/lib/jvm/default-jre" ]; then
|
||||||
# if an openjdk* package is installed, prefer it to the selected jre
|
# if an openjdk* package is installed, prefer it to the selected jre
|
||||||
if [ -e "/usr/lib/jvm/default-jdk" ]; then
|
if [ -d "/usr/lib/jvm/default-jdk" ]; then
|
||||||
export JAVA_HOME="/usr/lib/jvm/default-jdk"
|
export JAVA_HOME="/usr/lib/jvm/default-jdk"
|
||||||
else
|
else
|
||||||
export JAVA_HOME="/usr/lib/jvm/default-jre"
|
export JAVA_HOME="/usr/lib/jvm/default-jre"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Template file for 'openjdk-common'
|
# Template file for 'openjdk-common'
|
||||||
pkgname=openjdk-common
|
pkgname=openjdk-common
|
||||||
version=1
|
version=2
|
||||||
revision=1
|
revision=1
|
||||||
short_desc="Common files for OpenJDK packages"
|
short_desc="Common files for OpenJDK packages"
|
||||||
maintainer="classabbyamp <void@placeviolette.net>"
|
maintainer="classabbyamp <void@placeviolette.net>"
|
||||||
|
@ -9,4 +9,5 @@ homepage="https://www.voidlinux.org"
|
||||||
|
|
||||||
do_install() {
|
do_install() {
|
||||||
vinstall "${FILESDIR}"/profile.sh 644 /etc/profile.d jdk.sh
|
vinstall "${FILESDIR}"/profile.sh 644 /etc/profile.d jdk.sh
|
||||||
|
vbin "${FILESDIR}"/java.sh java
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue