mirror of
https://github.com/void-linux/void-packages.git
synced 2025-04-16 14:17:02 +02:00
New package: openjdk-common-1
Replaces the xbps trigger that added the profile script for openjdk, which was really a mistake. Instead of using alternative groups for specific JRE/JDK binaries, use two symlinks: /usr/lib/jvm/default-jdk and /usr/lib/jvm/default-jre, which point to /usr/lib/jvm/${version}. Prefer default-jdk to default-jre, and just add them to PATH and MANPATH instead of putting things in /usr/bin.
This commit is contained in:
parent
1c592ad18e
commit
dcbd1f1067
4 changed files with 35 additions and 0 deletions
9
srcpkgs/openjdk-common/INSTALL
Normal file
9
srcpkgs/openjdk-common/INSTALL
Normal file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
case "$ACTION" in
|
||||
pre)
|
||||
# remove the openjdk.sh from xbps-triggers
|
||||
if [ -e "./etc/profile.d/openjdk.sh" ]; then
|
||||
rm "./etc/profile.d/openjdk.sh"
|
||||
fi
|
||||
;;
|
||||
esac
|
2
srcpkgs/openjdk-common/INSTALL.msg
Normal file
2
srcpkgs/openjdk-common/INSTALL.msg
Normal file
|
@ -0,0 +1,2 @@
|
|||
The way the default OpenJDK version is selected has changed.
|
||||
You may need to re-login for this change to take effect.
|
12
srcpkgs/openjdk-common/files/profile.sh
Normal file
12
srcpkgs/openjdk-common/files/profile.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
# only modify the environment if an openjdk*-jre package is installed
|
||||
if [ -e "/usr/lib/jvm/default-jre" ]; then
|
||||
# if an openjdk* package is installed, prefer it to the selected jre
|
||||
if [ -e "/usr/lib/jvm/default-jdk" ]; then
|
||||
export JAVA_HOME="/usr/lib/jvm/default-jdk"
|
||||
else
|
||||
export JAVA_HOME="/usr/lib/jvm/default-jre"
|
||||
fi
|
||||
# append the select jdk and jre bin and man dirs to the relevant PATHs
|
||||
export PATH="$PATH:/usr/lib/jvm/default-jdk/bin:/usr/lib/jvm/default-jre/bin"
|
||||
export MANPATH="$MANPATH:/usr/lib/jvm/default-jdk/man:/usr/lib/jvm/default-jre/man"
|
||||
fi
|
12
srcpkgs/openjdk-common/template
Normal file
12
srcpkgs/openjdk-common/template
Normal file
|
@ -0,0 +1,12 @@
|
|||
# Template file for 'openjdk-common'
|
||||
pkgname=openjdk-common
|
||||
version=1
|
||||
revision=1
|
||||
short_desc="Common files for OpenJDK packages"
|
||||
maintainer="classabbyamp <void@placeviolette.net>"
|
||||
license="Public Domain"
|
||||
homepage="https://www.voidlinux.org"
|
||||
|
||||
do_install() {
|
||||
vinstall "${FILESDIR}"/profile.sh 644 /etc/profile.d jdk.sh
|
||||
}
|
Loading…
Add table
Reference in a new issue