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-149784
This commit is contained in:
Andrew Hughes 2026-06-29 22:52:05 +01:00
parent b671cef4f6
commit 1f0cfec497

View File

@ -101,7 +101,7 @@
# 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}
# similarly for other <_jvmdir>/{jre,java} and <_javadocdir>/{java,java-zip}
%define is_release_build() %( if [ "%{?1}" == "%{debug_suffix_unquoted}" -o "%{?1}" == "%{fastdebug_suffix_unquoted}" ]; then echo "0" ; else echo "1"; fi )
# Indicates whether this is the default JDK on this version of RHEL
@ -374,8 +374,8 @@
# Define milestone (EA for pre-releases, GA ("fcs") 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<dist> for EA releases,
# - N<dist> for GA releases
%global is_ga 1
%if %{is_ga}
%global milestone fcs
@ -398,7 +398,7 @@
%global javaver 1.%{majorver}.0
# parametrized macros are order-sensitive
# Parameterised macros are order-sensitive
%global compatiblename %{name}
%global fullversion %{compatiblename}-%{version}-%{release}
# images directories from upstream build
@ -446,7 +446,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
@ -470,7 +470,7 @@
%global tapsetdir %{tapsetdirttapset}/%{stapinstall}
%endif
# not-duplicated scriptlets for normal/debug packages
# non-duplicated scriptlets for normal/debug packages
%global update_desktop_icons /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%define save_alternatives() %{expand:
@ -1422,10 +1422,10 @@ URL: http://openjdk.java.net/
# openjdk/shenandoah-jdk8u contains an integration forest of
# OpenJDK 8u and the Shenandoah garbage collector
# To regenerate, use:
# VERSION=%%{shenandoah_revision}
# VERSION=<shenandoah_revision>
# FILE_NAME_ROOT=${VERSION}
# REPO_ROOT=<path to checked-out repository> generate_source_tarball.sh
# where the source is obtained from http://github.com/%%{project}/%%{repo}
# where the source is obtained from http://github.com/<project>/<repo>
Source0: %{shenandoah_revision}.tar.xz
# Use 'icedtea_sync.sh' to update the following
@ -1503,7 +1503,7 @@ Patch600: rh1750419-redhat_alt_java.patch
# Crypto policy and FIPS support patches
# Patch is generated from the fips tree at https://github.com/rh-openjdk/jdk8u/tree/fips
# as follows: git diff %%{openjdk_revision} common jdk > fips-8u-$(git show -s --format=%h HEAD).patch
# as follows: git diff <openjdk_revision> common jdk > fips-8u-$(git show -s --format=%h HEAD).patch
# Diff is limited to src and make subdirectories to exclude .github changes
# Fixes currently included:
# PR3183, RH1340845: Support Fedora/RHEL8 system crypto policy
@ -1967,12 +1967,14 @@ echo "Milestone: %{milestone}"
export XZ_OPT="-T0"
%endif
%setup -q -c -n %{uniquesuffix ""} -T -a 0
# https://bugzilla.redhat.com/show_bug.cgi?id=1189084
prioritylength=`expr length %{priority}`
if [ $prioritylength -ne 7 ] ; then
echo "priority must be 7 digits in total, violated"
exit 14
fi
# For old patches
ln -s %{top_level_dir_name} jdk8
ln -s %{top_level_dir_name} openjdk
@ -1986,20 +1988,6 @@ cp %{SOURCE101} %{top_level_dir_name}/common/autoconf/build-aux/
# OpenJDK patches
# 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.
%if %{system_libs}
# Remove libraries that are linked
sh %{SOURCE12}
@ -2140,7 +2128,6 @@ sed -i -e "s:^security.systemCACerts=.*:security.systemCACerts=%{cacerts_file}:"
export NUM_PROC=%(/usr/bin/getconf _NPROCESSORS_ONLN 2> /dev/null || :)
export NUM_PROC=${NUM_PROC:-1}
%if 0%{?_smp_ncpus_max}
# Honor %%_smp_ncpus_max
[ ${NUM_PROC} -gt %{?_smp_ncpus_max} ] && export NUM_PROC=%{?_smp_ncpus_max}
%endif
@ -2757,9 +2744,9 @@ done
-- see https://bugzilla.redhat.com/show_bug.cgi?id=1290388 for pretrans over pre
-- if copy-jdk-configs is in transaction, it installs in pretrans to temp
-- if copy_jdk_configs is in temp, then it means that copy-jdk-configs is in transaction and so is
-- preferred over one in %%{_libexecdir}. If it is not in transaction, then depends
-- preferred over one in <_libexecdir>. If it is not in transaction, then depends
-- whether copy-jdk-configs is installed or not. If so, then configs are copied
-- (copy_jdk_configs from %%{_libexecdir} used) or not copied at all
-- (copy_jdk_configs from <_libexecdir> used) or not copied at all
local posix = require "posix"
if (os.getenv("debug") == "true") then
@ -2977,10 +2964,12 @@ cjc.mainProgram(args)
- Bump zlib version to 1.3.2 following JDK-8378631
- Require tzdata 2026b due to upstream inclusion of JDK-8383175
- Add attempted patch for JDK-8385876 to fix -Wnonnull build failure with s390x Zero on CentOS 9
- Remove macro references in comments where possible (%dnl not compatible enough yet)
- Sync the copy of the portable specfile with the latest update
- ** This tarball is embargoed until 2026-07-21 @ 1pm PT. **
- Resolves: RHEL-212095
- Resolves: RHEL-188852
- Resolves: RHEL-149784
* Mon Apr 20 2026 Andrew Hughes <gnu.andrew@redhat.com> - 1:1.8.0.492.b09-2
- Bump release for PQC build