Blame SOURCES/java-17-openjdk-portable.specfile

71d8cf
# portable jdk 17 specific bug, _jvmdir being missing
71d8cf
%define _jvmdir /usr/lib/jvm
71d8cf
71d8cf
# debug_package %%{nil} is portable-jdks specific
71d8cf
%define  debug_package %{nil}
71d8cf
71d8cf
# RPM conditionals so as to be able to dynamically produce
71d8cf
# slowdebug/release builds. See:
71d8cf
# http://rpm.org/user_doc/conditional_builds.html
71d8cf
#
71d8cf
# Examples:
71d8cf
#
71d8cf
# Produce release, fastdebug *and* slowdebug builds on x86_64 (default):
71d8cf
# $ rpmbuild -ba java-17-openjdk.spec
71d8cf
#
71d8cf
# Produce only release builds (no debug builds) on x86_64:
71d8cf
# $ rpmbuild -ba java-17-openjdk.spec --without slowdebug --without fastdebug
71d8cf
#
71d8cf
# Only produce a release build on x86_64:
71d8cf
# $ fedpkg mockbuild --without slowdebug --without fastdebug
71d8cf
# Enable fastdebug builds by default on relevant arches.
71d8cf
%bcond_without fastdebug
71d8cf
# Enable slowdebug builds by default on relevant arches.
71d8cf
%bcond_without slowdebug
71d8cf
# Enable release builds by default on relevant arches.
71d8cf
%bcond_without release
71d8cf
# Enable static library builds by default.
71d8cf
%bcond_without staticlibs
71d8cf
# Build a fresh libjvm.so for use in a copy of the bootstrap JDK
71d8cf
%bcond_without fresh_libjvm
71d8cf
# Build with system libraries
71d8cf
%bcond_with system_libs
71d8cf
71d8cf
# Workaround for stripping of debug symbols from static libraries
71d8cf
%if %{with staticlibs}
71d8cf
%define __brp_strip_static_archive %{nil}
71d8cf
%global include_staticlibs 1
71d8cf
%else
71d8cf
%global include_staticlibs 0
71d8cf
%endif
71d8cf
71d8cf
# Define whether to use the bootstrap JDK directly or with a fresh libjvm.so
71d8cf
%if %{with fresh_libjvm}
71d8cf
%global build_hotspot_first 1
71d8cf
%else
71d8cf
%global build_hotspot_first 0
71d8cf
%endif
71d8cf
71d8cf
%if %{with system_libs}
71d8cf
%global system_libs 1
71d8cf
%global link_type system
71d8cf
%global freetype_lib %{nil}
71d8cf
%else
71d8cf
%global system_libs 0
71d8cf
%global link_type bundled
71d8cf
%global freetype_lib |libfreetype[.]so.*
71d8cf
%endif
71d8cf
71d8cf
# The -g flag says to use strip -g instead of full strip on DSOs or EXEs.
71d8cf
# This fixes detailed NMT and other tools which need minimal debug info.
71d8cf
# See: https://bugzilla.redhat.com/show_bug.cgi?id=1520879
71d8cf
%global _find_debuginfo_opts -g
71d8cf
71d8cf
# Disable LTO as this causes build failures at the moment.
71d8cf
# See RHBZ#1861401
71d8cf
%define _lto_cflags %{nil}
71d8cf
71d8cf
# note: parametrized macros are order-sensitive (unlike not-parametrized) even with normal macros
71d8cf
# also necessary when passing it as parameter to other macros. If not macro, then it is considered a switch
71d8cf
# see the difference between global and define:
71d8cf
# See https://github.com/rpm-software-management/rpm/issues/127 to comments at  "pmatilai commented on Aug 18, 2017"
71d8cf
# (initiated in https://bugzilla.redhat.com/show_bug.cgi?id=1482192)
71d8cf
%global debug_suffix_unquoted -slowdebug
71d8cf
%global fastdebug_suffix_unquoted -fastdebug
71d8cf
%global main_suffix_unquoted -main
71d8cf
%global staticlibs_suffix_unquoted -staticlibs
71d8cf
# quoted one for shell operations
71d8cf
%global debug_suffix "%{debug_suffix_unquoted}"
71d8cf
%global fastdebug_suffix "%{fastdebug_suffix_unquoted}"
71d8cf
%global normal_suffix ""
71d8cf
%global main_suffix "%{main_suffix_unquoted}"
71d8cf
%global staticlibs_suffix "%{staticlibs_suffix_unquoted}"
71d8cf
71d8cf
%global debug_warning This package is unoptimised with full debugging. Install only as needed and remove ASAP.
71d8cf
%global fastdebug_warning This package is optimised with full debugging. Install only as needed and remove ASAP.
71d8cf
%global debug_on unoptimised with full debugging on
71d8cf
%global fastdebug_on optimised with full debugging on
71d8cf
%global for_fastdebug for packages with debugging on and optimisation
71d8cf
%global for_debug for packages with debugging on and no optimisation
71d8cf
71d8cf
%if %{with release}
71d8cf
%global include_normal_build 1
71d8cf
%else
71d8cf
%global include_normal_build 0
71d8cf
%endif
71d8cf
71d8cf
%if %{include_normal_build}
71d8cf
%global normal_build %{normal_suffix}
71d8cf
%else
71d8cf
%global normal_build %{nil}
71d8cf
%endif
71d8cf
71d8cf
# We have hardcoded list of files, which  is appearing in alternatives, and in files
71d8cf
# in alternatives those are slaves and master, very often triplicated by man pages
71d8cf
# in files all masters and slaves are ghosted
71d8cf
# the ghosts are here to allow installation via query like `dnf install /usr/bin/java`
71d8cf
# you can list those files, with appropriate sections: cat *.spec | grep -e --install -e --slave -e post_
71d8cf
# TODO - fix those hardcoded lists via single list
71d8cf
# Those files must *NOT* be ghosted for *slowdebug* packages
71d8cf
# FIXME - if you are moving jshell or jlink or similar, always modify all three sections
71d8cf
# you can check via headless and devels:
71d8cf
#    rpm -ql --noghost java-11-openjdk-headless-11.0.1.13-8.fc29.x86_64.rpm  | grep bin
71d8cf
# == rpm -ql           java-11-openjdk-headless-slowdebug-11.0.1.13-8.fc29.x86_64.rpm  | grep bin
71d8cf
# != rpm -ql           java-11-openjdk-headless-11.0.1.13-8.fc29.x86_64.rpm  | grep bin
71d8cf
# similarly for other %%{_jvmdir}/{jre,java} and %%{_javadocdir}/{java,java-zip}
71d8cf
%define is_release_build() %( if [ "%{?1}" == "%{debug_suffix_unquoted}" -o "%{?1}" == "%{fastdebug_suffix_unquoted}" ]; then echo "0" ; else echo "1"; fi )
71d8cf
71d8cf
# 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
71d8cf
# as sytem JDK, we mean any JDK which can run whole system java stack without issues (like bytecode issues, module issues, dependencies...)
71d8cf
%global is_system_jdk 0
71d8cf
71d8cf
%global aarch64         aarch64 arm64 armv8
71d8cf
# we need to distinguish between big and little endian PPC64
71d8cf
%global ppc64le         ppc64le
71d8cf
%global ppc64be         ppc64 ppc64p7
71d8cf
# Set of architectures which support multiple ABIs
71d8cf
%global multilib_arches %{power64} sparc64 x86_64
71d8cf
# Set of architectures for which we build slowdebug builds
71d8cf
%global debug_arches    %{ix86} x86_64 sparcv9 sparc64 %{aarch64} %{power64} s390x
71d8cf
# Set of architectures for which we build fastdebug builds
71d8cf
%global fastdebug_arches x86_64 ppc64le aarch64
71d8cf
# Set of architectures with a Just-In-Time (JIT) compiler
71d8cf
%global jit_arches      %{arm} %{aarch64} %{ix86} %{power64} s390x sparcv9 sparc64 x86_64
71d8cf
# Set of architectures which use the Zero assembler port (!jit_arches)
71d8cf
%global zero_arches ppc s390
71d8cf
# Set of architectures which run a full bootstrap cycle
71d8cf
%global bootstrap_arches %{jit_arches}
71d8cf
# Set of architectures which support SystemTap tapsets
71d8cf
%global systemtap_arches %{jit_arches}
71d8cf
# Set of architectures with a Ahead-Of-Time (AOT) compiler
71d8cf
%global aot_arches      x86_64 %{aarch64}
71d8cf
# Set of architectures which support the serviceability agent
71d8cf
%global sa_arches       %{ix86} x86_64 sparcv9 sparc64 %{aarch64} %{power64} %{arm}
71d8cf
# Set of architectures which support class data sharing
71d8cf
# As of JDK-8005165 in OpenJDK 10, class sharing is not arch-specific
71d8cf
# However, it does segfault on the Zero assembler port, so currently JIT only
71d8cf
%global share_arches    %{jit_arches}
71d8cf
# Set of architectures for which we build the Shenandoah garbage collector
71d8cf
%global shenandoah_arches x86_64 %{aarch64}
71d8cf
# Set of architectures for which we build the Z garbage collector
71d8cf
%global zgc_arches x86_64
71d8cf
# Set of architectures for which alt-java has SSB mitigation
71d8cf
%global ssbd_arches x86_64
71d8cf
# Set of architectures for which java has short vector math library (libjsvml.so)
71d8cf
%global svml_arches x86_64
71d8cf
# Set of architectures where we verify backtraces with gdb
71d8cf
# s390x fails on RHEL 7 so we exclude it there
71d8cf
%if (0%{?rhel} > 0 && 0%{?rhel} < 8)
71d8cf
%global gdb_arches %{arm} %{aarch64} %{ix86} %{power64} sparcv9 sparc64 x86_64 %{zero_arches}
71d8cf
%else
71d8cf
%global gdb_arches %{jit_arches} %{zero_arches}
71d8cf
%endif
71d8cf
71d8cf
# By default, we build a slowdebug build during main build on JIT architectures
71d8cf
%if %{with slowdebug}
71d8cf
%ifarch %{debug_arches}
71d8cf
%global include_debug_build 1
71d8cf
%else
71d8cf
%global include_debug_build 0
71d8cf
%endif
71d8cf
%else
71d8cf
%global include_debug_build 0
71d8cf
%endif
71d8cf
71d8cf
# On certain architectures, we compile the Shenandoah GC
71d8cf
%ifarch %{shenandoah_arches}
71d8cf
%global use_shenandoah_hotspot 1
71d8cf
%else
71d8cf
%global use_shenandoah_hotspot 0
71d8cf
%endif
71d8cf
71d8cf
# By default, we build a fastdebug build during main build only on fastdebug architectures
71d8cf
%if %{with fastdebug}
71d8cf
%ifarch %{fastdebug_arches}
71d8cf
%global include_fastdebug_build 1
71d8cf
%else
71d8cf
%global include_fastdebug_build 0
71d8cf
%endif
71d8cf
%else
71d8cf
%global include_fastdebug_build 0
71d8cf
%endif
71d8cf
71d8cf
%if %{include_debug_build}
71d8cf
%global slowdebug_build %{debug_suffix}
71d8cf
%else
71d8cf
%global slowdebug_build %{nil}
71d8cf
%endif
71d8cf
71d8cf
%if %{include_fastdebug_build}
71d8cf
%global fastdebug_build %{fastdebug_suffix}
71d8cf
%else
71d8cf
%global fastdebug_build %{nil}
71d8cf
%endif
71d8cf
71d8cf
# If you disable all builds, then the build fails
71d8cf
# Build and test slowdebug first as it provides the best diagnostics
71d8cf
%global build_loop %{slowdebug_build} %{fastdebug_build} %{normal_build}
71d8cf
71d8cf
%if %{include_staticlibs}
71d8cf
%global staticlibs_loop %{staticlibs_suffix}
71d8cf
%else
71d8cf
%global staticlibs_loop %{nil}
71d8cf
%endif
71d8cf
71d8cf
%ifarch %{bootstrap_arches}
71d8cf
%global bootstrap_build true
71d8cf
%else
71d8cf
%global bootstrap_build false
71d8cf
%endif
71d8cf
71d8cf
%if %{include_staticlibs}
71d8cf
# Extra target for producing the static-libraries. Separate from
71d8cf
# other targets since this target is configured to use in-tree
71d8cf
# AWT dependencies: lcms, libjpeg, libpng, libharfbuzz, giflib
71d8cf
# and possibly others
71d8cf
%global static_libs_target static-libs-image
71d8cf
%else
71d8cf
%global static_libs_target %{nil}
71d8cf
%endif
71d8cf
71d8cf
# The static libraries are produced under the same configuration as the main
71d8cf
# build for portables, as we expect in-tree libraries to be used throughout.
71d8cf
# If system libraries are enabled, the static libraries will also use them
71d8cf
# which may cause issues.
71d8cf
%global bootstrap_targets images %{static_libs_target} legacy-jre-image
71d8cf
%global release_targets images docs-zip %{static_libs_target} legacy-jre-image
71d8cf
# No docs nor bootcycle for debug builds
71d8cf
%global debug_targets images %{static_libs_target} legacy-jre-image
71d8cf
# Target to use to just build HotSpot
71d8cf
%global hotspot_target hotspot
71d8cf
71d8cf
# JDK to use for bootstrapping
71d8cf
%global bootjdk /usr/lib/jvm/java-%{buildjdkver}-openjdk
71d8cf
71d8cf
# Filter out flags from the optflags macro that cause problems with the OpenJDK build
71d8cf
# We filter out -O flags so that the optimization of HotSpot is not lowered from O3 to O2
71d8cf
# We filter out -Wall which will otherwise cause HotSpot to produce hundreds of thousands of warnings (100+mb logs)
71d8cf
# We replace it with -Wformat (required by -Werror=format-security) and -Wno-cpp to avoid FORTIFY_SOURCE warnings
71d8cf
# We filter out -fexceptions as the HotSpot build explicitly does -fno-exceptions and it's otherwise the default for C++
71d8cf
%global ourflags %(echo %optflags | sed -e 's|-Wall|-Wformat -Wno-cpp|' | sed -r -e 's|-O[0-9]*||')
71d8cf
%global ourcppflags %(echo %ourflags | sed -e 's|-fexceptions||')
71d8cf
%global ourldflags %{__global_ldflags}
71d8cf
71d8cf
# With disabled nss is NSS deactivated, so NSS_LIBDIR can contain the wrong path
71d8cf
# the initialization must be here. Later the pkg-config have buggy behavior
71d8cf
# looks like openjdk RPM specific bug
71d8cf
# Always set this so the nss.cfg file is not broken
71d8cf
%global NSS_LIBDIR %(pkg-config --variable=libdir nss)
71d8cf
71d8cf
# In some cases, the arch used by the JDK does
71d8cf
# not match _arch.
71d8cf
# Also, in some cases, the machine name used by SystemTap
71d8cf
# does not match that given by _target_cpu
71d8cf
%ifarch x86_64
71d8cf
%global archinstall amd64
71d8cf
%global stapinstall x86_64
71d8cf
%endif
71d8cf
%ifarch ppc
71d8cf
%global archinstall ppc
71d8cf
%global stapinstall powerpc
71d8cf
%endif
71d8cf
%ifarch %{ppc64be}
71d8cf
%global archinstall ppc64
71d8cf
%global stapinstall powerpc
71d8cf
%endif
71d8cf
%ifarch %{ppc64le}
71d8cf
%global archinstall ppc64le
71d8cf
%global stapinstall powerpc
71d8cf
%endif
71d8cf
%ifarch %{ix86}
71d8cf
%global archinstall i686
71d8cf
%global stapinstall i386
71d8cf
%endif
71d8cf
%ifarch ia64
71d8cf
%global archinstall ia64
71d8cf
%global stapinstall ia64
71d8cf
%endif
71d8cf
%ifarch s390
71d8cf
%global archinstall s390
71d8cf
%global stapinstall s390
71d8cf
%endif
71d8cf
%ifarch s390x
71d8cf
%global archinstall s390x
71d8cf
%global stapinstall s390
71d8cf
%endif
71d8cf
%ifarch %{arm}
71d8cf
%global archinstall arm
71d8cf
%global stapinstall arm
71d8cf
%endif
71d8cf
%ifarch %{aarch64}
71d8cf
%global archinstall aarch64
71d8cf
%global stapinstall arm64
71d8cf
%endif
71d8cf
# 32 bit sparc, optimized for v9
71d8cf
%ifarch sparcv9
71d8cf
%global archinstall sparc
71d8cf
%global stapinstall %{_target_cpu}
71d8cf
%endif
71d8cf
# 64 bit sparc
71d8cf
%ifarch sparc64
71d8cf
%global archinstall sparcv9
71d8cf
%global stapinstall %{_target_cpu}
71d8cf
%endif
71d8cf
# Need to support noarch for srpm build
71d8cf
%ifarch noarch
71d8cf
%global archinstall %{nil}
71d8cf
%global stapinstall %{nil}
71d8cf
%endif
71d8cf
71d8cf
# always off for portable builds
71d8cf
%ifarch %{systemtap_arches}
71d8cf
%global with_systemtap 0
71d8cf
%else
71d8cf
%global with_systemtap 0
71d8cf
%endif
71d8cf
71d8cf
# New Version-String scheme-style defines
71d8cf
%global featurever 17
71d8cf
%global interimver 0
71d8cf
%global updatever 7
71d8cf
%global patchver 0
71d8cf
# buildjdkver is usually same as %%{featurever},
71d8cf
# but in time of bootstrap of next jdk, it is featurever-1,
71d8cf
# and this it is better to change it here, on single place
71d8cf
%global buildjdkver 17
71d8cf
# We don't add any LTS designator for STS packages (Fedora and EPEL).
71d8cf
# We need to explicitly exclude EPEL as it would have the %%{rhel} macro defined.
71d8cf
%if 0%{?rhel} && !0%{?epel}
71d8cf
  %global lts_designator "LTS"
