From 3364569ac1563b238c751518138bea0fddeee596 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Mon, 4 Nov 2024 18:15:17 -0600 Subject: [PATCH] Fix JAVA_HOME on Fedora 42 --- ldapjdk.spec | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/ldapjdk.spec b/ldapjdk.spec index ac2b9cf..6d26aa3 100644 --- a/ldapjdk.spec +++ b/ldapjdk.spec @@ -2,7 +2,8 @@ Name: ldapjdk ################################################################################ -%global product_id dogtag-ldapjdk +%global vendor_id dogtag +%global product_id %{vendor_id}-ldapjdk # Upstream version number: %global major_version 5 @@ -53,25 +54,19 @@ ExclusiveArch: %{java_arches} noarch # 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