Sync the copy of the portable specfile with the latest update

Related: RHEL-47023
This commit is contained in:
Andrew Hughes 2024-07-12 21:44:52 +01:00
parent 521da0f35b
commit 1da4a20951
2 changed files with 151 additions and 91 deletions

View File

@ -1,6 +1,3 @@
# portable jdk 21 specific bug, _jvmdir being missing
%define _jvmdir /usr/lib/jvm
# debug_package %%{nil} is portable-jdks specific
%define debug_package %{nil}
@ -31,6 +28,12 @@
# Build with system libraries
%bcond_with system_libs
# This is RHEL 7 specific as it doesn't seem to have the
# __brp_strip_static_archive macro.
%if 0%{?rhel} == 7
%define __os_install_post %{nil}
%endif
# Workaround for stripping of debug symbols from static libraries
%if %{with staticlibs}
%define __brp_strip_static_archive %{nil}
@ -153,6 +156,8 @@
%else
%global gdb_arches %{jit_arches} %{zero_arches}
%endif
# Architecture on which we run Java only tests
%global jdk_test_arch x86_64
# Set of architectures for which we have a devkit
# Only used on RHEL
%if 0%{?centos} == 0
@ -237,6 +242,11 @@
# Target to use to just build HotSpot
%global hotspot_target hotspot
# DTS toolset to use to provide gcc & binutils
%if 0%{?rhel} == 7
%global dtsversion 10
%endif
# Filter out flags from the optflags macro that cause problems with the OpenJDK build
# We filter out -O flags so that the optimization of HotSpot is not lowered from O3 to O2
# We filter out -Wall which will otherwise cause HotSpot to produce hundreds of thousands of warnings (100+mb logs)
@ -379,7 +389,7 @@
%global origin_nice OpenJDK
%global top_level_dir_name %{vcstag}
%global top_level_dir_name_backup %{top_level_dir_name}-backup
%global buildver 1
%global buildver 7
%global rpmrelease 1
#%%global tagsuffix %%{nil}
# Priority must be 8 digits in total; up to openjdk 1.8, we were using 18..... so when we moved to 11, we had to add another digit
@ -399,7 +409,7 @@
# 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
%global is_ga 0
%global is_ga 1
%if %{is_ga}
%global build_type GA
%global ea_designator ""
@ -496,9 +506,6 @@
%global alternatives_requires %{_sbindir}/alternatives
%endif
# x86 is not supported by OpenJDK 17
ExcludeArch: %{ix86}
# Portables have no repo (requires/provides), but these are awesome for orientation in spec
# Also scriptlets are happily missing and files are handled old fashion
# not-duplicated requires/provides/obsoletes for normal/debug packages
@ -523,11 +530,20 @@ ExcludeArch: %{ix86}
# Prevent brp-java-repack-jars from being run
%global __jar_repack 0
# portables have grown out of its component, moving back to java-x-vendor
# this expression, when declared as global, filled component with java-x-vendor portable
%define component %(echo %{name} | sed "s;-portable;;g")
# Define an optional suffix for the OS this package is built on
%if 0%{?rhel} == 7
%global pkgos rhel7
%endif
Name: java-%{javaver}-%{origin}-portable
# Define the architectures on which we build
# On RHEL, this should be the architectures with a devkit
%if 0%{?centos} == 0
ExclusiveArch: %{devkit_arches}
%else
ExclusiveArch: %{aarch64} %{ppc64le} s390x x86_64
%endif
Name: java-%{javaver}-%{origin}-portable%{?pkgos:-%{pkgos}}
Version: %{newjavaver}.%{buildver}
Release: %{?eaprefix}%{rpmrelease}%{?extraver}%{?dist}
# java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons
@ -677,6 +693,11 @@ BuildRequires: desktop-file-utils
BuildRequires: elfutils-devel
BuildRequires: file
BuildRequires: fontconfig-devel
# RHEL 7 builds obtain a newer compiler from DTS
%if 0%{?rhel} == 7
BuildRequires: devtoolset-%{dtsversion}-gcc
BuildRequires: devtoolset-%{dtsversion}-gcc-c++
%else
%ifarch %{devkit_arches}
BuildRequires: %{devkit_name} >= 1.0-6
%else
@ -684,6 +705,7 @@ BuildRequires: %{devkit_name} >= 1.0-6
BuildRequires: gcc >= 4.8.3-8
BuildRequires: gcc-c++
%endif
%endif
BuildRequires: gdb
BuildRequires: libxslt
BuildRequires: libX11-devel
@ -696,7 +718,7 @@ BuildRequires: libXtst-devel
# Requirement for setting up nss.fips.cfg
BuildRequires: nss-devel
# Requirement for system security property test
# N/A for portable. RHEL7 doesn't provide them
# N/A for portable as we don't enable support for them
#BuildRequires: crypto-policies
BuildRequires: pkgconfig
BuildRequires: xorg-x11-proto-devel
@ -704,9 +726,8 @@ BuildRequires: zip
# to pack portable tarballs
BuildRequires: tar
BuildRequires: unzip
# Not needed for portables
# BuildRequires: javapackages-filesystem
BuildRequires: java-%{featurever}-openjdk-devel
BuildRequires: javapackages-filesystem
BuildRequires: java-%{featurever}-%{origin}%{?pkgos:-%{pkgos}}-devel
# Zero-assembler build requirement
%ifarch %{zero_arches}
BuildRequires: libffi-devel
@ -717,9 +738,6 @@ BuildRequires: libffi-devel
BuildRequires: graphviz
BuildRequires: pandoc
%endif
# 2024a required as of JDK-8325150
# Use 2023d until 2024a is in the buildroot
BuildRequires: tzdata-java >= 2023d
# cacerts build requirement in portable mode
BuildRequires: ca-certificates
@ -1441,17 +1459,10 @@ function packagejdk() {
jrearchive=${packagesdir}/%{jreportablearchive -- "$nameSuffix"}
staticname=%{staticlibsportablename -- "$nameSuffix"}
staticarchive=${packagesdir}/%{staticlibsportablearchive -- "$nameSuffix"}
debugarchive=${packagesdir}/%{jdkportablearchive -- "${nameSuffix}.debuginfo"}
unstrippedarchive=${packagesdir}/%{jdkportablearchive -- "${nameSuffix}.unstripped"}
# We only use docs for the release build
docname=%{docportablename}
docarchive=${packagesdir}/%{docportablearchive}
built_doc_archive=jdk-%{filever}%{ea_designator_zip}+%{buildver}%{lts_designator_zip}-docs.zip
# These are from the source tree so no debug variants
miscname=%{miscportablename}
miscarchive=${packagesdir}/%{miscportablearchive}
if [ "x$suffix" = "x" ] ; then
unstrippedarchive=${packagesdir}/%{jdkportablearchive -- "${nameSuffix}.unstripped"}
# Keep the unstripped version for consumption by RHEL RPMs
mv %{jdkimage}.unstripped ${jdkname}
createtar ${jdkname} ${unstrippedarchive}
@ -1465,6 +1476,15 @@ function packagejdk() {
# Release images have external debug symbols
if [ "x$suffix" = "x" ] ; then
debugarchive=${packagesdir}/%{jdkportablearchive -- "${nameSuffix}.debuginfo"}
# We only use docs for the release build
docname=%{docportablename}
docarchive=${packagesdir}/%{docportablearchive}
built_doc_archive=jdk-%{filever}%{ea_designator_zip}+%{buildver}%{lts_designator_zip}-docs.zip
# These are from the source tree so no debug variants
miscname=%{miscportablename}
miscarchive=${packagesdir}/%{miscportablearchive}
createtar ${jdkname} ${debugarchive} \*.debuginfo
genchecksum ${debugarchive}
@ -1637,30 +1657,63 @@ GDB=$(which gdb)
# Check Shenandoah is enabled
%if %{use_shenandoah_hotspot}
$JAVA_HOME//bin/java -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -version
$JAVA_HOME/bin/java -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -version
%endif
# Check unlimited policy has been used
$JAVA_HOME/bin/javac -d . %{SOURCE13}
$JAVA_HOME/bin/java --add-opens java.base/javax.crypto=ALL-UNNAMED TestCryptoLevel
# Only test on one architecture (the fastest) for Java only tests
%ifarch %{jdk_test_arch}
# Check ECC is working
$JAVA_HOME/bin/javac -d . %{SOURCE14}
$JAVA_HOME/bin/java $(echo $(basename %{SOURCE14})|sed "s|\.java||")
# Check unlimited policy has been used
$JAVA_HOME/bin/javac -d . %{SOURCE13}
$JAVA_HOME/bin/java --add-opens java.base/javax.crypto=ALL-UNNAMED TestCryptoLevel
# Check system crypto (policy) is active and can be disabled
# Test takes a single argument - true or false - to state whether system
# security properties are enabled or not.
$JAVA_HOME/bin/javac -d . %{SOURCE15}
export PROG=$(echo $(basename %{SOURCE15})|sed "s|\.java||")
export SEC_DEBUG="-Djava.security.debug=properties"
# Specific to portable:System security properties to be off by default
$JAVA_HOME/bin/java ${SEC_DEBUG} ${PROG} false
$JAVA_HOME/bin/java ${SEC_DEBUG} -Djava.security.disableSystemPropertiesFile=true ${PROG} false
# Check ECC is working
$JAVA_HOME/bin/javac -d . %{SOURCE14}
$JAVA_HOME/bin/java $(echo $(basename %{SOURCE14})|sed "s|\.java||")
# Check correct vendor values have been set
$JAVA_HOME/bin/javac -d . %{SOURCE16}
$JAVA_HOME/bin/java $(echo $(basename %{SOURCE16})|sed "s|\.java||") "%{oj_vendor}" "%{oj_vendor_url}" "%{oj_vendor_bug_url}" "%{oj_vendor_version}"
# Check system crypto (policy) is active and can be disabled
# Test takes a single argument - true or false - to state whether system
# security properties are enabled or not.
$JAVA_HOME/bin/javac -d . %{SOURCE15}
export PROG=$(echo $(basename %{SOURCE15})|sed "s|\.java||")
export SEC_DEBUG="-Djava.security.debug=properties"
# Specific to portable:System security properties to be off by default
$JAVA_HOME/bin/java ${SEC_DEBUG} ${PROG} false
$JAVA_HOME/bin/java ${SEC_DEBUG} -Djava.security.disableSystemPropertiesFile=true ${PROG} false
# Check correct vendor values have been set
$JAVA_HOME/bin/javac -d . %{SOURCE16}
$JAVA_HOME/bin/java $(echo $(basename %{SOURCE16})|sed "s|\.java||") "%{oj_vendor}" "%{oj_vendor_url}" "%{oj_vendor_bug_url}" "%{oj_vendor_version}"
%if ! 0%{?flatpak}
# Check translations are available for new timezones (during flatpak builds, the
# tzdb.dat used by this test is not where the test expects it, so this is
# disabled for flatpak builds)
# Disable test until we are on the latest JDK
$JAVA_HOME/bin/javac -d . %{SOURCE18}
$JAVA_HOME/bin/java $(echo $(basename %{SOURCE18})|sed "s|\.java||") JRE
$JAVA_HOME/bin/java -Djava.locale.providers=CLDR $(echo $(basename %{SOURCE18})|sed "s|\.java||") CLDR
%endif
# Check src.zip has all sources. See RHBZ#1130490
unzip -l $JAVA_HOME/lib/src.zip | grep 'sun.misc.Unsafe'
# Check class files include useful debugging information
$JAVA_HOME/bin/javap -l java.lang.Object | grep "Compiled from"
$JAVA_HOME/bin/javap -l java.lang.Object | grep LineNumberTable
$JAVA_HOME/bin/javap -l java.lang.Object | grep LocalVariableTable
# Check generated class files include useful debugging information
$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep "Compiled from"
$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep LineNumberTable
$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep LocalVariableTable
%else
# Just run a basic java -version test on other architectures
$JAVA_HOME/bin/java -version
%endif
# Check java launcher has no SSB mitigation
if ! ${NM} $JAVA_HOME/bin/java | grep set_speculation ; then true ; else false; fi
@ -1673,16 +1726,6 @@ ${NM} %{altjavaoutputdir}/%{alt_java_name} | grep prctl
if ! ${NM} %{altjavaoutputdir}/%{alt_java_name} | grep prctl ; then true ; else false; fi
%endif
%if ! 0%{?flatpak}
# Check translations are available for new timezones (during flatpak builds, the
# tzdb.dat used by this test is not where the test expects it, so this is
# disabled for flatpak builds)
# Disable test until we are on the latest JDK
$JAVA_HOME/bin/javac -d . %{SOURCE18}
$JAVA_HOME/bin/java $(echo $(basename %{SOURCE18})|sed "s|\.java||") JRE
$JAVA_HOME/bin/java -Djava.locale.providers=CLDR $(echo $(basename %{SOURCE18})|sed "s|\.java||") CLDR
%endif
%if %{include_staticlibs}
# Check debug symbols in static libraries (smoke test)
export STATIC_LIBS_HOME=${top_dir_abs_staticlibs_build_path}/images/%{static_libs_image}
@ -1763,19 +1806,6 @@ EOF
grep 'JavaCallWrapper::JavaCallWrapper' gdb.out
%endif
# Check src.zip has all sources. See RHBZ#1130490
unzip -l $JAVA_HOME/lib/src.zip | grep 'sun.misc.Unsafe'
# Check class files include useful debugging information
$JAVA_HOME/bin/javap -l java.lang.Object | grep "Compiled from"
$JAVA_HOME/bin/javap -l java.lang.Object | grep LineNumberTable
$JAVA_HOME/bin/javap -l java.lang.Object | grep LocalVariableTable
# Check generated class files include useful debugging information
$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep "Compiled from"
$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep LineNumberTable
$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep LocalVariableTable
# build cycles check
done
@ -1791,12 +1821,10 @@ for suffix in %{build_loop} ; do
nameSuffix=`echo "$suffix"| sed s/-/./`
fi
# These definitions should match those in installjdk
# These definitions should match those in packagejdk
jdkarchive=${packagesdir}/%{jdkportablearchive -- "$nameSuffix"}
jrearchive=${packagesdir}/%{jreportablearchive -- "$nameSuffix"}
staticarchive=${packagesdir}/%{staticlibsportablearchive -- "$nameSuffix"}
debugarchive=${packagesdir}/%{jdkportablearchive -- "${nameSuffix}.debuginfo"}
unstrippedarchive=${packagesdir}/%{jdkportablearchive -- "${nameSuffix}.unstripped"}
mkdir -p $RPM_BUILD_ROOT%{_jvmdir}
@ -1811,23 +1839,23 @@ for suffix in %{build_loop} ; do
%endif
if [ "x$suffix" = "x" ] ; then
# These definitions should match those in packagejdk
debugarchive=${packagesdir}/%{jdkportablearchive -- "${nameSuffix}.debuginfo"}
unstrippedarchive=${packagesdir}/%{jdkportablearchive -- "${nameSuffix}.unstripped"}
docarchive=${packagesdir}/%{docportablearchive}
miscarchive=${packagesdir}/%{miscportablearchive}
mv ${debugarchive} $RPM_BUILD_ROOT%{_jvmdir}/
mv ${debugarchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/
mv ${unstrippedarchive} $RPM_BUILD_ROOT%{_jvmdir}/
mv ${unstrippedarchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/
mv ${docarchive} $RPM_BUILD_ROOT%{_jvmdir}/
mv ${docarchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/
mv ${miscarchive} $RPM_BUILD_ROOT%{_jvmdir}/
mv ${miscarchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/
fi
done
# These definitions should match those in installjdk
# Install outside the loop as there are no debug variants
docarchive=${packagesdir}/%{docportablearchive}
miscarchive=${packagesdir}/%{miscportablearchive}
mv ${docarchive} $RPM_BUILD_ROOT%{_jvmdir}/
mv ${docarchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/
mv ${miscarchive} $RPM_BUILD_ROOT%{_jvmdir}/
mv ${miscarchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/
# To show sha in the build log
for file in `ls $RPM_BUILD_ROOT%{_jvmdir}/*.sha256sum` ; do
ls -l $file ;
@ -1845,6 +1873,8 @@ done
# placeholder
%endif
%if %{include_normal_build}
%files devel
%{_jvmdir}/%{jdkportablearchive -- %%{nil}}
%{_jvmdir}/%{jdkportablearchive -- .debuginfo}
@ -1861,6 +1891,16 @@ done
%{_jvmdir}/%{jdkportablearchive -- .unstripped}
%{_jvmdir}/%{jdkportablearchive -- .unstripped}.sha256sum
%files docs
%{_jvmdir}/%{docportablearchive}
%{_jvmdir}/%{docportablearchive}.sha256sum
%files misc
%{_jvmdir}/%{miscportablearchive}
%{_jvmdir}/%{miscportablearchive}.sha256sum
%endif
%if %{include_debug_build}
%files slowdebug
@ -1897,15 +1937,34 @@ done
%endif
%files docs
%{_jvmdir}/%{docportablearchive}
%{_jvmdir}/%{docportablearchive}.sha256sum
%files misc
%{_jvmdir}/%{miscportablearchive}
%{_jvmdir}/%{miscportablearchive}.sha256sum
%changelog
* Fri Jul 12 2024 Andrew Hughes <gnu.andrew@redhat.com> - 1:21.0.4.0.7-1
- Update to jdk-21.0.4+7 (GA)
- Update release notes to 21.0.4+7
- Switch to GA mode.
- Sync with RHEL 7 portable build:
- Conditionally define __os_install_post, dtsversion & pkgos only on RHEL 7
- Use ExclusiveArch over ExcludeArch
- Depend on devtoolset only on RHEL 7
- Use javapackages-filesystem rather than manually defining _jvmdir
- Restrict pandoc dependency to RHEL/CentOS 8
- Drop unused component macro
- Sync ExclusiveArch with devkit_arches on RHEL only
- ** This tarball is embargoed until 2024-07-16 @ 1pm PT. **
- Resolves: OPENJDK-2756
- Resolves: OPENJDK-3163
* Wed Jun 26 2024 Andrew Hughes <gnu.andrew@redhat.com> - 1:21.0.4.0.5-0.1.ea
- Update to jdk-21.0.4+5 (EA)
- Update release notes to 21.0.4+5
- Move unstripped, misc and doc tarball handling into normal build / no suffix blocks
- Limit Java only tests to one architecture using jdk_test_arch
- Drop unneeded tzdata-java build dependency following f854bb3955fb57bba4e83d09813e9cfd0e81079e
- Resolves: OPENJDK-3133
- Resolves: OPENJDK-3237
- Resolves: OPENJDK-3182
- Resolves: OPENJDK-3190
* Sat Jun 22 2024 Andrew Hughes <gnu.andrew@redhat.com> - 1:21.0.4.0.1-0.1.ea
- Update to jdk-21.0.4+1 (EA)
- Update release notes to 21.0.4+1

View File

@ -2521,6 +2521,7 @@ cjc.mainProgram(args)
- Update to jdk-21.0.4+7 (GA)
- Update release notes to 21.0.4+7
- Switch to GA mode.
- Sync the copy of the portable specfile with the latest update
- ** This tarball is embargoed until 2024-07-16 @ 1pm PT. **
- Resolves: RHEL-47023