71d8cf
  %global lts_designator_zip -%{lts_designator}
71d8cf
%else
71d8cf
  %global lts_designator ""
71d8cf
  %global lts_designator_zip ""
71d8cf
%endif
71d8cf
71d8cf
# Define vendor information used by OpenJDK
71d8cf
%global oj_vendor Red Hat, Inc.
71d8cf
%global oj_vendor_url https://www.redhat.com/
71d8cf
# Define what url should JVM offer in case of a crash report
71d8cf
# order may be important, epel may have rhel declared
71d8cf
%if 0%{?epel}
71d8cf
%global oj_vendor_bug_url  https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora%20EPEL&component=%{name}&version=epel%{epel}
71d8cf
%else
71d8cf
%if 0%{?fedora}
71d8cf
# Does not work for rawhide, keeps the version field empty
71d8cf
%global oj_vendor_bug_url  https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=%{name}&version=%{fedora}
71d8cf
%else
71d8cf
%if 0%{?rhel}
71d8cf
%global oj_vendor_bug_url  https://bugzilla.redhat.com/enter_bug.cgi?product=Red%20Hat%20Enterprise%20Linux%20%{rhel}&component=%{name}
71d8cf
%else
71d8cf
%global oj_vendor_bug_url  https://bugzilla.redhat.com/enter_bug.cgi
71d8cf
%endif
71d8cf
%endif
71d8cf
%endif
71d8cf
%global oj_vendor_version (Red_Hat-%{version}-%{rpmrelease})
71d8cf
71d8cf
# Define IcedTea version used for SystemTap tapsets and desktop file
71d8cf
%global icedteaver      6.0.0pre00-c848b93a8598
71d8cf
# Define current Git revision for the FIPS support patches
71d8cf
%global fipsver bf363eecce3
71d8cf
71d8cf
# Standard JPackage naming and versioning defines
71d8cf
%global origin          openjdk
71d8cf
%global origin_nice     OpenJDK
71d8cf
%global top_level_dir_name   %{origin}
71d8cf
%global top_level_dir_name_backup %{top_level_dir_name}-backup
71d8cf
%global buildver        7
71d8cf
%global rpmrelease      2
71d8cf
#%%global tagsuffix     %%{nil}
71d8cf
# 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
71d8cf
%if %is_system_jdk
71d8cf
# Using 10 digits may overflow the int used for priority, so we combine the patch and build versions
71d8cf
# It is very unlikely we will ever have a patch version > 4 or a build version > 20, so we combine as (patch * 20) + build.
71d8cf
# This means 11.0.9.0+11 would have had a priority of 11000911 as before
71d8cf
# A 11.0.9.1+1 would have had a priority of 11000921 (20 * 1 + 1), thus ensuring it is bigger than 11.0.9.0+11
71d8cf
%global combiver $( expr 20 '*' %{patchver} + %{buildver} )
71d8cf
%global priority %( printf '%02d%02d%02d%02d' %{featurever} %{interimver} %{updatever} %{combiver} )
71d8cf
%else
71d8cf
# for techpreview, using 1, so slowdebugs can have 0
71d8cf
%global priority %( printf '%08d' 1 )
71d8cf
%endif
71d8cf
%global newjavaver %{featurever}.%{interimver}.%{updatever}.%{patchver}
71d8cf
%global javaver         %{featurever}
71d8cf
71d8cf
# Strip up to 6 trailing zeros in newjavaver, as the JDK does, to get the correct version used in filenames
71d8cf
%global filever %(svn=%{newjavaver}; for i in 1 2 3 4 5 6 ; do svn=${svn%%.0} ; done; echo ${svn})
71d8cf
71d8cf
# The tag used to create the OpenJDK tarball
71d8cf
%global vcstag jdk-%{filever}+%{buildver}%{?tagsuffix:-%{tagsuffix}}
71d8cf
71d8cf
# Define milestone (EA for pre-releases, GA for releases)
71d8cf
# Release will be (where N is usually a number starting at 1):
71d8cf
# - 0.N%%{?extraver}%%{?dist} for EA releases,
71d8cf
# - N%%{?extraver}{?dist} for GA releases
71d8cf
%global is_ga           1
71d8cf
%if %{is_ga}
71d8cf
%global build_type GA
71d8cf
%global ea_designator ""
71d8cf
%global ea_designator_zip ""
71d8cf
%global extraver %{nil}
71d8cf
%global eaprefix %{nil}
71d8cf
%else
71d8cf
%global build_type EA
71d8cf
%global ea_designator ea
71d8cf
%global ea_designator_zip -%{ea_designator}
71d8cf
%global extraver .%{ea_designator}
71d8cf
%global eaprefix 0.
71d8cf
%endif
71d8cf
71d8cf
# parametrized macros are order-sensitive
71d8cf
%global compatiblename  java-%{featurever}-%{origin}
71d8cf
%global fullversion     %{compatiblename}-%{version}-%{release}
71d8cf
# images directories from upstream build
71d8cf
%global jdkimage                jdk
71d8cf
%global static_libs_image       static-libs
71d8cf
# output dir stub
71d8cf
%define buildoutputdir() %{expand:build/jdk%{featurever}.build%{?1}}
71d8cf
%define installoutputdir() %{expand:install/jdk%{featurever}.install%{?1}}
71d8cf
%define packageoutputdir() %{expand:packages/jdk%{featurever}.packages%{?1}}
71d8cf
# we can copy the javadoc to not arched dir, or make it not noarch
71d8cf
%define uniquejavadocdir()    %{expand:%{fullversion}.%{_arch}%{?1}}
71d8cf
# main id and dir of this jdk
71d8cf
%define uniquesuffix()        %{expand:%{fullversion}.%{_arch}%{?1}}
71d8cf
# portable only declarations
71d8cf
%global jreimage                jre
71d8cf
%define jreportablenameimpl() %(echo %{uniquesuffix ""} | sed "s;el%{rhel}\\(_[0-9]\\)*;portable%{1}.jre;g")
71d8cf
%define jdkportablenameimpl() %(echo %{uniquesuffix ""} | sed "s;el%{rhel}\\(_[0-9]\\)*;portable%{1}.jdk;g")
71d8cf
%define staticlibsportablenameimpl() %(echo %{uniquesuffix ""} | sed "s;el%{rhel}\\(_[0-9]\\)*;portable%{1}.static-libs;g")
71d8cf
%define jreportablearchive()  %{expand:%{jreportablenameimpl -- %%{1}}.tar.xz}
71d8cf
%define jdkportablearchive()  %{expand:%{jdkportablenameimpl -- %%{1}}.tar.xz}
71d8cf
%define staticlibsportablearchive()  %{expand:%{staticlibsportablenameimpl -- %%{1}}.tar.xz}
71d8cf
%define jreportablename()     %{expand:%{jreportablenameimpl -- %%{1}}}
71d8cf
%define jdkportablename()     %{expand:%{jdkportablenameimpl -- %%{1}}}
71d8cf
# Intentionally use jdkportablenameimpl here since we want to have static-libs files overlayed on
71d8cf
# top of the JDK archive
71d8cf
%define staticlibsportablename()     %{expand:%{jdkportablenameimpl -- %%{1}}}
71d8cf
%define docportablename() %(echo %{uniquesuffix ""} | sed "s;el%{rhel}\\(_[0-9]\\)*;portable.docs;g")
71d8cf
%define docportablearchive()  %{docportablename}.tar.xz
71d8cf
%define miscportablename() %(echo %{uniquesuffix ""} | sed "s;el%{rhel}\\(_[0-9]\\)*;portable.misc;g")
71d8cf
%define miscportablearchive()  %{miscportablename}.tar.xz
71d8cf
71d8cf
#################################################################
71d8cf
# fix for https://bugzilla.redhat.com/show_bug.cgi?id=1111349
71d8cf
#         https://bugzilla.redhat.com/show_bug.cgi?id=1590796#c14
71d8cf
#         https://bugzilla.redhat.com/show_bug.cgi?id=1655938
71d8cf
%global _privatelibs libsplashscreen[.]so.*|libawt_xawt[.]so.*|libjli[.]so.*|libattach[.]so.*|libawt[.]so.*|libextnet[.]so.*|libawt_headless[.]so.*|libdt_socket[.]so.*|libfontmanager[.]so.*|libinstrument[.]so.*|libj2gss[.]so.*|libj2pcsc[.]so.*|libj2pkcs11[.]so.*|libjaas[.]so.*|libjavajpeg[.]so.*|libjdwp[.]so.*|libjimage[.]so.*|libjsound[.]so.*|liblcms[.]so.*|libmanagement[.]so.*|libmanagement_agent[.]so.*|libmanagement_ext[.]so.*|libmlib_image[.]so.*|libnet[.]so.*|libnio[.]so.*|libprefs[.]so.*|librmi[.]so.*|libsaproc[.]so.*|libsctp[.]so.*|libsystemconf[.]so.*|libzip[.]so.*%{freetype_lib}
71d8cf
%global _publiclibs libjawt[.]so.*|libjava[.]so.*|libjvm[.]so.*|libverify[.]so.*|libjsig[.]so.*
71d8cf
%if %is_system_jdk
71d8cf
%global __provides_exclude ^(%{_privatelibs})$
71d8cf
%global __requires_exclude ^(%{_privatelibs})$
71d8cf
# Never generate lib-style provides/requires for slowdebug packages
71d8cf
%global __provides_exclude_from ^.*/%{uniquesuffix -- %{debug_suffix_unquoted}}/.*$
71d8cf
%global __requires_exclude_from ^.*/%{uniquesuffix -- %{debug_suffix_unquoted}}/.*$
71d8cf
%global __provides_exclude_from ^.*/%{uniquesuffix -- %{fastdebug_suffix_unquoted}}/.*$
71d8cf
%global __requires_exclude_from ^.*/%{uniquesuffix -- %{fastdebug_suffix_unquoted}}/.*$
71d8cf
%else
71d8cf
# Don't generate provides/requires for JDK provided shared libraries at all.
71d8cf
%global __provides_exclude ^(%{_privatelibs}|%{_publiclibs})$
71d8cf
%global __requires_exclude ^(%{_privatelibs}|%{_publiclibs})$
71d8cf
%endif
71d8cf
71d8cf
71d8cf
%global etcjavasubdir     %{_sysconfdir}/java/java-%{javaver}-%{origin}
71d8cf
%define etcjavadir()      %{expand:%{etcjavasubdir}/%{uniquesuffix -- %{?1}}}
71d8cf
# Standard JPackage directories and symbolic links.
71d8cf
%define sdkdir()        %{expand:%{uniquesuffix -- %{?1}}}
71d8cf
%define jrelnk()        %{expand:jre-%{javaver}-%{origin}-%{version}-%{release}.%{_arch}%{?1}}
71d8cf
71d8cf
%define sdkbindir()     %{expand:%{_jvmdir}/%{sdkdir -- %{?1}}/bin}
71d8cf
%define jrebindir()     %{expand:%{_jvmdir}/%{sdkdir -- %{?1}}/bin}
71d8cf
71d8cf
%global alt_java_name     alt-java
71d8cf
71d8cf
%global rpm_state_dir %{_localstatedir}/lib/rpm-state/
71d8cf
71d8cf
# For flatpack builds hard-code /usr/sbin/alternatives,
71d8cf
# otherwise use %%{_sbindir} relative path.
71d8cf
%if 0%{?flatpak}
71d8cf
%global alternatives_requires /usr/sbin/alternatives
71d8cf
%else
71d8cf
%global alternatives_requires %{_sbindir}/alternatives
71d8cf
%endif
71d8cf
71d8cf
%if %{with_systemtap}
71d8cf
# Where to install systemtap tapset (links)
71d8cf
# We would like these to be in a package specific sub-dir,
71d8cf
# but currently systemtap doesn't support that, so we have to
71d8cf
# use the root tapset dir for now. To distinguish between 64
71d8cf
# and 32 bit architectures we place the tapsets under the arch
71d8cf
# specific dir (note that systemtap will only pickup the tapset
71d8cf
# for the primary arch for now). Systemtap uses the machine name
71d8cf
# aka target_cpu as architecture specific directory name.
71d8cf
%global tapsetroot /usr/share/systemtap
71d8cf
%global tapsetdirttapset %{tapsetroot}/tapset/
71d8cf
%global tapsetdir %{tapsetdirttapset}/%{stapinstall}
71d8cf
%endif
71d8cf
71d8cf
# x86 is not supported by OpenJDK 17
71d8cf
ExcludeArch: %{ix86}
71d8cf
71d8cf
# Portables have no repo (requires/provides), but these are awesome for orientation in spec
71d8cf
# Also scriptlets are happily missing and files are handled old fashion
71d8cf
# not-duplicated requires/provides/obsoletes for normal/debug packages
71d8cf
%define java_rpo() %{expand:
71d8cf
}
71d8cf
71d8cf
%define java_devel_rpo() %{expand:
71d8cf
}
71d8cf
71d8cf
%define java_static_libs_rpo() %{expand:
71d8cf
}
71d8cf
71d8cf
%define java_unstripped_rpo() %{expand:
71d8cf
}
71d8cf
71d8cf
%define java_docs_rpo() %{expand:
71d8cf
}
71d8cf
71d8cf
%define java_misc_rpo() %{expand:
71d8cf
}
71d8cf
71d8cf
# Prevent brp-java-repack-jars from being run
71d8cf
%global __jar_repack 0
71d8cf
71d8cf
# portables have grown out of its component, moving back to java-x-vendor
71d8cf
# this expression, when declared as global, filled component with java-x-vendor portable
71d8cf
%define component %(echo %{name} | sed "s;-portable;;g")
71d8cf
71d8cf
Name:    java-%{javaver}-%{origin}-portable
71d8cf
Version: %{newjavaver}.%{buildver}
71d8cf
Release: %{?eaprefix}%{rpmrelease}%{?extraver}%{?dist}
71d8cf
# java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons
71d8cf
# and this change was brought into RHEL-4. java-1.5.0-ibm packages
71d8cf
# also included the epoch in their virtual provides. This created a
71d8cf
# situation where in-the-wild java-1.5.0-ibm packages provided "java =
71d8cf
# 1:1.5.0". In RPM terms, "1.6.0 < 1:1.5.0" since 1.6.0 is
71d8cf
# interpreted as 0:1.6.0. So the "java >= 1.6.0" requirement would be
71d8cf
# satisfied by the 1:1.5.0 packages. Thus we need to set the epoch in
71d8cf
# JDK package >= 1.6.0 to 1, and packages referring to JDK virtual
71d8cf
# provides >= 1.6.0 must specify the epoch, "java >= 1:1.6.0".
71d8cf
71d8cf
Epoch:   1
71d8cf
Summary: %{origin_nice} %{featurever} Runtime Environment portable edition
71d8cf
# Groups are only used up to RHEL 8 and on Fedora versions prior to F30
71d8cf
%if (0%{?rhel} > 0 && 0%{?rhel} <= 8) || (0%{?fedora} >= 0 && 0%{?fedora} < 30)
71d8cf
Group:   Development/Languages
71d8cf
%endif
71d8cf
71d8cf
# HotSpot code is licensed under GPLv2
71d8cf
# JDK library code is licensed under GPLv2 with the Classpath exception
71d8cf
# The Apache license is used in code taken from Apache projects (primarily xalan & xerces)
71d8cf
# DOM levels 2 & 3 and the XML digital signature schemas are licensed under the W3C Software License
71d8cf
# The JSR166 concurrency code is in the public domain
71d8cf
# The BSD and MIT licenses are used for a number of third-party libraries (see ADDITIONAL_LICENSE_INFO)
71d8cf
# The OpenJDK source tree includes:
71d8cf
# - JPEG library (IJG), zlib & libpng (zlib), giflib (MIT), harfbuzz (ISC),
71d8cf
# - freetype (FTL), jline (BSD) and LCMS (MIT)
71d8cf
# - jquery (MIT), jdk.crypto.cryptoki PKCS 11 wrapper (RSA)
71d8cf
# - public_suffix_list.dat from publicsuffix.org (MPLv2.0)
71d8cf
# The test code includes copies of NSS under the Mozilla Public License v2.0
71d8cf
# The PCSClite headers are under a BSD with advertising license
71d8cf
# The elliptic curve cryptography (ECC) source code is licensed under the LGPLv2.1 or any later version
71d8cf
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
71d8cf
URL:      http://openjdk.java.net/
71d8cf
71d8cf
71d8cf
# The source tarball, generated using generate_source_tarball.sh
71d8cf
Source0: openjdk-jdk%{featurever}u-%{vcstag}.tar.xz
71d8cf
71d8cf
# Use 'icedtea_sync.sh' to update the following
71d8cf
# They are based on code contained in the IcedTea project (6.x).
71d8cf
# Systemtap tapsets. Zipped up to keep it small.
71d8cf
# Disabled in portables
71d8cf
#Source8: tapsets-icedtea-%%{icedteaver}.tar.xz
71d8cf
71d8cf
# Desktop files. Adapted from IcedTea
71d8cf
# Disabled in portables
71d8cf
#Source9: jconsole.desktop.in
71d8cf
71d8cf
# Release notes
71d8cf
Source10: NEWS
71d8cf
71d8cf
# nss configuration file
71d8cf
Source11: nss.cfg.in
71d8cf
71d8cf
# Removed libraries that we link instead
71d8cf
Source12: remove-intree-libraries.sh
71d8cf
71d8cf
# Ensure we aren't using the limited crypto policy
71d8cf
Source13: TestCryptoLevel.java
71d8cf
71d8cf
# Ensure ECDSA is working
71d8cf
Source14: TestECDSA.java
71d8cf
71d8cf
# Verify system crypto (policy) can be disabled via a property
71d8cf
Source15: TestSecurityProperties.java
71d8cf
71d8cf
# Ensure vendor settings are correct
71d8cf
Source16: CheckVendor.java
71d8cf
71d8cf
# Ensure translations are available for new timezones
71d8cf
Source18: TestTranslations.java
71d8cf
71d8cf
############################################
71d8cf
#
71d8cf
# RPM/distribution specific patches
71d8cf
#
71d8cf
############################################
71d8cf
71d8cf
# Ignore AWTError when assistive technologies are loaded
71d8cf
Patch1:    rh1648242-accessible_toolkit_crash_do_not_break_jvm.patch
71d8cf
Patch3:    rh649512-remove_uses_of_far_in_jpeg_libjpeg_turbo_1_4_compat_for_jdk10_and_up.patch
71d8cf
# NSS via SunPKCS11 Provider (disabled due to memory leak).
71d8cf
Patch1000: rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch
71d8cf
# RH1750419: enable build of speculative store bypass hardened alt-java (CVE-2018-3639)
71d8cf
Patch600: rh1750419-redhat_alt_java.patch
71d8cf
# Depend on pcsc-lite-libs instead of pcsc-lite-devel as this is only in optional repo
71d8cf
Patch6: rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-devel.patch
71d8cf
71d8cf
# Crypto policy and FIPS support patches
71d8cf
# Patch is generated from the fips-17u tree at https://github.com/rh-openjdk/jdk/tree/fips-17u
71d8cf
# as follows: git diff %%{vcstag} src make test > fips-17u-$(git show -s --format=%h HEAD).patch
71d8cf
# Diff is limited to src and make subdirectories to exclude .github changes
71d8cf
# Fixes currently included:
71d8cf
# PR3183, RH1340845: Follow system wide crypto policy
71d8cf
# PR3695: Allow use of system crypto policy to be disabled by the user
71d8cf
# RH1655466: Support RHEL FIPS mode using SunPKCS11 provider
71d8cf
# RH1818909: No ciphersuites availale for SSLSocket in FIPS mode
71d8cf
# RH1860986: Disable TLSv1.3 with the NSS-FIPS provider until PKCS#11 v3.0 support is available
71d8cf
# RH1915071: Always initialise JavaSecuritySystemConfiguratorAccess
71d8cf
# RH1929465: Improve system FIPS detection
71d8cf
# RH1995150: Disable non-FIPS crypto in SUN and SunEC security providers
71d8cf
# RH1996182: Login to the NSS software token in FIPS mode
71d8cf
# RH1991003: Allow plain key import unless com.redhat.fips.plainKeySupport is set to false
71d8cf
# RH2021263: Resolve outstanding FIPS issues
71d8cf
# RH2052819: Fix FIPS reliance on crypto policies
71d8cf
# RH2052829: Detect NSS at Runtime for FIPS detection
71d8cf
# RH2052070: Enable AlgorithmParameters and AlgorithmParameterGenerator services in FIPS mode
71d8cf
# RH2023467: Enable FIPS keys export
71d8cf
# RH2094027: SunEC runtime permission for FIPS
71d8cf
# RH2036462: sun.security.pkcs11.wrapper.PKCS11.getInstance breakage
71d8cf
# RH2090378: Revert to disabling system security properties and FIPS mode support together
71d8cf
# RH2104724: Avoid import/export of DH private keys
71d8cf
# RH2092507: P11Key.getEncoded does not work for DH keys in FIPS mode
71d8cf
# Build the systemconf library on all platforms
71d8cf
# RH2048582: Support PKCS#12 keystores
71d8cf
# RH2020290: Support TLS 1.3 in FIPS mode
71d8cf
# Add nss.fips.cfg support to OpenJDK tree
71d8cf
# RH2117972: Extend the support for NSS DBs (PKCS11) in FIPS mode
71d8cf
# Remove forgotten dead code from RH2020290 and RH2104724
71d8cf
# OJ1357: Fix issue on FIPS with a SecurityManager in place
71d8cf
# RH2134669: Add missing attributes when registering services in FIPS mode.
71d8cf
# test/jdk/sun/security/pkcs11/fips/VerifyMissingAttributes.java: fixed jtreg main class
71d8cf
# RH1940064: Enable XML Signature provider in FIPS mode
71d8cf
# RH2173781: Avoid calling C_GetInfo() too early, before cryptoki is initialized
71d8cf
Patch1001: fips-17u-%{fipsver}.patch
71d8cf
71d8cf
#############################################
71d8cf
#
71d8cf
# OpenJDK patches in need of upstreaming
71d8cf
#
71d8cf
#############################################
71d8cf
71d8cf
# Currently empty
71d8cf
71d8cf
#############################################
71d8cf
#
71d8cf
# OpenJDK patches appearing in 17.0.8
71d8cf
#
71d8cf
#############################################
71d8cf
# JDK-8274864: Remove Amman/Cairo hacks in ZoneInfoFile
71d8cf
Patch2001: jdk8274864-remove_amman_cairo_hacks.patch
71d8cf
# JDK-8305113: (tz) Update Timezone Data to 2023c
71d8cf
Patch2002: jdk8305113-tzdata2023c.patch
71d8cf
71d8cf
#############################################
71d8cf
#
71d8cf
# Portable build specific patches
71d8cf
#
71d8cf
#############################################
71d8cf
71d8cf
#############################################
71d8cf
#
71d8cf
# OpenJDK patches targetted for 17.0.6
71d8cf
#
71d8cf
#############################################
71d8cf
71d8cf
BuildRequires: autoconf
71d8cf
BuildRequires: automake
71d8cf
BuildRequires: alsa-lib-devel
71d8cf
BuildRequires: binutils
71d8cf
BuildRequires: cups-devel
71d8cf
BuildRequires: desktop-file-utils
71d8cf
# elfutils only are OK for build without AOT
71d8cf
BuildRequires: elfutils-devel
71d8cf
BuildRequires: file
71d8cf
BuildRequires: fontconfig-devel
71d8cf
BuildRequires: gcc-c++
71d8cf
BuildRequires: gdb
71d8cf
BuildRequires: libxslt
71d8cf
BuildRequires: libX11-devel
71d8cf
BuildRequires: libXi-devel
71d8cf
BuildRequires: libXinerama-devel
71d8cf
BuildRequires: libXrandr-devel
71d8cf
BuildRequires: libXrender-devel
71d8cf
BuildRequires: libXt-devel
71d8cf
BuildRequires: libXtst-devel
71d8cf
# Requirement for setting up nss.cfg
71d8cf
BuildRequires: nss-devel
71d8cf
# Requirement for system security property test
71d8cf
# N/A for portable. RHEL7 doesn't provide them
71d8cf
#BuildRequires: crypto-policies
71d8cf
BuildRequires: pkgconfig
71d8cf
BuildRequires: xorg-x11-proto-devel
71d8cf
BuildRequires: zip
71d8cf
# to pack portable tarballs
71d8cf
BuildRequires: tar
71d8cf
BuildRequires: unzip
71d8cf
# No javapackages-filesystem on el7,nor is needed for portables
71d8cf
# BuildRequires: javapackages-filesystem
71d8cf
BuildRequires: java-%{buildjdkver}-openjdk-devel
71d8cf
# Zero-assembler build requirement
71d8cf
%ifarch %{zero_arches}
71d8cf
BuildRequires: libffi-devel
71d8cf
%endif
71d8cf
# 2023c required as of JDK-8305113
71d8cf
BuildRequires: tzdata-java >= 2023c
71d8cf
# cacerts build requirement in portable mode
71d8cf
BuildRequires: ca-certificates
71d8cf
# Earlier versions have a bug in tree vectorization on PPC
71d8cf
BuildRequires: gcc >= 4.8.3-8
71d8cf
71d8cf
%if %{with_systemtap}
71d8cf
BuildRequires: systemtap-sdt-devel
71d8cf
%endif
71d8cf
BuildRequires: make
71d8cf
71d8cf
%if %{system_libs}
71d8cf
BuildRequires: freetype-devel
71d8cf
BuildRequires: giflib-devel
71d8cf
BuildRequires: harfbuzz-devel
71d8cf
BuildRequires: lcms2-devel
71d8cf
BuildRequires: libjpeg-devel
71d8cf
BuildRequires: libpng-devel
71d8cf
%else
71d8cf
# Version in src/java.desktop/share/native/libfreetype/include/freetype/freetype.h
71d8cf
Provides: bundled(freetype) = 2.12.1
71d8cf
# Version in src/java.desktop/share/native/libsplashscreen/giflib/gif_lib.h
71d8cf
Provides: bundled(giflib) = 5.2.1
71d8cf
# Version in src/java.desktop/share/native/libharfbuzz/hb-version.h
71d8cf
Provides: bundled(harfbuzz) = 4.4.1
71d8cf
# Version in src/java.desktop/share/native/liblcms/lcms2.h
71d8cf
Provides: bundled(lcms2) = 2.12.0
71d8cf
# Version in src/java.desktop/share/native/libjavajpeg/jpeglib.h
71d8cf
Provides: bundled(libjpeg) = 6b
71d8cf
# Version in src/java.desktop/share/native/libsplashscreen/libpng/png.h
71d8cf
Provides: bundled(libpng) = 1.6.37
71d8cf
# We link statically against libstdc++ to increase portability
71d8cf
BuildRequires: libstdc++-static
71d8cf
%endif
71d8cf
71d8cf
# this is always built, also during debug-only build
71d8cf
# when it is built in debug-only this package is just placeholder
71d8cf
%{java_rpo %{nil}}
71d8cf
71d8cf
%description
71d8cf
The %{origin_nice} %{featurever} runtime environment - portable edition.
71d8cf
71d8cf
%if %{include_debug_build}
71d8cf
%package slowdebug
71d8cf
Summary: %{origin_nice} %{featurever} Runtime Environment portable edition %{debug_on}
71d8cf
%if (0%{?rhel} > 0 && 0%{?rhel} <= 8) || (0%{?fedora} >= 0 && 0%{?fedora} < 30)
71d8cf
Group:   Development/Languages
71d8cf
%endif
71d8cf
71d8cf
%{java_rpo -- %{debug_suffix_unquoted}}
71d8cf
%description slowdebug
71d8cf
The %{origin_nice} %{featurever} runtime environment - portable edition.
71d8cf
%{debug_warning}
71d8cf
%endif
71d8cf
71d8cf
%if %{include_fastdebug_build}
71d8cf
%package fastdebug
71d8cf
Summary: %{origin_nice} %{featurever} Runtime Environment portable edition %{fastdebug_on}
71d8cf
%if (0%{?rhel} > 0 && 0%{?rhel} <= 8) || (0%{?fedora} >= 0 && 0%{?fedora} < 30)
71d8cf
Group:   Development/Languages
71d8cf
%endif
71d8cf
71d8cf
%{java_rpo -- %{fastdebug_suffix_unquoted}}
71d8cf
%description fastdebug
71d8cf
The %{origin_nice} %{featurever} runtime environment - portable edition.
71d8cf
%{fastdebug_warning}
71d8cf
%endif
71d8cf
71d8cf
%if %{include_normal_build}
71d8cf
%package devel
71d8cf
Summary: %{origin_nice} %{featurever} Development Environment portable edition
71d8cf
%if (0%{?rhel} > 0 && 0%{?rhel} <= 8) || (0%{?fedora} >= 0 && 0%{?fedora} < 30)
71d8cf
Group:   Development/Languages
71d8cf
%endif
71d8cf
71d8cf
%{java_devel_rpo %{nil}}
71d8cf
71d8cf
%description devel
71d8cf
The %{origin_nice} %{featurever} development tools - portable edition.
71d8cf
%endif
71d8cf
71d8cf
%if %{include_debug_build}
71d8cf
%package devel-slowdebug
71d8cf
Summary: %{origin_nice} %{featurever} Runtime and Development Environment portable edition %{debug_on}
71d8cf
%if (0%{?rhel} > 0 && 0%{?rhel} <= 8) || (0%{?fedora} >= 0 && 0%{?fedora} < 30)
71d8cf
Group:   Development/Languages
71d8cf
%endif
71d8cf
71d8cf
%{java_devel_rpo -- %{debug_suffix_unquoted}}
71d8cf
71d8cf
%description devel-slowdebug
71d8cf
The %{origin_nice} %{featurever} development tools - portable edition.
71d8cf
%{debug_warning}
71d8cf
%endif
71d8cf
71d8cf
%if %{include_fastdebug_build}
71d8cf
%package devel-fastdebug
71d8cf
Summary: %{origin_nice} %{featurever} Runtime and Development Environment portable edition %{fastdebug_on}
71d8cf
%if (0%{?rhel} > 0 && 0%{?rhel} <= 8) || (0%{?fedora} >= 0 && 0%{?fedora} < 30)
71d8cf
Group:   Development/Tools
71d8cf
%endif
71d8cf
71d8cf
%{java_devel_rpo -- %{fastdebug_suffix_unquoted}}
71d8cf
71d8cf
%description devel-fastdebug
71d8cf
The %{origin_nice} %{featurever} runtime environment and development tools - portable edition
71d8cf
%{fastdebug_warning}
71d8cf
%endif
71d8cf
71d8cf
%if %{include_staticlibs}
71d8cf
71d8cf
%if %{include_normal_build}
71d8cf
%package static-libs
71d8cf
Summary: %{origin_nice} %{featurever} libraries for static linking - portable edition
71d8cf
71d8cf
%{java_static_libs_rpo %{nil}}
71d8cf
71d8cf
%description static-libs
71d8cf
The %{origin_nice} %{featurever} libraries for static linking - portable edition.
71d8cf
%endif
71d8cf
71d8cf
%if %{include_debug_build}
71d8cf
%package static-libs-slowdebug
71d8cf
Summary: %{origin_nice} %{featurever} libraries for static linking - portable edition %{debug_on}
71d8cf
71d8cf
%{java_static_libs_rpo -- %{debug_suffix_unquoted}}
71d8cf
71d8cf
%description static-libs-slowdebug
71d8cf
The %{origin_nice} %{featurever} libraries for static linking - portable edition
71d8cf
%{debug_warning}
71d8cf
%endif
71d8cf
71d8cf
%if %{include_fastdebug_build}
71d8cf
%package static-libs-fastdebug
71d8cf
Summary: %{origin_nice} %{featurever} libraries for static linking - portable edition %{fastdebug_on}
71d8cf
71d8cf
%{java_static_libs_rpo -- %{fastdebug_suffix_unquoted}}
71d8cf
71d8cf
%description static-libs-fastdebug
71d8cf
The %{origin_nice} %{featurever} libraries for static linking - portable edition
71d8cf
%{fastdebug_warning}
71d8cf
%endif
71d8cf
71d8cf
# staticlibs
71d8cf
%endif
71d8cf
71d8cf
%if %{include_normal_build}
71d8cf
%package unstripped
71d8cf
Summary: The %{origin_nice} %{featurever} runtime environment.
71d8cf
71d8cf
%{java_unstripped_rpo %{nil}}
71d8cf
71d8cf
%description unstripped
71d8cf
The %{origin_nice} %{featurever} runtime environment.
71d8cf
71d8cf
%endif
71d8cf
71d8cf
%package docs
71d8cf
Summary: %{origin_nice} %{featurever} API documentation
71d8cf
71d8cf
%{java_docs_rpo %{nil}}
71d8cf
71d8cf
%description docs
71d8cf
The %{origin_nice} %{featurever} API documentation.
71d8cf
71d8cf
%package misc
71d8cf
Summary: %{origin_nice} %{featurever} miscellany
71d8cf
71d8cf
%{java_misc_rpo %{nil}}
71d8cf
71d8cf
%description misc
71d8cf
The %{origin_nice} %{featurever} miscellany.
71d8cf
71d8cf
%prep
71d8cf
71d8cf
echo "Preparing %{oj_vendor_version}"
71d8cf
71d8cf
# Using the echo macro breaks rpmdev-bumpspec, as it parses the first line of stdout :-(
71d8cf
%if 0%{?stapinstall:1}
71d8cf
  echo "CPU: %{_target_cpu}, arch install directory: %{archinstall}, SystemTap install directory: %{stapinstall}"
