Use Java 11 build tool bindings for package builds

Resolves: RHEL-62403
This commit is contained in:
Marián Konček 2024-11-18 13:33:04 +01:00
parent ca4ffa814e
commit bcd96ec681
2 changed files with 37 additions and 3 deletions

View File

@ -0,0 +1,25 @@
From 849e007338475a125cc791a91902b010ff3b5337 Mon Sep 17 00:00:00 2001
From: Marian Koncek <mkoncek@redhat.com>
Date: Tue, 22 Oct 2024 00:09:51 +0200
Subject: [PATCH] Do not set JAVA_HOME for ant
---
macros.d/macros.jpackage | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/macros.d/macros.jpackage b/macros.d/macros.jpackage
index 13595e9..6c70788 100644
--- a/macros.d/macros.jpackage
+++ b/macros.d/macros.jpackage
@@ -15,7 +15,7 @@
#==============================================================================
# ---- default Java commands
-%ant %{?jpb_env} JAVA_HOME=%{java_home} ant
+%ant %{?jpb_env} ant
%jar %{java_home}/bin/jar
%java %(. @{javadir}-utils/java-functions; set_javacmd; echo $JAVACMD)
%javac %{java_home}/bin/javac
--
2.47.0

View File

@ -14,7 +14,7 @@
Name: javapackages-tools
Version: 6.0.0
Release: 6%{?dist}
Release: 7%{?dist}
Summary: Macros and scripts for Java packaging support
License: BSD
URL: https://github.com/fedora-java/javapackages
@ -27,6 +27,8 @@ Source8: toolchains-openjdk8.xml
Source11: toolchains-openjdk11.xml
Source17: toolchains-openjdk17.xml
Patch1: 0001-Do-not-set-JAVA_HOME-for-ant.patch
BuildRequires: coreutils
BuildRequires: which
BuildRequires: make
@ -68,6 +70,8 @@ Requires: %{name} = %{version}-%{release}
Requires: javapackages-local = %{version}-%{release}
%if %{without bootstrap}
Requires: %{_bindir}/xmvn
# NOTE keep using Java 11 for the whole lifecycle
Requires: maven-openjdk11
Requires: mvn(org.fedoraproject.xmvn:xmvn-mojo)
# Common Maven plugins required by almost every build. It wouldn't make
# sense to explicitly require them in every package built with Maven.
@ -111,7 +115,9 @@ Requires: %{_bindir}/xmvn-install
Requires: %{_bindir}/xmvn-subst
Requires: %{_bindir}/xmvn-resolve
# Java build systems don't have hard requirement on java-devel, so it should be there
Requires: java-17-openjdk-devel
# NOTE keep using Java 11 for the whole lifecycle
Requires: java-11-openjdk-devel
Requires: (ant-openjdk11 if ant)
%endif
%description -n javapackages-local
@ -154,7 +160,7 @@ Requires: java-17-openjdk-devel
OpenJDK 17 toolchain for XMvn
%prep
%setup -q -n javapackages-%{version}
%autosetup -p1 -n javapackages-%{version}
sed -i '/^manpage /d' build
sed -i '/${mandir}/d' install
@ -220,6 +226,9 @@ install -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/java/javapackages-config
%license LICENSE
%changelog
* Mon Nov 18 2024 Marián Konček <mkoncek@redhat.com> - 6.0.0-7
- Use Java 11 build tool bindings for package builds
* Mon Nov 04 2024 Marián Konček <mkoncek@redhat.com> - 6.0.0-6
- Drop generated Requires on various Java versions
- Related: RHEL-62409