@ -150,6 +150,8 @@
%else
%else
%global gdb_arches %{jit_arches} %{zero_arches}
%global gdb_arches %{jit_arches} %{zero_arches}
%endif
%endif
# Architecture on which we run Java only tests
%global jdk_test_arch x86_64
# By default, we build a slowdebug build during main build on JIT architectures
# By default, we build a slowdebug build during main build on JIT architectures
%if %{with slowdebug}
%if %{with slowdebug}
@ -314,7 +316,7 @@
# New Version-String scheme-style defines
# New Version-String scheme-style defines
%global featurever 21
%global featurever 21
%global interimver 0
%global interimver 0
%global updatever 3
%global updatever 4
%global patchver 0
%global patchver 0
# buildjdkver is usually same as %%{featurever},
# buildjdkver is usually same as %%{featurever},
# but in time of bootstrap of next jdk, it is featurever-1,
# but in time of bootstrap of next jdk, it is featurever-1,
@ -378,7 +380,7 @@
%global origin_nice OpenJDK
%global origin_nice OpenJDK
%global top_level_dir_name %{vcstag}
%global top_level_dir_name %{vcstag}
%global top_level_dir_name_backup %{top_level_dir_name}-backup
%global top_level_dir_name_backup %{top_level_dir_name}-backup
%global buildver 9
%global buildver 7
%global rpmrelease 1
%global rpmrelease 1
#%%global tagsuffix %%{nil}
#%%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
# 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
@ -520,9 +522,9 @@
# Define the architectures on which we build
# Define the architectures on which we build
ExclusiveArch: %{aarch64} %{ppc64le} s390x x86_64
ExclusiveArch: %{aarch64} %{ppc64le} s390x x86_64
# Define the OS this package is built on
# Define the OS this package is built on
#global pkgos rhel7
%undefine pkgos
Name: java-%{javaver}-%{origin}-portable%{?pkgos:-%{pkgos}}
Name: java-%{javaver}-%{origin}-portable%{?pkgos:-%{pkgos}}
Version: %{newjavaver}.%{buildver}
Version: %{newjavaver}.%{buildver}
Release: %{?eaprefix}%{rpmrelease}%{?extraver}%{?dist}
Release: %{?eaprefix}%{rpmrelease}%{?extraver}%{?dist}
# java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons
# java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons
@ -535,7 +537,7 @@ Release: %{?eaprefix}%{rpmrelease}%{?extraver}%{?dist}
# JDK package >= 1.6.0 to 1, and packages referring to JDK virtual
# JDK package >= 1.6.0 to 1, and packages referring to JDK virtual
# provides >= 1.6.0 must specify the epoch, "java >= 1:1.6.0".
# provides >= 1.6.0 must specify the epoch, "java >= 1:1.6.0".
Epoch: 1
Epoch: 1
# portables have grown out of its component, moving back to java-x-vendor
# 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
# this expression, when declared as global, filled component with java-x-vendor portable
@ -544,7 +546,7 @@ Epoch: 1
Summary: %{origin_nice} %{featurever} Runtime Environment portable edition
Summary: %{origin_nice} %{featurever} Runtime Environment portable edition
# Groups are only used up to RHEL 8 and on Fedora versions prior to F30
# Groups are only used up to RHEL 8 and on Fedora versions prior to F30
%if (0%{?rhel} > 0 && 0%{?rhel} <= 8) || (0%{?fedora} >= 0 && 0%{?fedora} < 30)
%if (0%{?rhel} > 0 && 0%{?rhel} <= 8) || (0%{?fedora} >= 0 && 0%{?fedora} < 30)
Group: Development/Languages
Group: Development/Languages
%endif
%endif
# HotSpot code is licensed under GPLv2
# HotSpot code is licensed under GPLv2
@ -561,8 +563,8 @@ Group: Development/Languages
# The test code includes copies of NSS under the Mozilla Public License v2.0
# The test code includes copies of NSS under the Mozilla Public License v2.0
# The PCSClite headers are under a BSD with advertising license
# The PCSClite headers are under a BSD with advertising license
# The elliptic curve cryptography (ECC) source code is licensed under the LGPLv2.1 or any later version
# The elliptic curve cryptography (ECC) source code is licensed under the LGPLv2.1 or any later version
License: ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with exceptions and IJG and LGPLv2+ and MIT and MPLv2.0 and Public Domain and W3C and zlib and ISC and FTL and RSA
License: ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with exceptions and IJG and LGPLv2+ and MIT and MPLv2.0 and Public Domain and W3C and zlib and ISC and FTL and RSA
URL: http://openjdk.java.net/
URL: http://openjdk.java.net/
# The source tarball, generated using generate_source_tarball.sh
# The source tarball, generated using generate_source_tarball.sh
Source0: https://openjdk-sources.osci.io/openjdk%{featurever}/open%{vcstag}%{ea_designator_zip}.tar.xz
Source0: https://openjdk-sources.osci.io/openjdk%{featurever}/open%{vcstag}%{ea_designator_zip}.tar.xz
@ -676,6 +678,8 @@ BuildRequires: desktop-file-utils
BuildRequires: elfutils-devel
BuildRequires: elfutils-devel
BuildRequires: file
BuildRequires: file
BuildRequires: fontconfig-devel
BuildRequires: fontconfig-devel
#BuildRequires: devtoolset-%{dtsversion}-gcc
#BuildRequires: devtoolset-%{dtsversion}-gcc-c++
BuildRequires: gcc-c++
BuildRequires: gcc-c++
BuildRequires: gdb
BuildRequires: gdb
BuildRequires: libxslt
BuildRequires: libxslt
@ -709,9 +713,6 @@ BuildRequires: libffi-devel
BuildRequires: graphviz
BuildRequires: graphviz
BuildRequires: pandoc
BuildRequires: pandoc
%endif
%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
# cacerts build requirement in portable mode
BuildRequires: ca-certificates
BuildRequires: ca-certificates
# Earlier versions have a bug in tree vectorization on PPC
# Earlier versions have a bug in tree vectorization on PPC
@ -729,6 +730,7 @@ BuildRequires: harfbuzz-devel
BuildRequires: lcms2-devel
BuildRequires: lcms2-devel
BuildRequires: libjpeg-devel
BuildRequires: libjpeg-devel
BuildRequires: libpng-devel
BuildRequires: libpng-devel
BuildRequires: zlib-devel
%else
%else
# Version in src/java.desktop/share/legal/freetype.md
# Version in src/java.desktop/share/legal/freetype.md
Provides: bundled(freetype) = 2.13.2
Provides: bundled(freetype) = 2.13.2
@ -737,11 +739,13 @@ Provides: bundled(giflib) = 5.2.1
# Version in src/java.desktop/share/native/libharfbuzz/hb-version.h
# Version in src/java.desktop/share/native/libharfbuzz/hb-version.h
Provides: bundled(harfbuzz) = 8.2.2
Provides: bundled(harfbuzz) = 8.2.2
# Version in src/java.desktop/share/native/liblcms/lcms2.h
# Version in src/java.desktop/share/native/liblcms/lcms2.h
Provides: bundled(lcms2) = 2.15 .0
Provides: bundled(lcms2) = 2.16 .0
# Version in src/java.desktop/share/native/libjavajpeg/jpeglib.h
# Version in src/java.desktop/share/native/libjavajpeg/jpeglib.h
Provides: bundled(libjpeg) = 6b
Provides: bundled(libjpeg) = 6b
# Version in src/java.desktop/share/native/libsplashscreen/libpng/png.h
# Version in src/java.desktop/share/native/libsplashscreen/libpng/png.h
Provides: bundled(libpng) = 1.6.40
Provides: bundled(libpng) = 1.6.40
# Version in src/java.base/share/native/libzip/zlib/zlib.h
Provides: bundled(zlib) = 1.3.1
# We link statically against libstdc++ to increase portability
# We link statically against libstdc++ to increase portability
BuildRequires: libstdc++-static
BuildRequires: libstdc++-static
%endif
%endif
@ -757,7 +761,7 @@ The %{origin_nice} %{featurever} runtime environment - portable edition.
%package slowdebug
%package slowdebug
Summary: %{origin_nice} %{featurever} Runtime Environment portable edition %{debug_on}
Summary: %{origin_nice} %{featurever} Runtime Environment portable edition %{debug_on}
%if (0%{?rhel} > 0 && 0%{?rhel} <= 8) || (0%{?fedora} >= 0 && 0%{?fedora} < 30)
%if (0%{?rhel} > 0 && 0%{?rhel} <= 8) || (0%{?fedora} >= 0 && 0%{?fedora} < 30)
Group: Development/Languages
Group: Development/Languages
%endif
%endif
%{java_rpo -- %{debug_suffix_unquoted}}
%{java_rpo -- %{debug_suffix_unquoted}}
@ -770,7 +774,7 @@ The %{origin_nice} %{featurever} runtime environment - portable edition.
%package fastdebug
%package fastdebug
Summary: %{origin_nice} %{featurever} Runtime Environment portable edition %{fastdebug_on}
Summary: %{origin_nice} %{featurever} Runtime Environment portable edition %{fastdebug_on}
%if (0%{?rhel} > 0 && 0%{?rhel} <= 8) || (0%{?fedora} >= 0 && 0%{?fedora} < 30)
%if (0%{?rhel} > 0 && 0%{?rhel} <= 8) || (0%{?fedora} >= 0 && 0%{?fedora} < 30)
Group: Development/Languages
Group: Development/Languages
%endif
%endif
%{java_rpo -- %{fastdebug_suffix_unquoted}}
%{java_rpo -- %{fastdebug_suffix_unquoted}}
@ -783,7 +787,7 @@ The %{origin_nice} %{featurever} runtime environment - portable edition.
%package devel
%package devel
Summary: %{origin_nice} %{featurever} Development Environment portable edition
Summary: %{origin_nice} %{featurever} Development Environment portable edition
%if (0%{?rhel} > 0 && 0%{?rhel} <= 8) || (0%{?fedora} >= 0 && 0%{?fedora} < 30)
%if (0%{?rhel} > 0 && 0%{?rhel} <= 8) || (0%{?fedora} >= 0 && 0%{?fedora} < 30)
Group: Development/Languages
Group: Development/Languages
%endif
%endif
%{java_devel_rpo %{nil}}
%{java_devel_rpo %{nil}}
@ -796,7 +800,7 @@ The %{origin_nice} %{featurever} development tools - portable edition.
%package devel-slowdebug
%package devel-slowdebug
Summary: %{origin_nice} %{featurever} Runtime and Development Environment portable edition %{debug_on}
Summary: %{origin_nice} %{featurever} Runtime and Development Environment portable edition %{debug_on}
%if (0%{?rhel} > 0 && 0%{?rhel} <= 8) || (0%{?fedora} >= 0 && 0%{?fedora} < 30)
%if (0%{?rhel} > 0 && 0%{?rhel} <= 8) || (0%{?fedora} >= 0 && 0%{?fedora} < 30)
Group: Development/Languages
Group: Development/Languages
%endif
%endif
%{java_devel_rpo -- %{debug_suffix_unquoted}}
%{java_devel_rpo -- %{debug_suffix_unquoted}}
@ -810,7 +814,7 @@ The %{origin_nice} %{featurever} development tools - portable edition.
%package devel-fastdebug
%package devel-fastdebug
Summary: %{origin_nice} %{featurever} Runtime and Development Environment portable edition %{fastdebug_on}
Summary: %{origin_nice} %{featurever} Runtime and Development Environment portable edition %{fastdebug_on}
%if (0%{?rhel} > 0 && 0%{?rhel} <= 8) || (0%{?fedora} >= 0 && 0%{?fedora} < 30)
%if (0%{?rhel} > 0 && 0%{?rhel} <= 8) || (0%{?fedora} >= 0 && 0%{?fedora} < 30)
Group: Development/Tools
Group: Development/Tools
%endif
%endif
%{java_devel_rpo -- %{fastdebug_suffix_unquoted}}
%{java_devel_rpo -- %{fastdebug_suffix_unquoted}}
@ -1171,18 +1175,21 @@ function buildjdk() {
function stripjdk() {
function stripjdk() {
local outputdir=${1}
local outputdir=${1}
local jdkimagepath=${outputdir}/images/%{jdkimage}
local jdkimagepath=images/%{jdkimage}
local jreimagepath=${outputdir}/images/%{jreimage}
local jreimagepath=images/%{jreimage}
local jmodimagepath=${outputdir}/images/jmods
local jmodimagepath=images/jmods
local modulefile=lib/modules
local supportdir=${outputdir}/support
local supportdir=${outputdir}/support
local modulebuildpath=${outputdir}/jdk/modules
local modulebuildpath=${outputdir}/jdk/modules
local jdkoutdir=${outputdir}/${jdkimagepath}
local jreoutdir=${outputdir}/${jreimagepath}
if [ "x$suffix" = "x" ] ; then
if [ "x$suffix" = "x" ] ; then
# Keep the unstripped version for consumption by RHEL RPMs
# Keep the unstripped version for consumption by RHEL RPMs
cp -a ${jdkimagepath }{,.unstripped}
cp -a ${jdkoutdir }{,.unstripped}
# Strip the files
# Strip the files
for file in $(find ${jdkimagepath} ${jreimagepath } ${supportdir} ${modulebuildpath} -type f) ; do
for file in $(find ${jdkoutdir} ${jreoutdir } ${supportdir} ${modulebuildpath} -type f) ; do
if file ${file} | cut -d ':' -f 2 | grep -q 'ELF'; then
if file ${file} | cut -d ':' -f 2 | grep -q 'ELF'; then
noextfile=${file/.so/};
noextfile=${file/.so/};
bash -c "objcopy --only-keep-debug ${file} ${noextfile}.debuginfo";
bash -c "objcopy --only-keep-debug ${file} ${noextfile}.debuginfo";
@ -1196,24 +1203,53 @@ function stripjdk() {
echo "Support directory missing.";
echo "Support directory missing.";
exit 15
exit 15
fi
fi
for cmd in $(find ${supportdir} -name '*.jmod_exec.cmdline') ; do
# Build the java.base jmod a third time to fix the hashes of dependent jmods
for cmd in $(find ${supportdir}/${jmodimagepath} -name '*.jmod_exec.cmdline') \
${supportdir}/${jmodimagepath}/*java.base*exec.cmdline ; do
pre=${cmd/_exec/_pre};
pre=${cmd/_exec/_pre};
post=${cmd/_exec/_post};
post=${cmd/_exec/_post};
jmod=$(echo ${cmd}|sed 's#.*_create_##'|sed 's#_exec.cmdline##')
jmod=$(echo ${cmd}|sed 's#.*_create_##'|sed 's#_exec.cmdline##')
echo "Rebuilding ${jmod} against stripped binaries...";
echo "Rebuilding ${jmod} against stripped binaries...";
if [ -e ${pre} ] ; then
if [ -e ${pre} ] ; then
echo "Executing ${pre}...";
echo -e "Executing ${pre}...\n$(cat ${pre}) ";
cat ${pre} | sh -s ;
cat ${pre} | sh -s ;
fi
fi
echo "Executing ${cmd}...";
echo "Executing ${cmd}...$(cat ${cmd}) ";
cat ${cmd} | sh -s ;
cat ${cmd} | sh -s ;
if [ -e ${post} ] ; then
if [ -e ${post} ] ; then
echo "Executing ${post}...";
echo -e "Executing ${post}...\n$(cat ${post}) ";
cat ${post} | sh -s ;
cat ${post} | sh -s ;
fi
fi
done
done
rm -rf ${jdkimagepath}/jmods
cp -a ${jmodimagepath} ${jdkimagepath}
# Rebuild the image with the stripped modules
for image in ${jdkimagepath} ${jreimagepath} ; do
outdir=${outputdir}/${image};
jlink=${supportdir}/${image}/_jlink*_exec.cmdline;
# Backup the existing image as it contains
# files not generated by jlink
mv ${outdir}{,.bak};
# Regenerate the image using the command
# generated using the initial build
echo -e "Executing ${jlink}...\n$(cat ${jlink})";
cat ${jlink} | sh -s;
# Move the new jmods and module file from the new
# image to the old one
if [ -e ${outdir}.bak/jmods ] ; then
rm -rf ${outdir}.bak/jmods;
mv ${outdir}/jmods ${outdir}.bak;
fi
rm -f ${outdir}.bak/${modulefile};
mv ${outdir}/${modulefile} ${outdir}.bak/$(dirname ${modulefile});
# Restore the original image
rm -rf ${outdir};
mv ${outdir}{.bak,};
# Update the CDS archives
for cmd in ${supportdir}/${image}/*_gen_cds*_exec.cmdline ; do
echo -e "Executing ${cmd}...\n$(cat ${cmd})";
cat ${cmd} | sh -s;
done
done
fi
fi
}
}
@ -1293,6 +1329,7 @@ function createtar() {
local archive=${2}
local archive=${2}
local filter=${3}
local filter=${3}
local transform=${4}
local transform=${4}
local exclude=${5}
if [ "x${filter}" != "x" ] ; then
if [ "x${filter}" != "x" ] ; then
local filteroption="-name ${filter}";
local filteroption="-name ${filter}";
@ -1300,9 +1337,12 @@ function createtar() {
if [ "x${transform}" != "x" ] ; then
if [ "x${transform}" != "x" ] ; then
local transoption="--transform ${transform}";
local transoption="--transform ${transform}";
fi
fi
if [ "x${exclude}" != "x" ] ; then
local excludeoption="--exclude=${exclude}";
fi
local common_tar_opts="--owner=0 --group=0 --numeric-owner \
local common_tar_opts="--owner=0 --group=0 --numeric-owner \
${transoption} --create --xz"
${transoption} ${excludeoption} --create --xz"
# Capture tar version, removing the decimal point (so 1.28 => 128)
# Capture tar version, removing the decimal point (so 1.28 => 128)
tarver=$(tar --version|head -n1|sed -re 's|tar \(GNU tar\) ([0-9]).([0-9]*)|\1\2|')
tarver=$(tar --version|head -n1|sed -re 's|tar \(GNU tar\) ([0-9]).([0-9]*)|\1\2|')
echo "Detected tar ${tarver}"
echo "Detected tar ${tarver}"
@ -1354,17 +1394,10 @@ function packagejdk() {
jrearchive=${packagesdir}/%{jreportablearchive -- "$nameSuffix"}
jrearchive=${packagesdir}/%{jreportablearchive -- "$nameSuffix"}
staticname=%{staticlibsportablename -- "$nameSuffix"}
staticname=%{staticlibsportablename -- "$nameSuffix"}
staticarchive=${packagesdir}/%{staticlibsportablearchive -- "$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
if [ "x$suffix" = "x" ] ; then
unstrippedarchive=${packagesdir}/%{jdkportablearchive -- "${nameSuffix}.unstripped"}
# Keep the unstripped version for consumption by RHEL RPMs
# Keep the unstripped version for consumption by RHEL RPMs
mv %{jdkimage}.unstripped ${jdkname}
mv %{jdkimage}.unstripped ${jdkname}
createtar ${jdkname} ${unstrippedarchive}
createtar ${jdkname} ${unstrippedarchive}
@ -1378,6 +1411,15 @@ function packagejdk() {
# Release images have external debug symbols
# Release images have external debug symbols
if [ "x$suffix" = "x" ] ; then
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
createtar ${jdkname} ${debugarchive} \*.debuginfo
genchecksum ${debugarchive}
genchecksum ${debugarchive}
@ -1399,10 +1441,10 @@ function packagejdk() {
genchecksum ${miscarchive}
genchecksum ${miscarchive}
fi
fi
createtar ${jdkname} ${jdkarchive}
createtar ${jdkname} ${jdkarchive} "" "" "**.debuginfo"
genchecksum ${jdkarchive}
genchecksum ${jdkarchive}
createtar ${jrename} ${jrearchive}
createtar ${jrename} ${jrearchive} "" "" "**.debuginfo"
genchecksum ${jrearchive}
genchecksum ${jrearchive}
%if %{include_staticlibs}
%if %{include_staticlibs}
@ -1514,30 +1556,63 @@ export JAVA_HOME=${top_dir_abs_main_build_path}/images/%{jdkimage}
# Check Shenandoah is enabled
# Check Shenandoah is enabled
%if %{use_shenandoah_hotspot}
%if %{use_shenandoah_hotspot}
$JAVA_HOME// bin/java -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -version
$JAVA_HOME/bin/java -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -version
%endif
%endif
# Check unlimited policy has been used
# Only test on one architecture (the fastest) for Java only tests
$JAVA_HOME/bin/javac -d . %{SOURCE13}
%ifarch %{jdk_test_arch}
$JAVA_HOME/bin/java --add-opens java.base/javax.crypto=ALL-UNNAMED TestCryptoLevel
# 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 ECC is working
$JAVA_HOME/bin/javac -d . %{SOURCE14}
$JAVA_HOME/bin/java $(echo $(basename %{SOURCE14})|sed "s|\.java||")
# 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 ECC is working
# Check src.zip has all sources. See RHBZ#1130490
$JAVA_HOME/bin/javac -d . %{SOURCE14}
unzip -l $JAVA_HOME/lib/src.zip | grep 'sun.misc.Unsafe'
$JAVA_HOME/bin/java $(echo $(basename %{SOURCE14})|sed "s|\.java||")
# Check system crypto (policy) is active and can be disabled
# Check class files include useful debugging information
# Test takes a single argument - true or false - to state whether system
$JAVA_HOME/bin/javap -l java.lang.Object | grep "Compiled from"
# security properties are enabled or not.
$JAVA_HOME/bin/javap -l java.lang.Object | grep LineNumberTable
$JAVA_HOME/bin/javac -d . %{SOURCE15}
$JAVA_HOME/bin/javap -l java.lang.Object | grep LocalVariableTable
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
# Check generated class files include useful debugging information
$JAVA_HOME/bin/javac -d . %{SOURCE16}
$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep "Compiled from"
$JAVA_HOME/bin/java $(echo $(basename %{SOURCE16})|sed "s|\.java||") "%{oj_vendor}" "%{oj_vendor_url}" "%{oj_vendor_bug_url}" "%{oj_vendor_version}"
$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
# Check java launcher has no SSB mitigation
if ! nm $JAVA_HOME/bin/java | grep set_speculation ; then true ; else false; fi
if ! nm $JAVA_HOME/bin/java | grep set_speculation ; then true ; else false; fi
@ -1550,16 +1625,6 @@ nm %{altjavaoutputdir}/%{alt_java_name} | grep prctl
if ! nm %{altjavaoutputdir}/%{alt_java_name} | grep prctl ; then true ; else false; fi
if ! nm %{altjavaoutputdir}/%{alt_java_name} | grep prctl ; then true ; else false; fi
%endif
%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}
%if %{include_staticlibs}
# Check debug symbols in static libraries (smoke test)
# Check debug symbols in static libraries (smoke test)
export STATIC_LIBS_HOME=${top_dir_abs_staticlibs_build_path}/images/%{static_libs_image}
export STATIC_LIBS_HOME=${top_dir_abs_staticlibs_build_path}/images/%{static_libs_image}
@ -1640,19 +1705,6 @@ EOF
grep 'JavaCallWrapper::JavaCallWrapper' gdb.out
grep 'JavaCallWrapper::JavaCallWrapper' gdb.out
%endif
%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
# build cycles check
done
done
@ -1668,12 +1720,10 @@ for suffix in %{build_loop} ; do
nameSuffix=`echo "$suffix"| sed s/-/./`
nameSuffix=`echo "$suffix"| sed s/-/./`
fi
fi
# These definitions should match those in install jdk
# These definitions should match those in package jdk
jdkarchive=${packagesdir}/%{jdkportablearchive -- "$nameSuffix"}
jdkarchive=${packagesdir}/%{jdkportablearchive -- "$nameSuffix"}
jrearchive=${packagesdir}/%{jreportablearchive -- "$nameSuffix"}
jrearchive=${packagesdir}/%{jreportablearchive -- "$nameSuffix"}
staticarchive=${packagesdir}/%{staticlibsportablearchive -- "$nameSuffix"}
staticarchive=${packagesdir}/%{staticlibsportablearchive -- "$nameSuffix"}
debugarchive=${packagesdir}/%{jdkportablearchive -- "${nameSuffix}.debuginfo"}
unstrippedarchive=${packagesdir}/%{jdkportablearchive -- "${nameSuffix}.unstripped"}
mkdir -p $RPM_BUILD_ROOT%{_jvmdir}
mkdir -p $RPM_BUILD_ROOT%{_jvmdir}
@ -1688,23 +1738,23 @@ for suffix in %{build_loop} ; do
%endif
%endif
if [ "x$suffix" = "x" ] ; then
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} $RPM_BUILD_ROOT%{_jvmdir}/
mv ${debugarchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/
mv ${debugarchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/
mv ${unstrippedarchive} $RPM_BUILD_ROOT%{_jvmdir}/
mv ${unstrippedarchive} $RPM_BUILD_ROOT%{_jvmdir}/
mv ${unstrippedarchive}.sha256sum $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
fi
done
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
# To show sha in the build log
for file in `ls $RPM_BUILD_ROOT%{_jvmdir}/*.sha256sum` ; do
for file in `ls $RPM_BUILD_ROOT%{_jvmdir}/*.sha256sum` ; do
ls -l $file ;
ls -l $file ;
@ -1722,6 +1772,8 @@ done
# placeholder
# placeholder
%endif
%endif
%if %{include_normal_build}
%files devel
%files devel
%{_jvmdir}/%{jdkportablearchive -- %%{nil}}
%{_jvmdir}/%{jdkportablearchive -- %%{nil}}
%{_jvmdir}/%{jdkportablearchive -- .debuginfo}
%{_jvmdir}/%{jdkportablearchive -- .debuginfo}
@ -1738,6 +1790,16 @@ done
%{_jvmdir}/%{jdkportablearchive -- .unstripped}
%{_jvmdir}/%{jdkportablearchive -- .unstripped}
%{_jvmdir}/%{jdkportablearchive -- .unstripped}.sha256sum
%{_jvmdir}/%{jdkportablearchive -- .unstripped}.sha256sum
%files docs
%{_jvmdir}/%{docportablearchive}
%{_jvmdir}/%{docportablearchive}.sha256sum
%files misc
%{_jvmdir}/%{miscportablearchive}
%{_jvmdir}/%{miscportablearchive}.sha256sum
%endif
%if %{include_debug_build}
%if %{include_debug_build}
%files slowdebug
%files slowdebug
@ -1774,17 +1836,50 @@ done
%endif
%endif
%files docs
%changelog
%{_jvmdir}/%{docportablearchive}
* Thu Jul 18 2024 Arkady L. Shane <tigro@msvsphere-os.ru> - 1:21.0.4.0.7-1
%{_jvmdir}/%{docportablearchive}.sha256sum
- Rebuilt for MSVSphere %{msvsphere}
%files misc
* Wed Jul 17 2024 Release Engineering <releng@rockylinux.org> - 21.0.4.0.7-1
%{_jvmdir}/%{miscportablearchive}
- Build for Rocky Linux %{rocky}
%{_jvmdir}/%{miscportablearchive}.sha256sum
%changelog
* Fri Jul 12 2024 Andrew Hughes <gnu.andrew@redhat.com> - 1:21.0.4.0.7-1
* Fri Apr 19 2024 Arkady L. Shane <tigro@msvsphere-os.ru> - 1:21.0.3.0.9-1
- Update to jdk-21.0.4+7 (GA)
- Build for MSVSphere
- Update release notes to 21.0.4+7
- Switch to GA mode.
- ** 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 3e3cf8fa2df7bac2f6a60a0ddd596ec39228a3e1
- Resolves: OPENJDK-3132
- Resolves: OPENJDK-3194
- Resolves: OPENJDK-3181
- Resolves: OPENJDK-3189
* 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
- Switch to EA mode
- Bump LCMS 2 version to 2.16.0 following JDK-8321489
- Add zlib build requirement or bundled version (1.3.1), depending on system_libs setting
- Resolves: OPENJDK-3060
- Resolves: OPENJDK-3063
* Tue Jun 11 2024 Andrew Hughes <gnu.andrew@redhat.com> - 1:21.0.3.0.9-3
- Re-run jlink to regenerate the jmods directory and lib/modules with stripped libraries
- Rebuild CDS archives against the updated lib/modules
- Resolves: OPENJDK-2829
* Wed May 01 2024 Thomas Fitzsimmons <fitzsim@redhat.com> - 1:21.0.3.0.9-2
- createtar: Add exclude option
- packagejdk: Exclude debuginfo when creating jdkarchive and jrearchive tarballs
- Resolves: OPENJDK-2995
* Sat Apr 13 2024 Andrew Hughes <gnu.andrew@redhat.com> - 1:21.0.3.0.9-1
* Sat Apr 13 2024 Andrew Hughes <gnu.andrew@redhat.com> - 1:21.0.3.0.9-1
- Update to jdk-21.0.3+9 (GA)
- Update to jdk-21.0.3+9 (GA)