71d8cf
%else
71d8cf
  %{error:Unrecognised architecture %{_target_cpu}}
71d8cf
%endif
71d8cf
71d8cf
if [ %{include_normal_build} -eq 0 -o  %{include_normal_build} -eq 1 ] ; then
71d8cf
  echo "include_normal_build is %{include_normal_build}"
71d8cf
else
71d8cf
  echo "include_normal_build is %{include_normal_build}, that is invalid. Use 1 for yes or 0 for no"
71d8cf
  exit 11
71d8cf
fi
71d8cf
if [ %{include_debug_build} -eq 0 -o  %{include_debug_build} -eq 1 ] ; then
71d8cf
  echo "include_debug_build is %{include_debug_build}"
71d8cf
else
71d8cf
  echo "include_debug_build is %{include_debug_build}, that is invalid. Use 1 for yes or 0 for no"
71d8cf
  exit 12
71d8cf
fi
71d8cf
if [ %{include_fastdebug_build} -eq 0 -o  %{include_fastdebug_build} -eq 1 ] ; then
71d8cf
  echo "include_fastdebug_build is %{include_fastdebug_build}"
71d8cf
else
71d8cf
  echo "include_fastdebug_build is %{include_fastdebug_build}, that is invalid. Use 1 for yes or 0 for no"
