From d365b8e141f265b4ab489d39768c806b8cf629ac Mon Sep 17 00:00:00 2001 From: Andrew Hughes Date: Mon, 29 Jun 2026 22:52:05 +0100 Subject: [PATCH] Remove macro references in comments where possible (%dnl not compatible enough yet) - After discussion with fitzsim, it is easier and more compatible - to rewrite (or just plain drop in the case of the %patch examples) - macros in comments. There doesn't seem to be a way to detect the - presence of %dnl on older RPM versions, so we can't use it until - we are only working on RHEL >= 9. - While it works fine locally, attempting to build on CentOS 9 causes - the srpm stage to fail with: - error: /builddir/build/SPECS/java-25-openjdk.spec: line 3: %dnl: unexpected argument Resolves: RHEL-151193 --- java-21-openjdk.spec | 51 ++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 28 deletions(-) diff --git a/java-21-openjdk.spec b/java-21-openjdk.spec index 523a84f..70bc7bb 100644 --- a/java-21-openjdk.spec +++ b/java-21-openjdk.spec @@ -87,19 +87,20 @@ %global normal_build %{nil} %endif -# We have hardcoded list of files, which is appearing in alternatives, and in files -# in alternatives those are slaves and master, very often triplicated by man pages -# in files all masters and slaves are ghosted -# the ghosts are here to allow installation via query like `dnf install /usr/bin/java` -# you can list those files, with appropriate sections: cat *.spec | grep -e --install -e --slave -e post_ -e alternatives +# We have a hardcoded list of files, which appears in alternatives and in files +# In alternatives, those are slaves and master, very often triplicated by man pages +# In files, all masters and slaves are ghosted +# The ghosts are here to allow installation via query like `dnf install /usr/bin/java` +# You can list those files, with appropriate sections: cat *.spec | grep -e --install -e --slave -e post_ -e alternatives # TODO - fix those hardcoded lists via single list -# Those files must *NOT* be ghosted for *slowdebug* packages +# Those files must *NOT* be ghosted for *debug* packages # FIXME - if you are moving jshell or jlink or similar, always modify all three sections -# you can check via headless and devels: +# You can check via headless and devels: # rpm -ql --noghost java-11-openjdk-headless-11.0.1.13-8.fc29.x86_64.rpm | grep bin # == rpm -ql java-11-openjdk-headless-slowdebug-11.0.1.13-8.fc29.x86_64.rpm | grep bin # != rpm -ql java-11-openjdk-headless-11.0.1.13-8.fc29.x86_64.rpm | grep bin -# similarly for other %%{_jvmdir}/{jre,java} and %%{_javadocdir}/{java,java-zip} +# and similarly for other packages. + %define is_release_build() %( if [ "%{?1}" == "%{debug_suffix_unquoted}" -o "%{?1}" == "%{fastdebug_suffix_unquoted}" ]; then echo "0" ; else echo "1"; fi ) # while JDK is a techpreview(is_system_jdk=0), some provides are turned off. Once jdk stops to be an techpreview, move it to 1 @@ -310,8 +311,9 @@ %global interimver 0 %global updatever 11 %global patchver 0 + # We don't add any LTS designator for STS packages (Fedora and EPEL). -# We need to explicitly exclude EPEL as it would have the %%{rhel} macro defined. +# We need to explicitly exclude EPEL as it has the rhel macro defined. %if 0%{?rhel} && !0%{?epel} %global lts_designator "LTS" %global lts_designator_zip -%{lts_designator} @@ -323,7 +325,8 @@ # Define vendor information used by OpenJDK %global oj_vendor Red Hat, Inc. %global oj_vendor_url https://www.redhat.com/ -# Define what url should JVM offer in case of a crash report + +# Define what url the JVM should offer in case of a crash report # order may be important, epel may have rhel declared %if 0%{?epel} %global oj_vendor_bug_url https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora%20EPEL&component=%{name}&version=epel%{epel} @@ -392,8 +395,8 @@ # Define milestone (EA for pre-releases, GA for releases) # Release will be (where N is usually a number starting at 1): -# - 0.N%%{?extraver}%%{?dist} for EA releases, -# - N%%{?extraver}{?dist} for GA releases +# - 0.N.ea for EA releases, +# - N for GA releases %global is_ga 1 %if %{is_ga} %global build_type GA @@ -409,7 +412,7 @@ %global eaprefix 0. %endif -# parametrized macros are order-sensitive +# Parameterised macros are order-sensitive %global compatiblename java-%{featurever}-%{origin} %global fullversion %{compatiblename}-%{version}-%{release} # images directories from upstream build @@ -463,7 +466,7 @@ %global rpm_state_dir %{_localstatedir}/lib/rpm-state/ # For flatpack builds hard-code /usr/sbin/alternatives, -# otherwise use %%{_sbindir} relative path. +# otherwise use _sbindir relative path. %if 0%{?flatpak} %global alternatives_requires /usr/sbin/alternatives %else @@ -1403,9 +1406,11 @@ Source30: 0008-Tools.gmk-Use-update-repository-on-RHEL-rather-than-.patch ############################################ # Crypto policy and FIPS support patches + # Patch is generated from the fips-21u tree at https://github.com/rh-openjdk/jdk/tree/fips-21u -# as follows: git diff %%{vcstag} src make test > fips-21u-$(git show -s --format=%h HEAD).patch +# as follows: git diff src make test > fips-21u-$(git show -s --format=%h HEAD).patch # Diff is limited to src and make subdirectories to exclude .github changes + # Fixes currently included: # PR3183, RH1340845: Follow system wide crypto policy # PR3695: Allow use of system crypto policy to be disabled by the user @@ -1909,19 +1914,7 @@ sh %{SOURCE12} %{top_level_dir_name} %endif # Patch the JDK -# This syntax is deprecated: -# %patchN [...] -# and should be replaced with: -# %patch -PN [...] -# For example: -# %patch1001 -p1 -# becomes: -# %patch -P1001 -p1 -# The replacement format suggested by recent (circa Fedora 38) RPM -# deprecation messages: -# %patch N [...] -# is not backward-compatible with prior (circa RHEL-8) versions of -# rpmbuild. + pushd %{top_level_dir_name} # Add crypto policy and FIPS support %patch -P1001 -p1 @@ -2583,9 +2576,11 @@ cjc.mainProgram(args) - * scripts/builds/waive_rpminspect.sh: Likewise. - * scripts/builds/waive_usual_rpminspect.sh: Likewise and add missing WORKING_DIR variable. - * scripts/builds/waive_usual_tier0.sh: Remove redundant 'test "x"' usage. +- Remove macro references in comments where possible (%dnl not compatible enough yet) - Resolves: RHEL-212332 - Resolves: RHEL-212334 - Resolves: RHEL-212336 +- Resolves: RHEL-151193 * Sat Jul 18 2026 Thomas Fitzsimmons - 1:21.0.11.0.10-3 - Disable abidiff inspection in rpminspect.yaml to avoid an out-of-memory error on the CentOS test farm