Skip to content

Commit

Permalink
Fix JAVA_HOME on Fedora 42
Browse files Browse the repository at this point in the history
  • Loading branch information
edewata committed Nov 5, 2024
1 parent bb4b078 commit 7407f40
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions pki.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
Name: pki
################################################################################

%global vendor_id dogtag
%global product_name Dogtag PKI
%global product_id dogtag-pki
%global theme dogtag
%global product_id %{vendor_id}-pki
%global theme %{vendor_id}

# Upstream version number:
%global major_version 11
Expand Down Expand Up @@ -63,25 +64,19 @@ ExcludeArch: i686
# Java
################################################################################

%if 0%{?rhel} && 0%{?rhel} <= 9
%if 0%{?fedora} && 0%{?fedora} <= 39 || 0%{?rhel} && 0%{?rhel} <= 9

# use Java 17 on Fedora 39 or older and RHEL 9 or older
%define java_devel java-17-openjdk-devel
%define java_headless java-17-openjdk-headless
%define java_home %{_jvmdir}/jre-17-openjdk

%else

# Use Java 21 on Fedora 40+ and RHEL 10, otherwise use Java 17.
%global java_devel java-devel >= 1:17
%global java_headless java-headless >= 1:17

# Don't use find since it might not work well with local builds.
# find {_jvmdir} -maxdepth 1 | grep "jre-[0-9]\+$"
%global java_home %(
source /usr/share/java-utils/java-functions;
_prefer_jre=true;
set_jvm;
echo $JAVA_HOME)
# otherwise, use Java 21
%define java_devel java-21-openjdk-devel
%define java_headless java-21-openjdk-headless
%define java_home %{_jvmdir}/jre-21-openjdk

%endif

Expand Down

0 comments on commit 7407f40

Please sign in to comment.