71d8cf
  exit 13
71d8cf
fi
71d8cf
if [ %{include_debug_build} -eq 0 -a  %{include_normal_build} -eq 0 -a  %{include_fastdebug_build} -eq 0 ] ; then
71d8cf
  echo "You have disabled all builds (normal,fastdebug,slowdebug). That is a no go."
71d8cf
  exit 14
71d8cf
fi
71d8cf
%setup -q -c -n %{uniquesuffix ""} -T -a 0
71d8cf
# https://bugzilla.redhat.com/show_bug.cgi?id=1189084
71d8cf
prioritylength=`expr length %{priority}`
71d8cf
if [ $prioritylength -ne 8 ] ; then
71d8cf
 echo "priority must be 8 digits in total, violated"
71d8cf
 exit 14
71d8cf
fi
71d8cf
71d8cf
# OpenJDK patches
71d8cf
71d8cf
%if %{system_libs}
71d8cf
# Remove libraries that are linked by both static and dynamic builds
71d8cf
sh %{SOURCE12} %{top_level_dir_name}
71d8cf
%endif
71d8cf
71d8cf
# Patch the JDK
71d8cf
pushd %{top_level_dir_name}
71d8cf
%patch1 -p1
71d8cf
%patch3 -p1
71d8cf
%patch6 -p1
71d8cf
# Add crypto policy and FIPS support
71d8cf
%patch1001 -p1
71d8cf
# nss.cfg PKCS11 support; must come last as it also alters java.security
71d8cf
%patch1000 -p1
71d8cf
# tzdata update
71d8cf
%patch2001 -p1
71d8cf
%patch2002 -p1
71d8cf
popd # openjdk
71d8cf
71d8cf
%patch600
71d8cf
71d8cf
# The OpenJDK version file includes the current
71d8cf
# upstream version information. For some reason,
71d8cf
# configure does not automatically use the
71d8cf
# default pre-version supplied there (despite
71d8cf
# what the file claims), so we pass it manually
71d8cf
# to configure
71d8cf
VERSION_FILE=$(pwd)/%{top_level_dir_name}/make/conf/version-numbers.conf
71d8cf
if [ -f ${VERSION_FILE} ] ; then
71d8cf
    UPSTREAM_EA_DESIGNATOR=$(grep '^DEFAULT_PROMOTED_VERSION_PRE' ${VERSION_FILE} | cut -d '=' -f 2)
71d8cf
else
71d8cf
    echo "Could not find OpenJDK version file.";
71d8cf
    exit 16
71d8cf
fi
71d8cf
if [ "x${UPSTREAM_EA_DESIGNATOR}" != "x%{ea_designator}" ] ; then
71d8cf
    echo "WARNING: Designator mismatch";
71d8cf
    echo "Spec file is configured for a %{build_type} build with designator '%{ea_designator}'"
71d8cf
    echo "Upstream version-pre setting is '${UPSTREAM_EA_DESIGNATOR}'";
71d8cf
    exit 17
