From b15131971393b617d41814cbb022041d18ec4353 Mon Sep 17 00:00:00 2001 From: Andrew Hughes Date: Tue, 18 Feb 2025 11:54:45 +0000 Subject: [PATCH] Cleanup java_javadoc_rpo macro, removing unused argument and duplicated Requires Related: RHEL-78710 --- java-21-openjdk.spec | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/java-21-openjdk.spec b/java-21-openjdk.spec index 097affc..26fd57a 100644 --- a/java-21-openjdk.spec +++ b/java-21-openjdk.spec @@ -366,7 +366,7 @@ %global top_level_dir_name %{vcstag} %global top_level_dir_name_backup %{top_level_dir_name}-backup %global buildver 7 -%global rpmrelease 2 +%global rpmrelease 3 # Settings used by the portable build %global portablerelease 1 # Portable suffix differs between RHEL and CentOS @@ -1139,19 +1139,14 @@ Provides: java-%{origin}-demo%{?1} = %{epoch}:%{version}-%{release} # Potentially, the legal documentation could be split into a small package # which the javadoc and headless packages then depend on, but it does not # seem worth the additional disruption just to have docs installed and no JDK. +# Arguments: +# - 1 = package name suffix (called twice for javadoc-zip with nil & -zip) %define java_javadoc_rpo() %{expand: -Requires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release} -OrderWithRequires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release} -# Post requires alternatives to install javadoc alternative -Requires(post): %{alternatives_requires} -# Postun requires alternatives to uninstall javadoc alternative -Requires(postun): %{alternatives_requires} - # Standard JPackage javadoc provides -Provides: java-%{javaver}-javadoc%{?1}%{?2} = %{epoch}:%{version}-%{release} -Provides: java-%{javaver}-%{origin}-javadoc%{?1}%{?2} = %{epoch}:%{version}-%{release} +Provides: java-%{javaver}-javadoc%{?1} = %{epoch}:%{version}-%{release} +Provides: java-%{javaver}-%{origin}-javadoc%{?1} = %{epoch}:%{version}-%{release} %if %is_system_jdk -Provides: java-javadoc%{?1}%{?2} = %{epoch}:%{version}-%{release} +Provides: java-javadoc%{?1} = %{epoch}:%{version}-%{release} %endif } @@ -1717,25 +1712,34 @@ Summary: %{origin_nice} %{featurever} API documentation Group: Documentation %endif Requires: javapackages-filesystem +Requires: %{name}-headless%{?_isa} = %{epoch}:%{version}-%{release} +OrderWithRequires: %{name}-headless%{?_isa} = %{epoch}:%{version}-%{release} Obsoletes: javadoc-slowdebug < 1:13.0.0.33-1.rolling +# Post requires alternatives to install javadoc alternative +Requires(post): %{alternatives_requires} +# Postun requires alternatives to uninstall javadoc alternative +Requires(postun): %{alternatives_requires} -%{java_javadoc_rpo -- %{nil} %{nil}} +%{java_javadoc_rpo -- %{nil}} %description javadoc The %{origin_nice} %{featurever} API documentation. -%endif - -%if %{include_normal_build} %package javadoc-zip Summary: %{origin_nice} %{featurever} API documentation compressed in a single archive %if (0%{?rhel} > 0 && 0%{?rhel} <= 8) || (0%{?fedora} >= 0 && 0%{?fedora} < 30) Group: Documentation %endif Requires: javapackages-filesystem +Requires: %{name}-headless%{?_isa} = %{epoch}:%{version}-%{release} +OrderWithRequires: %{name}-headless%{?_isa} = %{epoch}:%{version}-%{release} Obsoletes: javadoc-zip-slowdebug < 1:13.0.0.33-1.rolling +# Post requires alternatives to install javadoc alternative +Requires(post): %{alternatives_requires} +# Postun requires alternatives to uninstall javadoc alternative +Requires(postun): %{alternatives_requires} -%{java_javadoc_rpo -- %{nil} -zip} -%{java_javadoc_rpo -- %{nil} %{nil}} +%{java_javadoc_rpo -- -zip} +%{java_javadoc_rpo -- %{nil}} %description javadoc-zip The %{origin_nice} %{featurever} API documentation compressed in a single archive. @@ -2457,6 +2461,10 @@ exit 0 %endif %changelog +* Tue Feb 18 2025 Andrew Hughes - 1:21.0.6.0.7-3 +- Cleanup java_javadoc_rpo macro, removing unused argument and duplicated Requires +- Related: RHEL-78710 + * Tue Feb 11 2025 Andrew Hughes - 1:21.0.6.0.7-2 - Attempt to avoid conflicts between subpackages - Make javadoc packages depend on headless package for legal documentation