71d8cf
fi
71d8cf
71d8cf
# Extract systemtap tapsets
71d8cf
%if %{with_systemtap}
71d8cf
tar --strip-components=1 -x -I xz -f %{SOURCE8}
71d8cf
%if %{include_debug_build}
71d8cf
cp -r tapset tapset%{debug_suffix}
71d8cf
%endif
71d8cf
%if %{include_fastdebug_build}
71d8cf
cp -r tapset tapset%{fastdebug_suffix}
71d8cf
%endif
71d8cf
71d8cf
for suffix in %{build_loop} ; do
71d8cf
  for file in "tapset"$suffix/*.in; do
71d8cf
    OUTPUT_FILE=`echo $file | sed -e "s:\.stp\.in$:-%{version}-%{release}.%{_arch}.stp:g"`
71d8cf
    sed -e "s:@ABS_SERVER_LIBJVM_SO@:%{_jvmdir}/%{sdkdir -- $suffix}/lib/server/libjvm.so:g" $file > $file.1
71d8cf
    sed -e "s:@JAVA_SPEC_VER@:%{javaver}:g" $file.1 > $file.2
71d8cf
# TODO find out which architectures other than i686 have a client vm
71d8cf
%ifarch %{ix86}
71d8cf
    sed -e "s:@ABS_CLIENT_LIBJVM_SO@:%{_jvmdir}/%{sdkdir -- $suffix}/lib/client/libjvm.so:g" $file.2 > $OUTPUT_FILE
71d8cf
%else
71d8cf
    sed -e "/@ABS_CLIENT_LIBJVM_SO@/d" $file.2 > $OUTPUT_FILE
71d8cf
%endif
71d8cf
    sed -i -e "s:@ABS_JAVA_HOME_DIR@:%{_jvmdir}/%{sdkdir -- $suffix}:g" $OUTPUT_FILE
71d8cf
    sed -i -e "s:@INSTALL_ARCH_DIR@:%{archinstall}:g" $OUTPUT_FILE
71d8cf
    sed -i -e "s:@prefix@:%{_jvmdir}/%{sdkdir -- $suffix}/:g" $OUTPUT_FILE
71d8cf
  done
71d8cf
done
71d8cf
# systemtap tapsets ends
71d8cf
%endif
71d8cf
71d8cf
# Prepare desktop files
71d8cf
# Portables do not have desktop integration
71d8cf
71d8cf
# Setup nss.cfg
71d8cf
sed -e "s:@NSS_LIBDIR@:%{NSS_LIBDIR}:g" %{SOURCE11} > nss.cfg
71d8cf
71d8cf
%build
71d8cf
# How many CPU's do we have?
71d8cf
export NUM_PROC=%(/usr/bin/getconf _NPROCESSORS_ONLN 2> /dev/null || :)
71d8cf
export NUM_PROC=${NUM_PROC:-1}
71d8cf
%if 0%{?_smp_ncpus_max}
71d8cf
# Honor %%_smp_ncpus_max
71d8cf
[ ${NUM_PROC} -gt %{?_smp_ncpus_max} ] && export NUM_PROC=%{?_smp_ncpus_max}
71d8cf
%endif
71d8cf
71d8cf
%ifarch s390x sparc64 alpha %{power64} %{aarch64}
71d8cf
export ARCH_DATA_MODEL=64
71d8cf
%endif
71d8cf
%ifarch alpha
71d8cf
export CFLAGS="$CFLAGS -mieee"
71d8cf
%endif
71d8cf
71d8cf
# We use ourcppflags because the OpenJDK build seems to
71d8cf
# pass EXTRA_CFLAGS to the HotSpot C++ compiler...
71d8cf
# Explicitly set the C++ standard as the default has changed on GCC >= 6
71d8cf
EXTRA_CFLAGS="%ourcppflags"
71d8cf
EXTRA_CPP_FLAGS="%ourcppflags"
71d8cf
71d8cf
%ifarch %{power64} ppc
71d8cf
# fix rpmlint warnings
71d8cf
EXTRA_CFLAGS="$EXTRA_CFLAGS -fno-strict-aliasing"
71d8cf
%endif
71d8cf
%ifarch %{ix86}
71d8cf
# Align stack boundary on x86_32
71d8cf
EXTRA_CFLAGS="$(echo ${EXTRA_CFLAGS} | sed -e 's|-mstackrealign|-mincoming-stack-boundary=2 -mpreferred-stack-boundary=4|')"
71d8cf
EXTRA_CPP_FLAGS="$(echo ${EXTRA_CPP_FLAGS} | sed -e 's|-mstackrealign|-mincoming-stack-boundary=2 -mpreferred-stack-boundary=4|')"
71d8cf
%endif
71d8cf
export EXTRA_CFLAGS EXTRA_CPP_FLAGS
71d8cf
71d8cf
echo "Building %{newjavaver}-%{buildver}, pre=%{ea_designator}, opt=%{lts_designator}"
71d8cf
71d8cf
function buildjdk() {
71d8cf
    local outputdir=${1}
71d8cf
    local buildjdk=${2}
71d8cf
    local maketargets="${3}"
71d8cf
    local debuglevel=${4}
71d8cf
    local link_opt=${5}
71d8cf
    local debug_symbols=${6}
71d8cf
71d8cf
    local top_dir_abs_src_path=$(pwd)/%{top_level_dir_name}
71d8cf
    local top_dir_abs_build_path=$(pwd)/${outputdir}
71d8cf
71d8cf
    # This must be set using the global, so that the
71d8cf
    # static libraries still use a dynamic stdc++lib
71d8cf
    if [ "x%{link_type}" = "xbundled" ] ; then
71d8cf
        libc_link_opt="static";
71d8cf
    else
71d8cf
        libc_link_opt="dynamic";
71d8cf
    fi
71d8cf
71d8cf
    echo "Using output directory: ${outputdir}";
71d8cf
    echo "Checking build JDK ${buildjdk} is operational..."
71d8cf
    ${buildjdk}/bin/java -version
71d8cf
    echo "Using make targets: ${maketargets}"
71d8cf
    echo "Using debuglevel: ${debuglevel}"
71d8cf
    echo "Using link_opt: ${link_opt}"
71d8cf
    echo "Using debug_symbols: ${debug_symbols}"
71d8cf
    echo "Building %{newjavaver}-%{buildver}, pre=%{ea_designator}, opt=%{lts_designator}"
71d8cf
71d8cf
    mkdir -p ${outputdir}
71d8cf
    pushd ${outputdir}
71d8cf
71d8cf
    # Note: zlib and freetype use %{link_type}
71d8cf
    # rather than ${link_opt} as the system versions
71d8cf
    # are always used in a system_libs build, even
71d8cf
    # for the static library build
71d8cf
    bash ${top_dir_abs_src_path}/configure \
71d8cf
%ifarch %{zero_arches}
71d8cf
    --with-jvm-variants=zero \
71d8cf
%endif
71d8cf
%ifarch %{ppc64le}
71d8cf
    --with-jobs=1 \
71d8cf
%endif
71d8cf
    --with-cacerts-file=$(readlink -f %{_sysconfdir}/pki/java/cacerts)  \
71d8cf
    --with-version-build=%{buildver} \
71d8cf
    --with-version-pre="${ea_designator}" \
71d8cf
    --with-version-opt=%{lts_designator} \
71d8cf
    --with-vendor-version-string="%{oj_vendor_version}" \
71d8cf
    --with-vendor-name="%{oj_vendor}" \
71d8cf
    --with-vendor-url="%{oj_vendor_url}" \
71d8cf
    --with-vendor-bug-url="%{oj_vendor_bug_url}" \
71d8cf
    --with-vendor-vm-bug-url="%{oj_vendor_bug_url}" \
71d8cf
    --with-boot-jdk=${buildjdk} \
71d8cf
    --with-debug-level=${debuglevel} \
71d8cf
    --with-native-debug-symbols="${debug_symbols}" \
71d8cf
    --disable-sysconf-nss \
71d8cf
    --enable-unlimited-crypto \
71d8cf
    --with-zlib=%{link_type} \
71d8cf
    --with-freetype=%{link_type} \
71d8cf
    --with-libjpeg=${link_opt} \
71d8cf
    --with-giflib=${link_opt} \
71d8cf
    --with-libpng=${link_opt} \
71d8cf
    --with-lcms=${link_opt} \
71d8cf
    --with-harfbuzz=${link_opt} \
71d8cf
    --with-stdc++lib=${libc_link_opt} \
71d8cf
    --with-extra-cxxflags="$EXTRA_CPP_FLAGS" \
71d8cf
    --with-extra-cflags="$EXTRA_CFLAGS" \
71d8cf
    --with-extra-ldflags="%{ourldflags}" \
71d8cf
    --with-num-cores="$NUM_PROC" \
71d8cf
    --with-source-date="${SOURCE_DATE_EPOCH}" \
71d8cf
    --disable-javac-server \
71d8cf
%ifarch %{zgc_arches}
71d8cf
    --with-jvm-features=zgc \
71d8cf
%endif
71d8cf
    --disable-warnings-as-errors
71d8cf
71d8cf
    cat spec.gmk
71d8cf
    make LOG=trace $maketargets || \
71d8cf
	( pwd; find ${top_dir_abs_src_path} ${top_dir_abs_build_path} -name \"hs_err_pid*.log\" | xargs cat && false )
71d8cf
71d8cf
    popd
71d8cf
}
71d8cf
71d8cf
function installjdk() {
71d8cf
    local outputdir=${1}
71d8cf
    local installdir=${2}
71d8cf
    local jdkimagepath=${installdir}/images/%{jdkimage}
71d8cf
    local jreimagepath=${installdir}/images/%{jreimage}
71d8cf
71d8cf
    echo "Installing build from ${outputdir} to ${installdir}..."
71d8cf
    mkdir -p ${installdir}
71d8cf
    echo "Installing images..."
71d8cf
    mv ${outputdir}/images ${installdir}
71d8cf
    if [ -d ${outputdir}/bundles ] ; then
71d8cf
        echo "Installing bundles...";
71d8cf
        mv ${outputdir}/bundles ${installdir} ;
71d8cf
    fi
71d8cf
71d8cf
%if !%{with artifacts}
71d8cf
    echo "Removing output directory...";
71d8cf
    rm -rf ${outputdir}
71d8cf
%endif
71d8cf
71d8cf
    # legacy-jre-image target does not install any man pages for the JRE
71d8cf
    # We copy the jdk man directory and then remove pages for binaries that
71d8cf
    # don't exist in the JRE
71d8cf
    cp -a ${jdkimagepath}/man ${jreimagepath}
71d8cf
    for manpage in $(find ${jreimagepath}/man -name '*.1'); do
71d8cf
        filename=$(basename ${manpage});
71d8cf
        binary=${filename/.1/};
71d8cf
        if [ ! -f ${jreimagepath}/bin/${binary} ] ; then
71d8cf
            echo "Removing ${manpage} from JRE for which no binary ${binary} exists";
71d8cf
            rm -f ${manpage};
71d8cf
        fi;
71d8cf
    done
71d8cf
71d8cf
    for imagepath in ${jdkimagepath} ${jreimagepath} ; do
71d8cf
71d8cf
        if [ -d ${imagepath} ] ; then
71d8cf
            # the build (erroneously) removes read permissions from some jars
71d8cf
            # this is a regression in OpenJDK 7 (our compiler):
71d8cf
            # http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1437
71d8cf
            find ${imagepath} -iname '*.jar' -exec chmod ugo+r {} \;
71d8cf
71d8cf
            # Build screws up permissions on binaries
71d8cf
            # https://bugs.openjdk.java.net/browse/JDK-8173610
71d8cf
            find ${imagepath} -iname '*.so' -exec chmod +x {} \;
71d8cf
            find ${imagepath}/bin/ -exec chmod +x {} \;
71d8cf
71d8cf
            # Install local files which are distributed with the JDK
71d8cf
            install -m 644 %{SOURCE10} ${imagepath}
71d8cf
            install -m 644 nss.cfg ${imagepath}/conf/security/
71d8cf
71d8cf
            # Create fake alt-java as a placeholder for future alt-java
71d8cf
            pushd ${imagepath}
71d8cf
            # add alt-java man page
71d8cf
            echo "Hardened java binary recommended for launching untrusted code from the Web e.g. javaws" > man/man1/%{alt_java_name}.1
71d8cf
            cat man/man1/java.1 >> man/man1/%{alt_java_name}.1
71d8cf
            popd
71d8cf
71d8cf
            # Print release information
71d8cf
            cat ${imagepath}/release
71d8cf
        fi
71d8cf
    done
71d8cf
}
71d8cf
71d8cf
function genchecksum() {
71d8cf
    local checkedfile=${1}
71d8cf
71d8cf
    checkdir=$(dirname ${1})
71d8cf
    checkfile=$(basename ${1})
71d8cf
71d8cf
    echo "Generating checksum for ${checkfile} in ${checkdir}..."
71d8cf
    pushd ${checkdir}
71d8cf
    sha256sum ${checkfile} > ${checkfile}.sha256sum
71d8cf
    sha256sum --check ${checkfile}.sha256sum
71d8cf
    popd
71d8cf
}
71d8cf
71d8cf
function packagejdk() {
71d8cf
    local imagesdir=$(pwd)/${1}/images
71d8cf
    local docdir=$(pwd)/${1}/images/docs
71d8cf
    local bundledir=$(pwd)/${1}/bundles
71d8cf
    local packagesdir=$(pwd)/${2}
71d8cf
    local srcdir=$(pwd)/%{top_level_dir_name}
71d8cf
71d8cf
    echo "Packaging build from ${imagesdir} to ${packagesdir}..."
71d8cf
    mkdir -p ${packagesdir}
71d8cf
    pushd ${imagesdir}
71d8cf
71d8cf
    if [ "x$suffix" = "x" ] ; then
71d8cf
        nameSuffix=""
71d8cf
    else
71d8cf
        nameSuffix=`echo "$suffix"| sed s/-/./`
71d8cf
    fi
71d8cf
71d8cf
    jdkname=%{jdkportablename -- "$nameSuffix"}
71d8cf
    jdkarchive=${packagesdir}/%{jdkportablearchive -- "$nameSuffix"}
71d8cf
    jrename=%{jreportablename -- "$nameSuffix"}
71d8cf
    jrearchive=${packagesdir}/%{jreportablearchive -- "$nameSuffix"}
71d8cf
    staticname=%{staticlibsportablename -- "$nameSuffix"}
71d8cf
    staticarchive=${packagesdir}/%{staticlibsportablearchive -- "$nameSuffix"}
71d8cf
    debugarchive=${packagesdir}/%{jdkportablearchive -- "${nameSuffix}.debuginfo"}
71d8cf
    unstrippedarchive=${packagesdir}/%{jdkportablearchive -- "${nameSuffix}.unstripped"}
71d8cf
    # We only use docs for the release build
71d8cf
    docname=%{docportablename}
71d8cf
    docarchive=${packagesdir}/%{docportablearchive}
71d8cf
    built_doc_archive=jdk-%{filever}%{ea_designator_zip}+%{buildver}%{lts_designator_zip}-docs.zip
71d8cf
    # These are from the source tree so no debug variants
71d8cf
    miscname=%{miscportablename}
71d8cf
    miscarchive=${packagesdir}/%{miscportablearchive}
71d8cf
71d8cf
    # Rename directories for packaging
71d8cf
    mv %{jdkimage} ${jdkname}
71d8cf
    mv %{jreimage} ${jrename}
71d8cf
71d8cf
    # Release images have external debug symbols
71d8cf
    if [ "x$suffix" = "x" ] ; then
71d8cf
        # Keep the unstripped version for consumption by RHEL RPMs
71d8cf
        tar -cJf ${unstrippedarchive} ${jdkname}
71d8cf
        genchecksum ${unstrippedarchive}
71d8cf
71d8cf
        # Strip the files
71d8cf
        for file in $(find ${jdkname} ${jrename} -type f) ; do
71d8cf
            if file ${file} | grep -q 'ELF'; then
71d8cf
                noextfile=${file/.so/};
71d8cf
                objcopy --only-keep-debug ${file} ${noextfile}.debuginfo;
71d8cf
                objcopy --add-gnu-debuglink=${noextfile}.debuginfo ${file};
71d8cf
                strip -g ${file};
71d8cf
            fi
71d8cf
        done
71d8cf
71d8cf
        tar -cJf ${debugarchive} $(find ${jdkname} -name \*.debuginfo)
71d8cf
        genchecksum ${debugarchive}
71d8cf
71d8cf
	mkdir ${docname}
71d8cf
	mv ${docdir} ${docname}
71d8cf
	mv ${bundledir}/${built_doc_archive} ${docname}
71d8cf
	tar -cJf ${docarchive} ${docname}
71d8cf
	genchecksum ${docarchive}
71d8cf
71d8cf
	mkdir ${miscname}
71d8cf
	for s in 16 24 32 48 ; do
71d8cf
	    cp -av ${srcdir}/src/java.desktop/unix/classes/sun/awt/X11/java-icon${s}.png ${miscname}
71d8cf
	done
71d8cf
	cp -a ${srcdir}/src/sample ${miscname}
71d8cf
	tar -cJf ${miscarchive} ${miscname}
71d8cf
	genchecksum ${miscarchive}
71d8cf
    fi
71d8cf
71d8cf
    tar -cJf ${jdkarchive} --exclude='**.debuginfo' ${jdkname}
71d8cf
    genchecksum ${jdkarchive}
71d8cf
71d8cf
    tar -cJf ${jrearchive}  --exclude='**.debuginfo' ${jrename}
71d8cf
    genchecksum ${jrearchive}
71d8cf
71d8cf
%if %{include_staticlibs}
71d8cf
    # Static libraries (needed for building graal vm with native image)
71d8cf
    # Tar as overlay. Transform to the JDK name, since we just want to "add"
71d8cf
    # static libraries to that folder
71d8cf
    tar -cJf ${staticarchive} \
71d8cf
        --transform "s|^%{static_libs_image}/lib/*|${staticname}/lib/static/linux-%{archinstall}/glibc/|" "%{static_libs_image}/lib"
71d8cf
    genchecksum ${staticarchive}
71d8cf
%endif
71d8cf
71d8cf
    # Revert directory renaming so testing will run
71d8cf
    # TODO: testing should run on the packaged JDK
71d8cf
    mv ${jdkname} %{jdkimage}
71d8cf
    mv ${jrename} %{jreimage}
71d8cf
71d8cf
    popd #images
71d8cf
71d8cf
}
71d8cf
71d8cf
%if %{build_hotspot_first}
71d8cf
  # Build a fresh libjvm.so first and use it to bootstrap
71d8cf
  cp -LR --preserve=mode,timestamps %{bootjdk} newboot
71d8cf
  systemjdk=$(pwd)/newboot
71d8cf
  buildjdk build/newboot ${systemjdk} %{hotspot_target} "release" "bundled" "internal"
71d8cf
  mv build/newboot/jdk/lib/server/libjvm.so newboot/lib/server
71d8cf
%else
71d8cf
  systemjdk=%{bootjdk}
71d8cf
%endif
71d8cf
71d8cf
for suffix in %{build_loop} ; do
71d8cf
71d8cf
  if [ "x$suffix" = "x" ] ; then
71d8cf
      debugbuild=release
71d8cf
  else
71d8cf
      # change --something to something
71d8cf
      debugbuild=`echo $suffix  | sed "s/-//g"`
71d8cf
  fi
71d8cf
  # We build with internal debug symbols and do
71d8cf
  # our own stripping for one version of the
71d8cf
  # release build
71d8cf
  debug_symbols=internal
71d8cf
71d8cf
  builddir=%{buildoutputdir -- ${suffix}}
71d8cf
  bootbuilddir=boot${builddir}
71d8cf
  installdir=%{installoutputdir -- ${suffix}}
71d8cf
  bootinstalldir=boot${installdir}
71d8cf
  packagesdir=%{packageoutputdir -- ${suffix}}
71d8cf
71d8cf
  link_opt="%{link_type}"
71d8cf
%if %{system_libs}
71d8cf
  # Copy the source tree so we can remove all in-tree libraries
71d8cf
  cp -a %{top_level_dir_name} %{top_level_dir_name_backup}
71d8cf
  # Remove all libraries that are linked
71d8cf
  sh %{SOURCE12} %{top_level_dir_name} full
71d8cf
%endif
71d8cf
  # Debug builds don't need same targets as release for
71d8cf
  # build speed-up. We also avoid bootstrapping these
71d8cf
  # slower builds.
71d8cf
  if echo $debugbuild | grep -q "debug" ; then
71d8cf
      maketargets="%{debug_targets}"
71d8cf
      run_bootstrap=false
71d8cf
  else
71d8cf
      maketargets="%{release_targets}"
71d8cf
      run_bootstrap=%{bootstrap_build}
71d8cf
  fi
71d8cf
  if ${run_bootstrap} ; then
71d8cf
      buildjdk ${bootbuilddir} ${systemjdk} "%{bootstrap_targets}" ${debugbuild} ${link_opt} ${debug_symbols}
71d8cf
      installjdk ${bootbuilddir} ${bootinstalldir}
71d8cf
      buildjdk ${builddir} $(pwd)/${bootinstalldir}/images/%{jdkimage} "${maketargets}" ${debugbuild} ${link_opt} ${debug_symbols}
71d8cf
      installjdk ${builddir} ${installdir}
71d8cf
      %{!?with_artifacts:rm -rf ${bootinstalldir}}
71d8cf
  else
71d8cf
      buildjdk ${builddir} ${systemjdk} "${maketargets}" ${debugbuild} ${link_opt} ${debug_symbols}
71d8cf
      installjdk ${builddir} ${installdir}
71d8cf
  fi
71d8cf
  packagejdk ${installdir} ${packagesdir}
71d8cf
71d8cf
%if %{system_libs}
71d8cf
  # Restore original source tree we modified by removing full in-tree sources
71d8cf
  rm -rf %{top_level_dir_name}
71d8cf
  mv %{top_level_dir_name_backup} %{top_level_dir_name}
71d8cf
%endif
71d8cf
71d8cf
# build cycles
71d8cf
done # end of release / debug cycle loop
71d8cf
71d8cf
%check
71d8cf
71d8cf
# We test debug first as it will give better diagnostics on a crash
71d8cf
for suffix in %{build_loop} ; do
71d8cf
71d8cf
# portable builds have static_libs embedded, thus top_dir_abs_main_build_path is same as  top_dir_abs_staticlibs_build_path
71d8cf
top_dir_abs_main_build_path=$(pwd)/%{installoutputdir -- ${suffix}}
71d8cf
%if %{include_staticlibs}
71d8cf
top_dir_abs_staticlibs_build_path=${top_dir_abs_main_build_path}
71d8cf
%endif
71d8cf
71d8cf
export JAVA_HOME=${top_dir_abs_main_build_path}/images/%{jdkimage}
71d8cf
71d8cf
# Pre-test setup
71d8cf
71d8cf
# System security properties are disabled by default on portable.
71d8cf
# Turn on system security properties
71d8cf
#sed -i -e "s:^security.useSystemPropertiesFile=.*:security.useSystemPropertiesFile=true:" \
71d8cf
#${JAVA_HOME}/conf/security/java.security
71d8cf
71d8cf
71d8cf
#check Shenandoah is enabled
71d8cf
%if %{use_shenandoah_hotspot}
71d8cf
$JAVA_HOME//bin/java -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -version
71d8cf
%endif
71d8cf
71d8cf
# Check unlimited policy has been used
71d8cf
$JAVA_HOME/bin/javac -d . %{SOURCE13}
71d8cf
$JAVA_HOME/bin/java --add-opens java.base/javax.crypto=ALL-UNNAMED TestCryptoLevel
71d8cf
71d8cf
# Check ECC is working
71d8cf
$JAVA_HOME/bin/javac -d . %{SOURCE14}
71d8cf
$JAVA_HOME/bin/java $(echo $(basename %{SOURCE14})|sed "s|\.java||")
71d8cf
71d8cf
# Check system crypto (policy) is active and can be disabled
71d8cf
# Test takes a single argument - true or false - to state whether system
71d8cf
# security properties are enabled or not.
71d8cf
$JAVA_HOME/bin/javac -d . %{SOURCE15}
71d8cf
export PROG=$(echo $(basename %{SOURCE15})|sed "s|\.java||")
71d8cf
export SEC_DEBUG="-Djava.security.debug=properties"
71d8cf
# Specific to portable:System security properties to be off by default
71d8cf
$JAVA_HOME/bin/java ${SEC_DEBUG} ${PROG} false
71d8cf
$JAVA_HOME/bin/java ${SEC_DEBUG} -Djava.security.disableSystemPropertiesFile=true ${PROG} false
71d8cf
71d8cf
# Check correct vendor values have been set
71d8cf
$JAVA_HOME/bin/javac -d . %{SOURCE16}
71d8cf
$JAVA_HOME/bin/java $(echo $(basename %{SOURCE16})|sed "s|\.java||") "%{oj_vendor}" "%{oj_vendor_url}" "%{oj_vendor_bug_url}" "%{oj_vendor_version}"
71d8cf
71d8cf
# Check java launcher has no SSB mitigation
71d8cf
if ! nm $JAVA_HOME/bin/java | grep set_speculation ; then true ; else false; fi
71d8cf
71d8cf
# Check alt-java launcher has SSB mitigation on supported architectures
71d8cf
%ifarch %{ssbd_arches}
71d8cf
nm $JAVA_HOME/bin/%{alt_java_name} | grep set_speculation
71d8cf
%else
71d8cf
if ! nm $JAVA_HOME/bin/%{alt_java_name} | grep set_speculation ; then true ; else false; fi
71d8cf
%endif
71d8cf
71d8cf
%if ! 0%{?flatpak}
71d8cf
# Check translations are available for new timezones (during flatpak builds, the
71d8cf
# tzdb.dat used by this test is not where the test expects it, so this is
71d8cf
# disabled for flatpak builds)
71d8cf
$JAVA_HOME/bin/javac -d . %{SOURCE18}
71d8cf
$JAVA_HOME/bin/java $(echo $(basename %{SOURCE18})|sed "s|\.java||") JRE
71d8cf
$JAVA_HOME/bin/java -Djava.locale.providers=CLDR $(echo $(basename %{SOURCE18})|sed "s|\.java||") CLDR
71d8cf
%endif
71d8cf
71d8cf
%if %{include_staticlibs}
71d8cf
# Check debug symbols in static libraries (smoke test)
71d8cf
export STATIC_LIBS_HOME=${top_dir_abs_staticlibs_build_path}/images/%{static_libs_image}
71d8cf
ls -l $STATIC_LIBS_HOME
71d8cf
ls -l $STATIC_LIBS_HOME/lib
71d8cf
# they are here, but grep do not find the remainders
71d8cf
#readelf --debug-dump $STATIC_LIBS_HOME/lib/libfdlibm.a | grep w_remainder.c
71d8cf
#readelf --debug-dump $STATIC_LIBS_HOME/lib/libfdlibm.a | grep e_remainder.c
71d8cf
%endif
71d8cf
71d8cf
# Release builds strip the debug symbols into external .debuginfo files
71d8cf
if [ "x$suffix" = "x" ] ; then
71d8cf
  so_suffix="debuginfo"
71d8cf
else
71d8cf
  so_suffix="so"
71d8cf
fi
71d8cf
# Check debug symbols are present and can identify code
71d8cf
find "$JAVA_HOME" -iname "*.$so_suffix" -print0 | while read -d $'\0' lib
71d8cf
do
71d8cf
  if [ -f "$lib" ] ; then
71d8cf
    echo "Testing $lib for debug symbols"
71d8cf
    # All these tests rely on RPM failing the build if the exit code of any set
71d8cf
    # of piped commands is non-zero.
71d8cf
71d8cf
    # Test for .debug_* sections in the shared object. This is the main test
71d8cf
    # Stripped objects will not contain these
71d8cf
    eu-readelf -S "$lib" | grep "] .debug_"
71d8cf
    test $(eu-readelf -S "$lib" | grep -E "\]\ .debug_(info|abbrev)" | wc --lines) == 2
71d8cf
71d8cf
    # Test FILE symbols. These will most likely be removed by anything that
71d8cf
    # manipulates symbol tables because it's generally useless. So a nice test
71d8cf
    # that nothing has messed with symbols
71d8cf
    old_IFS="$IFS"
71d8cf
    IFS=$'\n'
71d8cf
    for line in $(eu-readelf -s "$lib" | grep "00000000      0 FILE    LOCAL  DEFAULT")
71d8cf
    do
71d8cf
     # We expect to see .cpp and .S files, except for architectures like aarch64 and
71d8cf
     # s390 where we expect .o and .oS files
71d8cf
      echo "$line" | grep -E "ABS ((.*/)?[-_a-zA-Z0-9]+\.(c|cc|cpp|cxx|o|S|oS))?$"
71d8cf
    done
71d8cf
    IFS="$old_IFS"
71d8cf
71d8cf
    # If this is the JVM, look for javaCalls.(cpp|o) in FILEs, for extra sanity checking
71d8cf
    if [ "`basename $lib`" = "libjvm.so" ]; then
71d8cf
      eu-readelf -s "$lib" | \
71d8cf
        grep -E "00000000      0 FILE    LOCAL  DEFAULT      ABS javaCalls.(cpp|o)$"
71d8cf
    fi
71d8cf
71d8cf
    # Test that there are no .gnu_debuglink sections pointing to another
71d8cf
    # debuginfo file. There shouldn't be any debuginfo files, so the link makes
71d8cf
    # no sense either
71d8cf
    eu-readelf -S "$lib" | grep 'gnu'
71d8cf
    if eu-readelf -S "$lib" | grep '] .gnu_debuglink' | grep PROGBITS; then
71d8cf
      echo "bad .gnu_debuglink section."
71d8cf
      eu-readelf -x .gnu_debuglink "$lib"
71d8cf
      false
71d8cf
    fi
71d8cf
  fi
71d8cf
done
71d8cf
71d8cf
# Make sure gdb can do a backtrace based on line numbers on libjvm.so
71d8cf
# javaCalls.cpp:58 should map to:
71d8cf
# http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/file/ff3b27e6bcc2/src/share/vm/runtime/javaCalls.cpp#l58
71d8cf
# Using line number 1 might cause build problems. See:
71d8cf
# https://bugzilla.redhat.com/show_bug.cgi?id=1539664
71d8cf
# https://bugzilla.redhat.com/show_bug.cgi?id=1538767
71d8cf
gdb -q "$JAVA_HOME/bin/java" <
71d8cf
handle SIGSEGV pass nostop noprint
71d8cf
handle SIGILL pass nostop noprint
71d8cf
set breakpoint pending on
71d8cf
break javaCalls.cpp:58
71d8cf
commands 1
71d8cf
backtrace
71d8cf
quit
71d8cf
end
71d8cf
run -version
71d8cf
EOF
71d8cf
%ifarch %{gdb_arches}
71d8cf
grep 'JavaCallWrapper::JavaCallWrapper' gdb.out
71d8cf
%endif
71d8cf
71d8cf
# Check src.zip has all sources. See RHBZ#1130490
71d8cf
unzip -l $JAVA_HOME/lib/src.zip | grep 'sun.misc.Unsafe'
71d8cf
71d8cf
# Check class files include useful debugging information
71d8cf
$JAVA_HOME/bin/javap -l java.lang.Object | grep "Compiled from"
71d8cf
$JAVA_HOME/bin/javap -l java.lang.Object | grep LineNumberTable
71d8cf
$JAVA_HOME/bin/javap -l java.lang.Object | grep LocalVariableTable
71d8cf
71d8cf
# Check generated class files include useful debugging information
71d8cf
$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep "Compiled from"
71d8cf
$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep LineNumberTable
71d8cf
$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep LocalVariableTable
71d8cf
71d8cf
# build cycles check
71d8cf
done
71d8cf
71d8cf
%install
71d8cf
71d8cf
for suffix in %{build_loop} ; do
71d8cf
71d8cf
    packagesdir=%{packageoutputdir -- ${suffix}}
71d8cf
71d8cf
    if [ "x$suffix" == "x" ] ; then
71d8cf
        nameSuffix=""
71d8cf
    else
71d8cf
        nameSuffix=`echo "$suffix"| sed s/-/./`
71d8cf
    fi
71d8cf
71d8cf
    # These definitions should match those in installjdk
71d8cf
    jdkarchive=${packagesdir}/%{jdkportablearchive -- "$nameSuffix"}
71d8cf
    jrearchive=${packagesdir}/%{jreportablearchive -- "$nameSuffix"}
71d8cf
    staticarchive=${packagesdir}/%{staticlibsportablearchive -- "$nameSuffix"}
71d8cf
    debugarchive=${packagesdir}/%{jdkportablearchive -- "${nameSuffix}.debuginfo"}
71d8cf
    unstrippedarchive=${packagesdir}/%{jdkportablearchive -- "${nameSuffix}.unstripped"}
71d8cf
71d8cf
    mkdir -p $RPM_BUILD_ROOT%{_jvmdir}
71d8cf
71d8cf
    mv ${jdkarchive} $RPM_BUILD_ROOT%{_jvmdir}/
71d8cf
    mv ${jdkarchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/
71d8cf
    mv ${jrearchive} $RPM_BUILD_ROOT%{_jvmdir}/
71d8cf
    mv ${jrearchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/
71d8cf
71d8cf
%if %{include_staticlibs}
71d8cf
    mv ${staticarchive} $RPM_BUILD_ROOT%{_jvmdir}/
71d8cf
    mv ${staticarchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/
71d8cf
%endif
71d8cf
71d8cf
    if [ "x$suffix" = "x" ] ; then
71d8cf
        mv ${debugarchive} $RPM_BUILD_ROOT%{_jvmdir}/
71d8cf
        mv ${debugarchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/
71d8cf
        mv ${unstrippedarchive} $RPM_BUILD_ROOT%{_jvmdir}/
71d8cf
        mv ${unstrippedarchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/
71d8cf
    fi
71d8cf
done
71d8cf
71d8cf
# These definitions should match those in installjdk
71d8cf
# Install outside the loop as there are no debug variants
71d8cf
docarchive=${packagesdir}/%{docportablearchive}
71d8cf
miscarchive=${packagesdir}/%{miscportablearchive}
71d8cf
71d8cf
mv ${docarchive} $RPM_BUILD_ROOT%{_jvmdir}/
71d8cf
mv ${docarchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/
71d8cf
mv ${miscarchive} $RPM_BUILD_ROOT%{_jvmdir}/
71d8cf
mv ${miscarchive}.sha256sum $RPM_BUILD_ROOT%{_jvmdir}/
71d8cf
71d8cf
# To show sha in the build log
71d8cf
for file in `ls $RPM_BUILD_ROOT%{_jvmdir}/*.sha256sum` ; do
71d8cf
    ls -l $file ;
71d8cf
    cat $file ;
71d8cf
done
71d8cf
71d8cf
%if %{include_normal_build}
71d8cf
71d8cf
%files
71d8cf
# main package builds always
71d8cf
%{_jvmdir}/%{jreportablearchive -- %%{nil}}
71d8cf
%{_jvmdir}/%{jreportablearchive -- %%{nil}}.sha256sum
71d8cf
%else
71d8cf
%files
71d8cf
# placeholder
71d8cf
%endif
71d8cf
71d8cf
%files devel
71d8cf
%{_jvmdir}/%{jdkportablearchive -- %%{nil}}
71d8cf
%{_jvmdir}/%{jdkportablearchive -- .debuginfo}
71d8cf
%{_jvmdir}/%{jdkportablearchive -- %%{nil}}.sha256sum
71d8cf
%{_jvmdir}/%{jdkportablearchive -- .debuginfo}.sha256sum
71d8cf
71d8cf
%if %{include_staticlibs}
71d8cf
%files static-libs
71d8cf
%{_jvmdir}/%{staticlibsportablearchive -- %%{nil}}
71d8cf
%{_jvmdir}/%{staticlibsportablearchive -- %%{nil}}.sha256sum
71d8cf
%endif
71d8cf
71d8cf
%files unstripped
71d8cf
%{_jvmdir}/%{jdkportablearchive -- .unstripped}
71d8cf
%{_jvmdir}/%{jdkportablearchive -- .unstripped}.sha256sum
71d8cf
71d8cf
%if %{include_debug_build}
71d8cf
71d8cf
%files slowdebug
71d8cf
%{_jvmdir}/%{jreportablearchive -- .slowdebug}
71d8cf
%{_jvmdir}/%{jreportablearchive -- .slowdebug}.sha256sum
71d8cf
71d8cf
%files devel-slowdebug
71d8cf
%{_jvmdir}/%{jdkportablearchive -- .slowdebug}
71d8cf
%{_jvmdir}/%{jdkportablearchive -- .slowdebug}.sha256sum
71d8cf
71d8cf
%if %{include_staticlibs}
71d8cf
%files static-libs-slowdebug
71d8cf
%{_jvmdir}/%{staticlibsportablearchive -- .slowdebug}
71d8cf
%{_jvmdir}/%{staticlibsportablearchive -- .slowdebug}.sha256sum
71d8cf
%endif
71d8cf
71d8cf
%endif
71d8cf
71d8cf
%if %{include_fastdebug_build}
71d8cf
71d8cf
%files fastdebug
71d8cf
%{_jvmdir}/%{jreportablearchive -- .fastdebug}
71d8cf
%{_jvmdir}/%{jreportablearchive -- .fastdebug}.sha256sum
71d8cf
71d8cf
%files devel-fastdebug
71d8cf
%{_jvmdir}/%{jdkportablearchive -- .fastdebug}
71d8cf
%{_jvmdir}/%{jdkportablearchive -- .fastdebug}.sha256sum
71d8cf
71d8cf
%if %{include_staticlibs}
71d8cf
%files static-libs-fastdebug
71d8cf
%{_jvmdir}/%{staticlibsportablearchive -- .fastdebug}
71d8cf
%{_jvmdir}/%{staticlibsportablearchive -- .fastdebug}.sha256sum
71d8cf
%endif
71d8cf
71d8cf
%endif
71d8cf
71d8cf
%files docs
71d8cf
%{_jvmdir}/%{docportablearchive}
71d8cf
%{_jvmdir}/%{docportablearchive}.sha256sum
71d8cf
71d8cf
%files misc
71d8cf
%{_jvmdir}/%{miscportablearchive}
71d8cf
%{_jvmdir}/%{miscportablearchive}.sha256sum
71d8cf
71d8cf
%changelog
71d8cf
* Tue Apr 25 2023 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.7.0.7-2
71d8cf
- Update to jdk-17.0.7.0+7
71d8cf
- Update release notes to 17.0.7.0+7
71d8cf
- Require tzdata 2023c due to local inclusion of JDK-8274864 & JDK-8305113
71d8cf
- Reintroduce generate_source_tarball.sh from RHEL 9
71d8cf
- Update generate_tarball.sh to add support for passing a boot JDK to the configure run
71d8cf
- Add POSIX-friendly error codes to generate_tarball.sh and fix whitespace
71d8cf
- Remove .jcheck and GitHub support when generating tarballs, as done in upstream release tarballs
71d8cf
- Update FIPS support against 17.0.7+6 and bring in latest changes:
71d8cf
- * RH2134669: Add missing attributes when registering services in FIPS mode.
71d8cf
- * test/jdk/sun/security/pkcs11/fips/VerifyMissingAttributes.java: fixed jtreg main class
71d8cf
- * RH1940064: Enable XML Signature provider in FIPS mode
71d8cf
- * RH2173781: Avoid calling C_GetInfo() too early, before cryptoki is initialized
71d8cf
- Fix trailing '.' in tarball name
71d8cf
- Use rpmrelease in vendor version to avoid inclusion of dist tag
71d8cf
- ** This tarball is embargoed until 2023-04-18 @ 1pm PT. **
71d8cf
- Resolves: rhbz#2185182
71d8cf
- Resolves: rhbz#2134669
71d8cf
- Resolves: rhbz#1940064
71d8cf
- Resolves: rhbz#2173781
71d8cf
71d8cf
* Thu Apr 20 2023 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.6.0.10-7
71d8cf
- Sync with existing RHEL 8 build, in order to start building portables on RHEL 8
71d8cf
- Restore system bootstrap JDK (RHEL 8 has java-17-openjdk)
71d8cf
- Remove use of devtoolset (RHEL 8 native compilers should be sufficient)
71d8cf
- Explicitly exclude x86, as on RHEL RPMs
71d8cf
71d8cf
* Tue Feb 21 2023 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.6.0.10-6
71d8cf
- Add docs, icons and samples to the portable output
71d8cf
- Make sure generated checksums work and don't include full path
71d8cf
- The docs directory is a subdirectory of images, so remove confusing separate copying
71d8cf
71d8cf
* Wed Feb 15 2023 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.6.0.10-5
71d8cf
- Build with internal debuginfo as in RHEL and then create a stripped variant ourselves for the portable release build
71d8cf
- Restore compiler flags to those used in RHEL
71d8cf
- Drop unused static library patch
71d8cf
- Drop syslookup workaround which was fixed by JDK-8276572 over a year ago
71d8cf
71d8cf
* Tue Feb 14 2023 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.6.0.10-4
71d8cf
- Separate JDK packaging into a separate function
71d8cf
- Use variables to make it clearer what is going on
71d8cf
- Use a package output directory as we do for building and installing
71d8cf
- Workaround missing manpage directory in the JRE image
71d8cf
71d8cf
* Sun Feb 12 2023 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.6.0.10-3
71d8cf
- Adapt the portable build to use the same system library handling as RHEL builds
71d8cf
71d8cf
* Sat Jan 14 2023 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.6.0.10-3
71d8cf
- Add missing release note for JDK-8295687
71d8cf
- Resolves: rhbz#2160111
71d8cf
71d8cf
* Fri Jan 13 2023 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.6.0.10-2
71d8cf
- Update FIPS support to bring in latest changes
71d8cf
- * Add nss.fips.cfg support to OpenJDK tree
71d8cf
- * RH2117972: Extend the support for NSS DBs (PKCS11) in FIPS mode
71d8cf
- * Remove forgotten dead code from RH2020290 and RH2104724
71d8cf
- * OJ1357: Fix issue on FIPS with a SecurityManager in place
71d8cf
- Drop local nss.fips.cfg.in handling now this is handled in the patched OpenJDK build
71d8cf
- Resolves: rhbz#2118493
71d8cf
71d8cf
* Fri Jan 13 2023 Stephan Bergmann <sbergman@redhat.com> - 1:17.0.6.0.10-2
71d8cf
- Fix flatpak builds by disabling TestTranslations test due to missing tzdb.dat
71d8cf
- Related: rhbz#2160111
71d8cf
71d8cf
* Wed Jan 11 2023 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.6.0.10-1
71d8cf
- Update to jdk-17.0.6.0+10
71d8cf
- Update release notes to 17.0.6.0+10
71d8cf
- Re-enable EA upstream status check now it is being actively maintained.
71d8cf
- Drop JDK-8294357 (tzdata2022d) & JDK-8295173 (tzdata2022e) local patches which are now upstream
71d8cf
- Drop JDK-8275535 local patch now this has been accepted and backported upstream
71d8cf
- Drop local copy of JDK-8293834 now this is upstream
71d8cf
- Require tzdata 2022g due to inclusion of JDK-8296108, JDK-8296715 & JDK-8297804
71d8cf
- Update TestTranslations.java to test the new America/Ciudad_Juarez zone
71d8cf
- ** This tarball is embargoed until 2023-01-17 @ 1pm PT. **
71d8cf
- Resolves: rhbz#2160111
71d8cf
71d8cf
* Sat Oct 15 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.5.0.8-2
71d8cf
- Update in-tree tzdata to 2022e with JDK-8294357 & JDK-8295173
71d8cf
- Update CLDR data with Europe/Kyiv (JDK-8293834)
71d8cf
- Drop JDK-8292223 patch which we found to be unnecessary
71d8cf
- Update TestTranslations.java to use public API based on TimeZoneNamesTest upstream
71d8cf
- Related: rhbz#2160111
71d8cf
71d8cf
* Thu Oct 13 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.5.0.8-1
71d8cf
- Update to jdk-17.0.5+8 (GA)
71d8cf
- Update release notes to 17.0.5+8 (GA)
71d8cf
- Switch to GA mode for final release.
71d8cf
- * This tarball is embargoed until 2022-10-18 @ 1pm PT. *
71d8cf
- Resolves: rhbz#2133695
71d8cf
71d8cf
* Fri Sep 02 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.4.1.1-2
71d8cf
- Update FIPS support to bring in latest changes
71d8cf
- * RH2023467: Enable FIPS keys export
71d8cf
- * RH2104724: Avoid import/export of DH private keys
71d8cf
- * RH2092507: P11Key.getEncoded does not work for DH keys in FIPS mode
71d8cf
- * Build the systemconf library on all platforms
71d8cf
- * RH2048582: Support PKCS#12 keystores
71d8cf
- * RH2020290: Support TLS 1.3 in FIPS mode
71d8cf
- Resolves: rhbz#2123579
71d8cf
- Resolves: rhbz#2123580
71d8cf
- Resolves: rhbz#2123581
71d8cf
- Resolves: rhbz#2123583
71d8cf
- Resolves: rhbz#2123584
71d8cf
71d8cf
* Sun Aug 21 2022 Jayashree Huttanagoudar <jhuttana@redhat.com> - 1:17.0.4.1.1-1
71d8cf
- Added a missing change to portable NEWS file from upstream.
71d8cf
71d8cf
* Sun Aug 21 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.4.1.1-1
71d8cf
- Update to jdk-17.0.4.1+1
71d8cf
- Update release notes to 17.0.4.1+1
71d8cf
- Add patch to provide translations for Europe/Kyiv added in tzdata2022b
71d8cf
- Add test to ensure timezones can be translated
71d8cf
- Resolves: rhbz#2119532
71d8cf
71d8cf
* Mon Jul 18 2022 Jayashree Huttanagoudar <jhuttana@redhat.com> - 1:17.0.4.0.8-1
71d8cf
- Commented out: fipsver f8142a23d0a which was from rhel-9-main
71d8cf
- Picked 17.0.4+8 GA tag from rhel-9.0.0
71d8cf
- For Jul 2022 CPU fipsver is 765f970aef1 on rhel-9.0.0
71d8cf
71d8cf
* Mon Jul 18 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.4.0.8-1
71d8cf
- Update to jdk-17.0.4.0+8 (GA)
71d8cf
- Update release notes to 17.0.4.0+8
71d8cf
- Need to include the '.S' suffix in debuginfo checks after JDK-8284661
71d8cf
- Switch to GA mode for release
71d8cf
- ** This tarball is embargoed until 2022-07-19 @ 1pm PT. **
71d8cf
71d8cf
* Thu Jul 14 2022 Jayashree Huttanagoudar <jhuttana@redhat.com> - 1:17.0.4.0.1-0.2.ea
71d8cf
- Fix issue where CheckVendor.java test erroneously passes when it should fail.
71d8cf
- Add proper quoting so '&' is not treated as a special character by the shell.
71d8cf
- Related: rhbz#2084779
71d8cf
71d8cf
* Tue Jul 12 2022 Jayashree Huttanagoudar <jhuttana@redhat.com> - 1:17.0.4.0.1-0.1.ea
71d8cf
- Tweaked line to print release information for portable
71d8cf
71d8cf
* Tue Jul 12 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.4.0.1-0.1.ea
71d8cf
- Update to jdk-17.0.4.0+1
71d8cf
- Update release notes to 17.0.4.0+1
71d8cf
- Switch to EA mode for 17.0.4 pre-release builds.
71d8cf
- Print release file during build, which should now include a correct SOURCE value from .src-rev
71d8cf
- Update tarball script with IcedTea GitHub URL and .src-rev generation
71d8cf
- Include script to generate bug list for release notes
71d8cf
- Update tzdata requirement to 2022a to match JDK-8283350
71d8cf
- Move EA designator check to prep so failures can be caught earlier
71d8cf
- Make EA designator check non-fatal while upstream is not maintaining it
71d8cf
- Related: rhbz#2084218
71d8cf
71d8cf
* Thu Jun 30 2022 Jayashree Huttanagoudar <jhuttana@redhat.com> - 1:17.0.3.0.7-8
71d8cf
- Comment line for portable: System security properties to be off by default
71d8cf
71d8cf
* Thu Jun 30 2022 Francisco Ferrari Bihurriet <fferrari@redhat.com> - 1:17.0.3.0.7-8
71d8cf
- RH2007331: SecretKey generate/import operations don't add the CKA_SIGN attribute in FIPS mode
71d8cf
- Resolves: rhbz#2102433
71d8cf
71d8cf
* Wed Jun 29 2022 Jayashree Huttanagoudar <jhuttana@redhat.com> - 1:17.0.3.0.7-7
71d8cf
- System security properties are disabled by default on portable.
71d8cf
- Commented out lines which are not applicable for portable.
71d8cf
71d8cf
* Wed Jun 29 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.3.0.7-7
71d8cf
- Update FIPS support to bring in latest changes
71d8cf
- * RH2036462: sun.security.pkcs11.wrapper.PKCS11.getInstance breakage
71d8cf
- * RH2090378: Revert to disabling system security properties and FIPS mode support together
71d8cf
- Rebase RH1648249 nss.cfg patch so it applies after the FIPS patch
71d8cf
- Enable system security properties in the RPM (now disabled by default in the FIPS repo)
71d8cf
- Improve security properties test to check both enabled and disabled behaviour
71d8cf
- Run security properties test with property debugging on
71d8cf
- Resolves: rhbz#2099844
71d8cf
- Resolves: rhbz#2100677
71d8cf
71d8cf
* Tue Jun 28 2022 Jayashree Huttanagoudar <jhuttana@redhat.com> - 1:17.0.3.0.7-6
71d8cf
- Removed upstreamed patch2001: aqaCheckSecurityAndProviderFileSocketPermissions.patch
71d8cf
71d8cf
* Sun Jun 12 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.3.0.7-6
71d8cf
- Rebase FIPS patches from fips-17u branch and simplify by using a single patch from that repository
71d8cf
- Rebase RH1648249 nss.cfg patch so it applies after the FIPS patch
71d8cf
- RH2023467: Enable FIPS keys export
71d8cf
- RH2094027: SunEC runtime permission for FIPS
71d8cf
- Resolves: rhbz#2029657
71d8cf
- Resolves: rhbz#2096117
71d8cf
71d8cf
* Wed May 25 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.3.0.7-5
71d8cf
- Exclude s390x from the gdb test on RHEL 7 where we see failures with the portable build
71d8cf
71d8cf
* Tue May 24 2022 Jiri Vanek <jvanek@redhat.com> - 1:17.0.3.0.7-4
71d8cf
- to pass aqa, fixing genuie failure in :
71d8cf
- java/lang/SecurityManager/CheckAccessClassInPackagePermissions.java#CheckAccessClassInPackagePermissions
71d8cf
- javax/xml/crypto/dsig/FileSocketPermissions.java#FileSocketPermissions
71d8cf
- added and applied patch2001: aqaCheckSecurityAndProviderFileSocketPermissions.patch
71d8cf
- this, properly named, patch must go to all our jdk17 builds, and to the fips repo
71d8cf
71d8cf
* Thu May 19 2022 Jiri Vanek <jvanek@redhat.com> - 1:17.0.3.0.7-3
71d8cf
- to pass aqa:
71d8cf
- removed copy system tzdb in favour of in-tree
71d8cf
- removed Patch2: rh1648644-java_access_bridge_privileged_security.patch
71d8cf
- This is not intended to release untill we decide proper steps
71d8cf
71d8cf
* Thu May 19 2022 Jayashree Huttanagoudar <jhuttana@redhat.com> - 1:17.0.3.0.7-2
71d8cf
- Include BOOT_JDK for s390x for portable
71d8cf
- BOOT_JDK downlaoded form hydra as
71d8cf
  java-17-temurin-17.0.3.7-0.private.ojdk17~upstream.hotspot.release.sdk.el7.s390x.tarxz
71d8cf
  and renamed
71d8cf
- Added cosmetic changes to bypass a failure for s390x
71d8cf
71d8cf
* Wed Apr 20 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.3.0.7-1
71d8cf
- April 2022 security update to jdk 17.0.3+7
71d8cf
- Remove JDK-8284548 and JDK-8284920 they are upstreamed now
71d8cf
- Resolves: rhbz#2073579
71d8cf
71d8cf
* Sat Apr 16 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.3.0.6-3
71d8cf
- Add JDK-8284920 fix for XPath regression
71d8cf
- Related: rhbz#2073575
71d8cf
71d8cf
* Fri Apr 15 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.3.0.6-2
71d8cf
- Remove the patch jdk8283911-default_promoted_version_pre.patch which missed in previous commit
71d8cf
- JDK-8275082 should be listed as also resolving JDK-8278008 & CVE-2022-21476
71d8cf
- Related: rhbz#2073575
71d8cf
71d8cf
* Mon Apr 11 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.3.0.6-1
71d8cf
- April 2022 security update to jdk 17.0.3+6
71d8cf
- Update to jdk-17.0.3.0+6 pre-release tarball (17usec.17.0.3+5-220408)
71d8cf
- Add JDK-8284548 regression fix missing from pre-release tarball but in jdk-17.0.3+6/jdk-17.0.3-ga
71d8cf
- Update release notes to 17.0.3.0+6
71d8cf
- Add missing README.md and generate_source_tarball.sh
71d8cf
- Introduce tests/tests.yml, based on the one in java-11-openjdk
71d8cf
- JDK-8283911 patch no longer needed now we're GA...
71d8cf
- Switch to GA mode for release
71d8cf
- ** This tarball is embargoed until 2022-04-19 @ 1pm PT. **
71d8cf
- Resolves: rhbz#2073575
71d8cf
71d8cf
* Wed Apr 06 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.3.0.5-0.1.ea
71d8cf
- Update to jdk-17.0.3.0+5
71d8cf
- Update release notes to 17.0.3.0+5
71d8cf
- Resolves: rhbz#2050460
71d8cf
71d8cf
* Tue Mar 29 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.3.0.1-0.1.ea
71d8cf
- Update to jdk-17.0.3.0+1
71d8cf
- Update release notes to 17.0.3.0+1
71d8cf
- Switch to EA mode for 17.0.3 pre-release builds.
71d8cf
- Add JDK-8283911 to fix bad DEFAULT_PROMOTED_VERSION_PRE value
71d8cf
- Related: rhbz#2050456
71d8cf
71d8cf
* Mon Feb 28 2022 Jayashree Huttanagoudar <jhuttana@redhat.com> - 1:17.0.2.0.8-10
71d8cf
- Update icedtea_sync.sh with suitable message for portable
71d8cf
71d8cf
* Mon Feb 28 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.2.0.8-10
71d8cf
- Restructure the build so a minimal initial build is then used for the final build (with docs)
71d8cf
- This reduces pressure on the system JDK and ensures the JDK being built can do a full build
71d8cf
- Turn off bootstrapping for slow debug builds, which are particularly slow on ppc64le.
71d8cf
- Handle Fedora in distro conditionals that currently only pertain to RHEL.
71d8cf
- Run OpenJDK normalizer script on the spec file to fix further rogue whitespace
71d8cf
- Sync gdb test with java-1.8.0-openjdk and improve architecture restrictions.
71d8cf
- Introduce stapinstall variable to set SystemTap arch directory correctly (e.g. arm64 on aarch64)
71d8cf
- Need to support noarch for creating source RPMs for non-scratch builds.
71d8cf
- Replace -mstackrealign with -mincoming-stack-boundary=2 -mpreferred-stack-boundary=4 on x86_32 for stack alignment
71d8cf
- Support a HotSpot-only build so a freshly built libjvm.so can then be used in the bootstrap JDK.
71d8cf
- Explicitly list JIT architectures rather than relying on those with slowdebug builds
71d8cf
- Disable the serviceability agent on Zero architectures even when the architecture itself is supported
71d8cf
- Resolves: rhbz#2022822
71d8cf
71d8cf
* Mon Feb 28 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.2.0.8-9
71d8cf
- Enable AlgorithmParameters and AlgorithmParameterGenerator services in FIPS mode
71d8cf
- Correction to previous changelog entry
71d8cf
- Resolves: rhbz#2052070
71d8cf
71d8cf
* Sun Feb 27 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.2.0.8-8
71d8cf
- Detect NSS at runtime for FIPS detection
71d8cf
- Resolves: rhbz#2051605
71d8cf
71d8cf
* Wed Feb 23 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.2.0.8-7
71d8cf
- Add JDK-8275535 patch to fix LDAP authentication issue.
71d8cf
- Resolves: rhbz#2053521
71d8cf
71d8cf
* Tue Feb 08 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.2.0.8-6
71d8cf
- Minor cosmetic improvements to make spec more comparable between variants
71d8cf
- Related: rhbz#2022822
71d8cf
71d8cf
* Thu Feb 03 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.2.0.8-5
71d8cf
- Update tapsets from IcedTea 6.x repository with fix for JDK-8015774 changes (_heap->_heaps) and @JAVA_SPEC_VER@
71d8cf
- Related: rhbz#2022822
71d8cf
71d8cf
* Thu Feb 03 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.2.0.8-4
71d8cf
- Extend LTS check to exclude EPEL.
71d8cf
- Related: rhbz#2022822
71d8cf
71d8cf
* Tue Jan 18 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.2.0.8-3
71d8cf
- Separate crypto policy initialisation from FIPS initialisation, now they are no longer interdependent
71d8cf
71d8cf
* Mon Jan 17 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.2.0.8-2
71d8cf
- Fix FIPS issues in native code and with initialisation of java.security.Security
71d8cf
- Related: rhbz#2039366
71d8cf
71d8cf
* Wed Jan 12 2022 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.2.0.8-1
71d8cf
- January 2022 security update to jdk 17.0.2+8
71d8cf
- Rebase RH1995150 & RH1996182 patches following JDK-8275863 addition to module-info.java
71d8cf
- Resolves: rhbz#2039366
71d8cf
- Minor change to the OUTPUT_FILE value to separate the name from the version with '-'
71d8cf
71d8cf
* Mon Nov 29 2021 Severin Gehwolf <sgehwolf@redhat.com> - 1:17.0.1.0.12-3
71d8cf
- Use 'sql:' prefix in nss.fips.cfg as F35+ no longer ship the legacy
71d8cf
  secmod.db file as part of nss
71d8cf
- Resolves: rhbz#2023537
71d8cf
71d8cf
* Tue Oct 26 2021 Andrew Hughes <gnu.andrew@redhat.com> - 1:17.0.1.0.12-2
71d8cf
- Drop JDK-8272332/RH2004078 patch which is upstream in 17.0.1
71d8cf
- October CPU update to jdk 17.0.1+12
71d8cf
- Allow plain key import to be disabled with -Dcom.redhat.fips.plainKeySupport=false
71d8cf
- Add patch to allow plain key import.
71d8cf
71d8cf
* Mon Oct 25 2021 Jiri Vanek <jvanek@redhat.com> - 1:17.0.0.0.35-5
71d8cf
- cacerts symlink is resolved before passed to configure
71d8cf
- https://issues.redhat.com/browse/OPENJDK-487
71d8cf
- Disable FIPS mode detection using NSS in favour of using /proc/sys/crypto/fips_enabled for now, so we don't link against NSS
71d8cf
-- effectively disabled Patch1008: rh1929465-improve_system_FIPS_detection.patch by settng --enable-sysconf-nss to --disable-sysconf-nss
71d8cf
-- the enable-sysconf-nss was bringing in hard depndence on nss. Without nss, even in non fips, jvm had not even started
71d8cf
71d8cf
* Thu Sep 30 2021 Jiri Vanek <jvanek@redhat.com> - 1:17.0.0.0.35-4
71d8cf
- initial import, based on jdk11 portbale, merged with jdk17 rpms and java-latest-openjdk for epel7