Blame SPECS/java-11-openjdk.spec

660215
# RPM conditionals so as to be able to dynamically produce
660215
# slowdebug/release builds. See:
660215
# http://rpm.org/user_doc/conditional_builds.html
660215
#
660215
# Examples:
660215
#
0f3be5
# Produce release, fastdebug *and* slowdebug builds on x86_64 (default):
0f3be5
# $ rpmbuild -ba java-11-openjdk.spec
660215
#
9d7641
# Produce only release builds (no slowdebug builds) on x86_64:
0f3be5
# $ rpmbuild -ba java-11-openjdk.spec --without slowdebug --without fastdebug
660215
#
660215
# Only produce a release build on x86_64:
0f3be5
# $ rhpkg mockbuild --without slowdebug --without fastdebug
9d7641
0f3be5
# Enable fastdebug builds by default on relevant arches.
0f3be5
%bcond_without fastdebug
660215
# Enable slowdebug builds by default on relevant arches.
660215
%bcond_without slowdebug
660215
# Enable release builds by default on relevant arches.
660215
%bcond_without release
be8a6c
# Enable static library builds by default.
be8a6c
%bcond_without staticlibs
9d7641
# Remove build artifacts by default
9d7641
%bcond_with artifacts
9d7641
# Build a fresh libjvm.so for use in a copy of the bootstrap JDK
9d7641
%bcond_without fresh_libjvm
660215
0f3be5
# Workaround for stripping of debug symbols from static libraries
be8a6c
%if %{with staticlibs}
0f3be5
%define __brp_strip_static_archive %{nil}
be8a6c
%global include_staticlibs 1
be8a6c
%else
be8a6c
%global include_staticlibs 0
be8a6c
%endif
0f3be5
9d7641
# Define whether to use the bootstrap JDK directly or with a fresh libjvm.so
9d7641
%if %{with fresh_libjvm}
9d7641
%global build_hotspot_first 1
9d7641
%else
9d7641
%global build_hotspot_first 0
9d7641
%endif
9d7641
660215
# The -g flag says to use strip -g instead of full strip on DSOs or EXEs.
660215
# This fixes detailed NMT and other tools which need minimal debug info.
660215
# See: https://bugzilla.redhat.com/show_bug.cgi?id=1520879
660215
%global _find_debuginfo_opts -g
660215
660215
# note: parametrized macros are order-sensitive (unlike not-parametrized) even with normal macros
660215
# also necessary when passing it as parameter to other macros. If not macro, then it is considered a switch
660215
# see the difference between global and define:
660215
# See https://github.com/rpm-software-management/rpm/issues/127 to comments at  "pmatilai commented on Aug 18, 2017"
660215
# (initiated in https://bugzilla.redhat.com/show_bug.cgi?id=1482192)
660215
%global debug_suffix_unquoted -slowdebug
0f3be5
%global fastdebug_suffix_unquoted -fastdebug
be8a6c
%global main_suffix_unquoted -main
be8a6c
%global staticlibs_suffix_unquoted -staticlibs
660215
# quoted one for shell operations
660215
%global debug_suffix "%{debug_suffix_unquoted}"
0f3be5
%global fastdebug_suffix "%{fastdebug_suffix_unquoted}"
660215
%global normal_suffix ""
be8a6c
%global main_suffix "%{main_suffix_unquoted}"
be8a6c
%global staticlibs_suffix "%{staticlibs_suffix_unquoted}"
660215
0f3be5
%global debug_warning This package is unoptimised with full debugging. Install only as needed and remove ASAP.
0f3be5
%global fastdebug_warning This package is optimised with full debugging. Install only as needed and remove ASAP.
be8a6c
%global debug_on unoptimised with full debugging on
be8a6c
%global fastdebug_on optimised with full debugging on
be8a6c
%global for_fastdebug for packages with debugging on and optimisation
be8a6c
%global for_debug for packages with debugging on and no optimisation
660215
660215
%if %{with release}
660215
%global include_normal_build 1
660215
%else
660215
%global include_normal_build 0
660215
%endif
660215
660215
%if %{include_normal_build}
0f3be5
%global normal_build %{normal_suffix}
660215
%else
0f3be5
%global normal_build %{nil}
660215
%endif
660215
660215
# We have hardcoded list of files, which  is appearing in alternatives, and in files
660215
# in alternatives those are slaves and master, very often triplicated by man pages
660215
# in files all masters and slaves are ghosted
660215
# the ghosts are here to allow installation via query like `dnf install /usr/bin/java`
89362c
# you can list those files, with appropriate sections: cat *.spec | grep -e --install -e --slave -e post_ -e alternatives
660215
# TODO - fix those hardcoded lists via single list
0f3be5
# Those files must *NOT* be ghosted for *slowdebug* packages
0f3be5
# FIXME - if you are moving jshell or jlink or similar, always modify all three sections
660215
# you can check via headless and devels:
660215
#    rpm -ql --noghost java-11-openjdk-headless-11.0.1.13-8.fc29.x86_64.rpm  | grep bin
660215
# == rpm -ql           java-11-openjdk-headless-slowdebug-11.0.1.13-8.fc29.x86_64.rpm  | grep bin
660215
# != rpm -ql           java-11-openjdk-headless-11.0.1.13-8.fc29.x86_64.rpm  | grep bin
660215
# similarly for other %%{_jvmdir}/{jre,java} and %%{_javadocdir}/{java,java-zip}
be8a6c
%define is_release_build() %( if [ "%{?1}" == "%{debug_suffix_unquoted}" -o "%{?1}" == "%{fastdebug_suffix_unquoted}" ]; then echo "0" ; else echo "1"; fi )
660215
660215
# 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
660215
# as sytem JDK, we mean any JDK which can run whole system java stack without issues (like bytecode issues, module issues, dependencies...)
660215
%global is_system_jdk 0
660215
660215
%global aarch64         aarch64 arm64 armv8
660215
# we need to distinguish between big and little endian PPC64
660215
%global ppc64le         ppc64le
660215
%global ppc64be         ppc64 ppc64p7
0f3be5
# Set of architectures which support multiple ABIs
660215
%global multilib_arches %{power64} sparc64 x86_64
0f3be5
# Set of architectures for which we build slowdebug builds
0f3be5
%global debug_arches    %{ix86} x86_64 sparcv9 sparc64 %{aarch64} %{power64} s390x
0f3be5
# Set of architectures for which we build fastdebug builds
be8a6c
%global fastdebug_arches x86_64 ppc64le aarch64
0f3be5
# Set of architectures with a Just-In-Time (JIT) compiler
9d7641
%global jit_arches      %{arm} %{aarch64} %{ix86} %{power64} s390x sparcv9 sparc64 x86_64
9d7641
# Set of architectures which use the Zero assembler port (!jit_arches)
9d7641
%global zero_arches ppc s390
0f3be5
# Set of architectures which run a full bootstrap cycle
0f3be5
%global bootstrap_arches %{jit_arches}
0f3be5
# Set of architectures which support SystemTap tapsets
0f3be5
%global systemtap_arches %{jit_arches}
0f3be5
# Set of architectures with a Ahead-Of-Time (AOT) compiler
660215
%global aot_arches      x86_64 %{aarch64}
0f3be5
# Set of architectures which support the serviceability agent
0f3be5
%global sa_arches       %{ix86} x86_64 sparcv9 sparc64 %{aarch64} %{power64} %{arm}
0f3be5
# Set of architectures which support class data sharing
0f3be5
# As of JDK-8005165 in OpenJDK 10, class sharing is not arch-specific
0f3be5
# However, it does segfault on the Zero assembler port, so currently JIT only
0f3be5
%global share_arches    %{jit_arches}
0f3be5
# Set of architectures for which we build the Shenandoah garbage collector
0f3be5
%global shenandoah_arches x86_64 %{aarch64}
0f3be5
# Set of architectures for which we build the Z garbage collector
0f3be5
%global zgc_arches x86_64
be8a6c
# Set of architectures for which alt-java has SSB mitigation
be8a6c
%global ssbd_arches x86_64
9d7641
# Set of architectures where we verify backtraces with gdb
9d7641
%global gdb_arches %{jit_arches} %{zero_arches}
660215
9d7641
# By default, we build a slowdebug build during main build on JIT architectures
660215
%if %{with slowdebug}
0f3be5
%ifarch %{debug_arches}
660215
%global include_debug_build 1
660215
%else
660215
%global include_debug_build 0
660215
%endif
660215
%else
660215
%global include_debug_build 0
660215
%endif
660215
0f3be5
# On certain architectures, we compile the Shenandoah GC
0f3be5
%ifarch %{shenandoah_arches}
660215
%global use_shenandoah_hotspot 1
0f3be5
%global shenandoah_feature shenandoahgc
660215
%else
660215
%global use_shenandoah_hotspot 0
0f3be5
%global shenandoah_feature -shenandoahgc
0f3be5
%endif
0f3be5
0f3be5
# On certain architectures, we compile the ZGC
0f3be5
%ifarch %{zgc_arches}
0f3be5
%global use_zgc_hotspot 1
0f3be5
%global zgc_feature zgc
0f3be5
%else
0f3be5
%global use_zgc_hotspot 0
0f3be5
%global zgc_feature -zgc
0f3be5
%endif
0f3be5
0f3be5
# By default, we build a fastdebug build during main build only on fastdebug architectures
0f3be5
%if %{with fastdebug}
0f3be5
%ifarch %{fastdebug_arches}
0f3be5
%global include_fastdebug_build 1
0f3be5
%else
0f3be5
%global include_fastdebug_build 0
0f3be5
%endif
be8a6c
%else
be8a6c
%global include_fastdebug_build 0
660215
%endif
660215
660215
%if %{include_debug_build}
0f3be5
%global slowdebug_build %{debug_suffix}
660215
%else
0f3be5
%global slowdebug_build %{nil}
660215
%endif
660215
0f3be5
%if %{include_fastdebug_build}
0f3be5
%global fastdebug_build %{fastdebug_suffix}
0f3be5
%else
0f3be5
%global fastdebug_build %{nil}
0f3be5
%endif
660215
9d7641
# If you disable all builds, then the build fails
be8a6c
# Build and test slowdebug first as it provides the best diagnostics
9d7641
%global build_loop %{slowdebug_build} %{fastdebug_build} %{normal_build}
be8a6c
be8a6c
%if %{include_staticlibs}
be8a6c
%global staticlibs_loop %{staticlibs_suffix}
be8a6c
%else
be8a6c
%global staticlibs_loop %{nil}
be8a6c
%endif
0f3be5
89362c
%if 0%{?flatpak}
89362c
%global bootstrap_build false
89362c
%else
0f3be5
%ifarch %{bootstrap_arches}
9d7641
%global bootstrap_build true
660215
%else
9d7641
%global bootstrap_build false
660215
%endif
89362c
%endif
660215
be8a6c
%if %{include_staticlibs}
be8a6c
# Extra target for producing the static-libraries. Separate from
be8a6c
# other targets since this target is configured to use in-tree
be8a6c
# AWT dependencies: lcms, libjpeg, libpng, libharfbuzz, giflib
be8a6c
# and possibly others
be8a6c
%global static_libs_target static-libs-image
9d7641
%else
9d7641
%global static_libs_target %{nil}
be8a6c
%endif
660215
9d7641
# RPM JDK builds keep the debug symbols internal, to be later stripped by RPM
9d7641
%global debug_symbols internal
9d7641
9d7641
# unlike portables,the rpms have to use static_libs_target very dynamically
9d7641
%global bootstrap_targets images
9d7641
%global release_targets images docs-zip
9d7641
# No docs nor bootcycle for debug builds
9d7641
%global debug_targets images
9d7641
# Target to use to just build HotSpot
9d7641
%global hotspot_target hotspot
9d7641
9d7641
# JDK to use for bootstrapping
9d7641
%global bootjdk /usr/lib/jvm/java-%{buildjdkver}-openjdk
9d7641
9d7641
# Disable LTO as this causes build failures at the moment.
9d7641
# See RHBZ#1861401
9d7641
%define _lto_cflags %{nil}
660215
660215
# Filter out flags from the optflags macro that cause problems with the OpenJDK build
660215
# We filter out -O flags so that the optimization of HotSpot is not lowered from O3 to O2
660215
# We filter out -Wall which will otherwise cause HotSpot to produce hundreds of thousands of warnings (100+mb logs)
660215
# We replace it with -Wformat (required by -Werror=format-security) and -Wno-cpp to avoid FORTIFY_SOURCE warnings
660215
# We filter out -fexceptions as the HotSpot build explicitly does -fno-exceptions and it's otherwise the default for C++
660215
%global ourflags %(echo %optflags | sed -e 's|-Wall|-Wformat -Wno-cpp|' | sed -r -e 's|-O[0-9]*||')
660215
%global ourcppflags %(echo %ourflags | sed -e 's|-fexceptions||')
660215
%global ourldflags %{__global_ldflags}
660215
660215
# With disabled nss is NSS deactivated, so NSS_LIBDIR can contain the wrong path
660215
# the initialization must be here. Later the pkg-config have buggy behavior
660215
# looks like openjdk RPM specific bug
660215
# Always set this so the nss.cfg file is not broken
660215
%global NSS_LIBDIR %(pkg-config --variable=libdir nss)
660215
660215
# In some cases, the arch used by the JDK does
660215
# not match _arch.
660215
# Also, in some cases, the machine name used by SystemTap
e42bf6
# does not match that given by _target_cpu
660215
%ifarch x86_64
660215
%global archinstall amd64
e42bf6
%global stapinstall x86_64
660215
%endif
660215
%ifarch ppc
660215
%global archinstall ppc
e42bf6
%global stapinstall powerpc
660215
%endif
660215
%ifarch %{ppc64be}
660215
%global archinstall ppc64
e42bf6
%global stapinstall powerpc
660215
%endif
660215
%ifarch %{ppc64le}
660215
%global archinstall ppc64le
e42bf6
%global stapinstall powerpc
660215
%endif
660215
%ifarch %{ix86}
660215
%global archinstall i686
e42bf6
%global stapinstall i386
660215
%endif
660215
%ifarch ia64
660215
%global archinstall ia64
e42bf6
%global stapinstall ia64
660215
%endif
660215
%ifarch s390
660215
%global archinstall s390
e42bf6
%global stapinstall s390
660215
%endif
660215
%ifarch s390x
660215
%global archinstall s390x
e42bf6
%global stapinstall s390
660215
%endif
660215
%ifarch %{arm}
660215
%global archinstall arm
e42bf6
%global stapinstall arm
660215
%endif
660215
%ifarch %{aarch64}
660215
%global archinstall aarch64
e42bf6
%global stapinstall arm64
660215
%endif
660215
# 32 bit sparc, optimized for v9
660215
%ifarch sparcv9
660215
%global archinstall sparc
e42bf6
%global stapinstall %{_target_cpu}
660215
%endif
660215
# 64 bit sparc
660215
%ifarch sparc64
660215
%global archinstall sparcv9
e42bf6
%global stapinstall %{_target_cpu}
660215
%endif
e42bf6
# Need to support noarch for srpm build
e42bf6
%ifarch noarch
e42bf6
%global archinstall %{nil}
e42bf6
%global stapinstall %{nil}
660215
%endif
660215
0f3be5
%ifarch %{systemtap_arches}
660215
%global with_systemtap 1
660215
%else
660215
%global with_systemtap 0
660215
%endif
660215
660215
# New Version-String scheme-style defines
be8a6c
%global featurever 11
be8a6c
%global interimver 0
89362c
%global updatever 16
be8a6c
%global patchver 0
be8a6c
# buildjdkver is usually same as %%{featurever},
be8a6c
# but in time of bootstrap of next jdk, it is featurever-1,
660215
# and this it is better to change it here, on single place
be8a6c
%global buildjdkver %{featurever}
660215
# Add LTS designator for RHEL builds
660215
%if 0%{?rhel}
660215
  %global lts_designator "LTS"
660215
  %global lts_designator_zip -%{lts_designator}
660215
%else
660215
  %global lts_designator ""
660215
  %global lts_designator_zip ""
660215
%endif
660215
0f3be5
# Define vendor information used by OpenJDK
0f3be5
%global oj_vendor Red Hat, Inc.
be8a6c
%global oj_vendor_url https://www.redhat.com/
0f3be5
# Define what url should JVM offer in case of a crash report
0f3be5
# order may be important, epel may have rhel declared
0f3be5
%if 0%{?epel}
0f3be5
%global oj_vendor_bug_url  https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora%20EPEL&component=%{name}&version=epel%{epel}
0f3be5
%else
0f3be5
%if 0%{?fedora}
0f3be5
# Does not work for rawhide, keeps the version field empty
0f3be5
%global oj_vendor_bug_url  https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=%{name}&version=%{fedora}
0f3be5
%else
0f3be5
%if 0%{?rhel}
0f3be5
%global oj_vendor_bug_url  https://bugzilla.redhat.com/enter_bug.cgi?product=Red%20Hat%20Enterprise%20Linux%20%{rhel}&component=%{name}
0f3be5
%else
0f3be5
%global oj_vendor_bug_url  https://bugzilla.redhat.com/enter_bug.cgi
0f3be5
%endif
0f3be5
%endif
0f3be5
%endif
89362c
%global oj_vendor_version (Red_Hat-%{version}-%{release})
0f3be5
e42bf6
# Define IcedTea version used for SystemTap tapsets and desktop file
be8a6c
%global icedteaver      6.0.0pre00-c848b93a8598
89362c
# Define current Git revision for the FIPS support patches
89362c
%global fipsver 9087e80d0ab
e42bf6
660215
# Standard JPackage naming and versioning defines
660215
%global origin          openjdk
660215
%global origin_nice     OpenJDK
660215
%global top_level_dir_name   %{origin}
be8a6c
%global top_level_dir_name_backup %{top_level_dir_name}-backup
89362c
%global buildver        8
89362c
%global rpmrelease      2
e42bf6
#%%global tagsuffix     %%{nil}
be8a6c
# 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
660215
%if %is_system_jdk
be8a6c
# Using 10 digits may overflow the int used for priority, so we combine the patch and build versions
be8a6c
# It is very unlikely we will ever have a patch version > 4 or a build version > 20, so we combine as (patch * 20) + build.
be8a6c
# This means 11.0.9.0+11 would have had a priority of 11000911 as before
be8a6c
# 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
be8a6c
%global combiver $( expr 20 '*' %{patchver} + %{buildver} )
be8a6c
%global priority %( printf '%02d%02d%02d%02d' %{featurever} %{interimver} %{updatever} %{combiver} )
660215
%else
660215
# for techpreview, using 1, so slowdebugs can have 0
660215
%global priority %( printf '%08d' 1 )
660215
%endif
9d7641
%global newjavaver %{featurever}.%{interimver}.%{updatever}.%{patchver}
be8a6c
89362c
# Strip up to 6 trailing zeros in newjavaver, as the JDK does, to get the correct version used in filenames
89362c
%global filever %(svn=%{newjavaver}; for i in 1 2 3 4 5 6 ; do svn=${svn%%.0} ; done; echo ${svn})
89362c
89362c
# The tag used to create the OpenJDK tarball
89362c
%global vcstag jdk-%{filever}+%{buildver}%{?tagsuffix:-%{tagsuffix}}
660215
be8a6c
%global javaver         %{featurever}
660215
9d60fa
# Define milestone (EA for pre-releases, GA for releases)
9d60fa
# Release will be (where N is usually a number starting at 1):
9d60fa
# - 0.N%%{?extraver}%%{?dist} for EA releases,
9d60fa
# - N%%{?extraver}{?dist} for GA releases
0f3be5
%global is_ga           1
9d60fa
%if %{is_ga}
9d60fa
%global ea_designator ""
9d60fa
%global ea_designator_zip ""
9d60fa
%global extraver %{nil}
9d60fa
%global eaprefix %{nil}
9d60fa
%else
9d60fa
%global ea_designator ea
9d60fa
%global ea_designator_zip -%{ea_designator}
9d60fa
%global extraver .%{ea_designator}
9d60fa
%global eaprefix 0.
9d60fa
%endif
9d60fa
660215
# parametrized macros are order-sensitive
be8a6c
%global compatiblename  java-%{featurever}-%{origin}
660215
%global fullversion     %{compatiblename}-%{version}-%{release}
e42bf6
# images directories from upstream build
e42bf6
%global jdkimage                jdk
e42bf6
%global static_libs_image       static-libs
660215
# output dir stub
9d7641
%define buildoutputdir() %{expand:build/jdk%{featurever}.build%{?1}}
9d7641
%define installoutputdir() %{expand:install/jdk%{featurever}.install%{?1}}
660215
# we can copy the javadoc to not arched dir, or make it not noarch
660215
%define uniquejavadocdir()    %{expand:%{fullversion}.%{_arch}%{?1}}
660215
# main id and dir of this jdk
660215
%define uniquesuffix()        %{expand:%{fullversion}.%{_arch}%{?1}}
660215
660215
#################################################################
660215
# fix for https://bugzilla.redhat.com/show_bug.cgi?id=1111349
660215
#         https://bugzilla.redhat.com/show_bug.cgi?id=1590796#c14
660215
#         https://bugzilla.redhat.com/show_bug.cgi?id=1655938
be8a6c
%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.*|libsunec[.]so.*|libsystemconf[.]so.*|libunpack[.]so.*|libzip[.]so.*
660215
%global _publiclibs libjawt[.]so.*|libjava[.]so.*|libjvm[.]so.*|libverify[.]so.*|libjsig[.]so.*
660215
%if %is_system_jdk
660215
%global __provides_exclude ^(%{_privatelibs})$
660215
%global __requires_exclude ^(%{_privatelibs})$
9d7641
# Never generate lib-style provides/requires for any debug packages
660215
%global __provides_exclude_from ^.*/%{uniquesuffix -- %{debug_suffix_unquoted}}/.*$
660215
%global __requires_exclude_from ^.*/%{uniquesuffix -- %{debug_suffix_unquoted}}/.*$
be8a6c
%global __provides_exclude_from ^.*/%{uniquesuffix -- %{fastdebug_suffix_unquoted}}/.*$
be8a6c
%global __requires_exclude_from ^.*/%{uniquesuffix -- %{fastdebug_suffix_unquoted}}/.*$
660215
%else
660215
# Don't generate provides/requires for JDK provided shared libraries at all.
660215
%global __provides_exclude ^(%{_privatelibs}|%{_publiclibs})$
660215
%global __requires_exclude ^(%{_privatelibs}|%{_publiclibs})$
660215
%endif
660215
660215
660215
%global etcjavasubdir     %{_sysconfdir}/java/java-%{javaver}-%{origin}
660215
%define etcjavadir()      %{expand:%{etcjavasubdir}/%{uniquesuffix -- %{?1}}}
660215
# Standard JPackage directories and symbolic links.
660215
%define sdkdir()        %{expand:%{uniquesuffix -- %{?1}}}
660215
%define jrelnk()        %{expand:jre-%{javaver}-%{origin}-%{version}-%{release}.%{_arch}%{?1}}
660215
660215
%define sdkbindir()     %{expand:%{_jvmdir}/%{sdkdir -- %{?1}}/bin}
660215
%define jrebindir()     %{expand:%{_jvmdir}/%{sdkdir -- %{?1}}/bin}
660215
0f3be5
%global alt_java_name     alt-java
0f3be5
660215
%global rpm_state_dir %{_localstatedir}/lib/rpm-state/
660215
be8a6c
# For flatpack builds hard-code /usr/sbin/alternatives,
be8a6c
# otherwise use %%{_sbindir} relative path.
be8a6c
%if 0%{?flatpak}
be8a6c
%global alternatives_requires /usr/sbin/alternatives
be8a6c
%else
be8a6c
%global alternatives_requires %{_sbindir}/alternatives
be8a6c
%endif
be8a6c
89362c
%global family %{name}.%{_arch}
89362c
%global family_noarch  %{name}
89362c
660215
%if %{with_systemtap}
660215
# Where to install systemtap tapset (links)
660215
# We would like these to be in a package specific sub-dir,
660215
# but currently systemtap doesn't support that, so we have to
660215
# use the root tapset dir for now. To distinguish between 64
660215
# and 32 bit architectures we place the tapsets under the arch
660215
# specific dir (note that systemtap will only pickup the tapset
660215
# for the primary arch for now). Systemtap uses the machine name
e42bf6
# aka target_cpu as architecture specific directory name.
660215
%global tapsetroot /usr/share/systemtap
660215
%global tapsetdirttapset %{tapsetroot}/tapset/
e42bf6
%global tapsetdir %{tapsetdirttapset}/%{stapinstall}
660215
%endif
660215
660215
# not-duplicated scriptlets for normal/debug packages
660215
%global update_desktop_icons /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
660215
89362c
%define save_alternatives() %{expand:
89362c
  # warning! alternatives are localised!
89362c
  # LANG=cs_CZ.UTF-8  alternatives --display java | head
89362c
  # LANG=en_US.UTF-8  alternatives --display java | head
89362c
  function nonLocalisedAlternativesDisplayOfMaster() {
89362c
    LANG=en_US.UTF-8 alternatives --display "$MASTER"
89362c
  }
89362c
  function headOfAbove() {
89362c
    nonLocalisedAlternativesDisplayOfMaster | head -n $1
89362c
  }
89362c
  MASTER="%{?1}"
89362c
  LOCAL_LINK="%{?2}"
89362c
  FAMILY="%{?3}"
89362c
  rm -f %{_localstatedir}/lib/rpm-state/"$MASTER"_$FAMILY > /dev/null
89362c
  if nonLocalisedAlternativesDisplayOfMaster > /dev/null ; then
89362c
      if headOfAbove 1 | grep -q manual ; then
89362c
        if headOfAbove 2 | tail -n 1 | grep -q %{compatiblename} ; then
89362c
           headOfAbove 2  > %{_localstatedir}/lib/rpm-state/"$MASTER"_"$FAMILY"
89362c
        fi
89362c
      fi
89362c
  fi
89362c
}
89362c
89362c
%define save_and_remove_alternatives() %{expand:
89362c
  if [ "x$debug"  == "xtrue" ] ; then
89362c
    set -x
89362c
  fi
89362c
  upgrade1_uninstal0=%{?3}
89362c
  if [ "0$upgrade1_uninstal0" -gt 0 ] ; then # removal of this condition will cause persistence between uninstall
89362c
    %{save_alternatives %{?1} %{?2} %{?4}}
89362c
  fi
89362c
  alternatives --remove  "%{?1}" "%{?2}"
89362c
}
89362c
89362c
%define set_if_needed_alternatives() %{expand:
89362c
  MASTER="%{?1}"
89362c
  FAMILY="%{?2}"
89362c
  ALTERNATIVES_FILE="%{_localstatedir}/lib/rpm-state/$MASTER"_"$FAMILY"
89362c
  if [ -e  "$ALTERNATIVES_FILE" ] ; then
89362c
    rm "$ALTERNATIVES_FILE"
89362c
    alternatives --set $MASTER $FAMILY
89362c
  fi
89362c
}
89362c
660215
660215
%define post_script() %{expand:
660215
update-desktop-database %{_datadir}/applications &> /dev/null || :
660215
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
660215
exit 0
660215
}
660215
89362c
%define alternatives_java_install() %{expand:
89362c
if [ "x$debug"  == "xtrue" ] ; then
89362c
  set -x
89362c
fi
660215
PRIORITY=%{priority}
660215
if [ "%{?1}" == %{debug_suffix} ]; then
660215
  let PRIORITY=PRIORITY-1
660215
fi
660215
660215
ext=.gz
89362c
key=java
660215
alternatives \\
89362c
  --install %{_bindir}/java $key %{jrebindir -- %{?1}}/java $PRIORITY  --family %{family} \\
660215
  --slave %{_jvmdir}/jre jre %{_jvmdir}/%{sdkdir -- %{?1}} \\
0f3be5
  --slave %{_bindir}/%{alt_java_name} %{alt_java_name} %{jrebindir -- %{?1}}/%{alt_java_name} \\
660215
  --slave %{_bindir}/jjs jjs %{jrebindir -- %{?1}}/jjs \\
660215
  --slave %{_bindir}/keytool keytool %{jrebindir -- %{?1}}/keytool \\
660215
  --slave %{_bindir}/pack200 pack200 %{jrebindir -- %{?1}}/pack200 \\
660215
  --slave %{_bindir}/rmid rmid %{jrebindir -- %{?1}}/rmid \\
660215
  --slave %{_bindir}/rmiregistry rmiregistry %{jrebindir -- %{?1}}/rmiregistry \\
660215
  --slave %{_bindir}/unpack200 unpack200 %{jrebindir -- %{?1}}/unpack200 \\
660215
  --slave %{_mandir}/man1/java.1$ext java.1$ext \\
660215
  %{_mandir}/man1/java-%{uniquesuffix -- %{?1}}.1$ext \\
0f3be5
  --slave %{_mandir}/man1/%{alt_java_name}.1$ext %{alt_java_name}.1$ext \\
0f3be5
  %{_mandir}/man1/%{alt_java_name}-%{uniquesuffix -- %{?1}}.1$ext \\
660215
  --slave %{_mandir}/man1/jjs.1$ext jjs.1$ext \\
660215
  %{_mandir}/man1/jjs-%{uniquesuffix -- %{?1}}.1$ext \\
660215
  --slave %{_mandir}/man1/keytool.1$ext keytool.1$ext \\
660215
  %{_mandir}/man1/keytool-%{uniquesuffix -- %{?1}}.1$ext \\
660215
  --slave %{_mandir}/man1/pack200.1$ext pack200.1$ext \\
660215
  %{_mandir}/man1/pack200-%{uniquesuffix -- %{?1}}.1$ext \\
660215
  --slave %{_mandir}/man1/rmid.1$ext rmid.1$ext \\
660215
  %{_mandir}/man1/rmid-%{uniquesuffix -- %{?1}}.1$ext \\
660215
  --slave %{_mandir}/man1/rmiregistry.1$ext rmiregistry.1$ext \\
660215
  %{_mandir}/man1/rmiregistry-%{uniquesuffix -- %{?1}}.1$ext \\
660215
  --slave %{_mandir}/man1/unpack200.1$ext unpack200.1$ext \\
660215
  %{_mandir}/man1/unpack200-%{uniquesuffix -- %{?1}}.1$ext
660215
89362c
%{set_if_needed_alternatives $key %{family}}
89362c
660215
for X in %{origin} %{javaver} ; do
89362c
  key=jre_"$X"
89362c
  alternatives --install %{_jvmdir}/jre-"$X" $key %{_jvmdir}/%{sdkdir -- %{?1}} $PRIORITY --family %{family}
89362c
  %{set_if_needed_alternatives $key %{family}}
660215
done
660215
89362c
key=jre_%{javaver}_%{origin}
89362c
alternatives --install %{_jvmdir}/jre-%{javaver}-%{origin} $key %{_jvmdir}/%{jrelnk -- %{?1}} $PRIORITY  --family %{family}
89362c
%{set_if_needed_alternatives $key %{family}}
89362c
}
660215
89362c
%define post_headless() %{expand:
89362c
%ifarch %{share_arches}
89362c
%{jrebindir -- %{?1}}/java -Xshare:dump >/dev/null 2>/dev/null
89362c
%endif
660215
660215
update-desktop-database %{_datadir}/applications &> /dev/null || :
660215
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
660215
660215
# see pretrans where this file is declared
660215
# also see that pretrans is only for non-debug
660215
if [ ! "%{?1}" == %{debug_suffix} ]; then
660215
  if [ -f %{_libexecdir}/copy_jdk_configs_fixFiles.sh ] ; then
660215
    sh  %{_libexecdir}/copy_jdk_configs_fixFiles.sh %{rpm_state_dir}/%{name}.%{_arch}  %{_jvmdir}/%{sdkdir -- %{?1}}
660215
  fi
660215
fi
660215
660215
exit 0
660215
}
660215
660215
%define postun_script() %{expand:
660215
update-desktop-database %{_datadir}/applications &> /dev/null || :
660215
if [ $1 -eq 0 ] ; then
660215
    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
660215
    %{update_desktop_icons}
660215
fi
660215
exit 0
660215
}
660215
660215
660215
%define postun_headless() %{expand:
89362c
  if [ "x$debug"  == "xtrue" ] ; then
89362c
    set -x
89362c
  fi
89362c
  post_state=$1 # from postun, https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_syntax
89362c
  %{save_and_remove_alternatives  java  %{jrebindir -- %{?1}}/java $post_state %{family}}
89362c
  %{save_and_remove_alternatives  jre_%{origin} %{_jvmdir}/%{sdkdir -- %{?1}} $post_state %{family}}
89362c
  %{save_and_remove_alternatives  jre_%{javaver} %{_jvmdir}/%{sdkdir -- %{?1}} $post_state %{family}}
89362c
  %{save_and_remove_alternatives  jre_%{javaver}_%{origin} %{_jvmdir}/%{jrelnk -- %{?1}} $post_state %{family}}
660215
}
660215
660215
%define posttrans_script() %{expand:
660215
%{update_desktop_icons}
660215
}
660215
660215
89362c
%define alternatives_javac_install() %{expand:
89362c
if [ "x$debug"  == "xtrue" ] ; then
89362c
  set -x
89362c
fi
660215
PRIORITY=%{priority}
660215
if [ "%{?1}" == %{debug_suffix} ]; then
660215
  let PRIORITY=PRIORITY-1
660215
fi
660215
660215
ext=.gz
89362c
key=javac
660215
alternatives \\
89362c
  --install %{_bindir}/javac $key %{sdkbindir -- %{?1}}/javac $PRIORITY  --family %{family} \\
660215
  --slave %{_jvmdir}/java java_sdk %{_jvmdir}/%{sdkdir -- %{?1}} \\
660215
%ifarch %{aot_arches}
660215
  --slave %{_bindir}/jaotc jaotc %{sdkbindir -- %{?1}}/jaotc \\
660215
%endif
660215
  --slave %{_bindir}/jlink jlink %{sdkbindir -- %{?1}}/jlink \\
660215
  --slave %{_bindir}/jmod jmod %{sdkbindir -- %{?1}}/jmod \\
0f3be5
%ifarch %{sa_arches}
9d7641
%ifnarch %{zero_arches}
660215
  --slave %{_bindir}/jhsdb jhsdb %{sdkbindir -- %{?1}}/jhsdb \\
660215
%endif
9d7641
%endif
660215
  --slave %{_bindir}/jar jar %{sdkbindir -- %{?1}}/jar \\
660215
  --slave %{_bindir}/jarsigner jarsigner %{sdkbindir -- %{?1}}/jarsigner \\
660215
  --slave %{_bindir}/javadoc javadoc %{sdkbindir -- %{?1}}/javadoc \\
660215
  --slave %{_bindir}/javap javap %{sdkbindir -- %{?1}}/javap \\
660215
  --slave %{_bindir}/jcmd jcmd %{sdkbindir -- %{?1}}/jcmd \\
660215
  --slave %{_bindir}/jconsole jconsole %{sdkbindir -- %{?1}}/jconsole \\
660215
  --slave %{_bindir}/jdb jdb %{sdkbindir -- %{?1}}/jdb \\
660215
  --slave %{_bindir}/jdeps jdeps %{sdkbindir -- %{?1}}/jdeps \\
660215
  --slave %{_bindir}/jdeprscan jdeprscan %{sdkbindir -- %{?1}}/jdeprscan \\
e42bf6
  --slave %{_bindir}/jfr jfr %{sdkbindir -- %{?1}}/jfr \\
660215
  --slave %{_bindir}/jimage jimage %{sdkbindir -- %{?1}}/jimage \\
660215
  --slave %{_bindir}/jinfo jinfo %{sdkbindir -- %{?1}}/jinfo \\
660215
  --slave %{_bindir}/jmap jmap %{sdkbindir -- %{?1}}/jmap \\
660215
  --slave %{_bindir}/jps jps %{sdkbindir -- %{?1}}/jps \\
660215
  --slave %{_bindir}/jrunscript jrunscript %{sdkbindir -- %{?1}}/jrunscript \\
660215
  --slave %{_bindir}/jshell jshell %{sdkbindir -- %{?1}}/jshell \\
660215
  --slave %{_bindir}/jstack jstack %{sdkbindir -- %{?1}}/jstack \\
660215
  --slave %{_bindir}/jstat jstat %{sdkbindir -- %{?1}}/jstat \\
660215
  --slave %{_bindir}/jstatd jstatd %{sdkbindir -- %{?1}}/jstatd \\
660215
  --slave %{_bindir}/rmic rmic %{sdkbindir -- %{?1}}/rmic \\
660215
  --slave %{_bindir}/serialver serialver %{sdkbindir -- %{?1}}/serialver \\
660215
  --slave %{_mandir}/man1/jar.1$ext jar.1$ext \\
660215
  %{_mandir}/man1/jar-%{uniquesuffix -- %{?1}}.1$ext \\
660215
  --slave %{_mandir}/man1/jarsigner.1$ext jarsigner.1$ext \\
660215
  %{_mandir}/man1/jarsigner-%{uniquesuffix -- %{?1}}.1$ext \\
660215
  --slave %{_mandir}/man1/javac.1$ext javac.1$ext \\
660215
  %{_mandir}/man1/javac-%{uniquesuffix -- %{?1}}.1$ext \\
660215
  --slave %{_mandir}/man1/javadoc.1$ext javadoc.1$ext \\
660215
  %{_mandir}/man1/javadoc-%{uniquesuffix -- %{?1}}.1$ext \\
660215
  --slave %{_mandir}/man1/javap.1$ext javap.1$ext \\
660215
  %{_mandir}/man1/javap-%{uniquesuffix -- %{?1}}.1$ext \\
660215
  --slave %{_mandir}/man1/jcmd.1$ext jcmd.1$ext \\
660215
  %{_mandir}/man1/jcmd-%{uniquesuffix -- %{?1}}.1$ext \\
660215
  --slave %{_mandir}/man1/jconsole.1$ext jconsole.1$ext \\
660215
  %{_mandir}/man1/jconsole-%{uniquesuffix -- %{?1}}.1$ext \\
660215
  --slave %{_mandir}/man1/jdb.1$ext jdb.1$ext \\
660215
  %{_mandir}/man1/jdb-%{uniquesuffix -- %{?1}}.1$ext \\
660215
  --slave %{_mandir}/man1/jdeps.1$ext jdeps.1$ext \\
660215
  %{_mandir}/man1/jdeps-%{uniquesuffix -- %{?1}}.1$ext \\
660215
  --slave %{_mandir}/man1/jinfo.1$ext jinfo.1$ext \\
660215
  %{_mandir}/man1/jinfo-%{uniquesuffix -- %{?1}}.1$ext \\
660215
  --slave %{_mandir}/man1/jmap.1$ext jmap.1$ext \\
660215
  %{_mandir}/man1/jmap-%{uniquesuffix -- %{?1}}.1$ext \\
660215
  --slave %{_mandir}/man1/jps.1$ext jps.1$ext \\
660215
  %{_mandir}/man1/jps-%{uniquesuffix -- %{?1}}.1$ext \\
660215
  --slave %{_mandir}/man1/jrunscript.1$ext jrunscript.1$ext \\
660215
  %{_mandir}/man1/jrunscript-%{uniquesuffix -- %{?1}}.1$ext \\
660215
  --slave %{_mandir}/man1/jstack.1$ext jstack.1$ext \\
660215
  %{_mandir}/man1/jstack-%{uniquesuffix -- %{?1}}.1$ext \\
660215
  --slave %{_mandir}/man1/jstat.1$ext jstat.1$ext \\
660215
  %{_mandir}/man1/jstat-%{uniquesuffix -- %{?1}}.1$ext \\
660215
  --slave %{_mandir}/man1/jstatd.1$ext jstatd.1$ext \\
660215
  %{_mandir}/man1/jstatd-%{uniquesuffix -- %{?1}}.1$ext \\
660215
  --slave %{_mandir}/man1/rmic.1$ext rmic.1$ext \\
660215
  %{_mandir}/man1/rmic-%{uniquesuffix -- %{?1}}.1$ext \\
660215
  --slave %{_mandir}/man1/serialver.1$ext serialver.1$ext \\
89362c
  %{_mandir}/man1/serialver-%{uniquesuffix -- %{?1}}.1$ext
89362c
89362c
%{set_if_needed_alternatives  $key %{family}}
660215
660215
for X in %{origin} %{javaver} ; do
89362c
  key=java_sdk_"$X"
89362c
  alternatives --install %{_jvmdir}/java-"$X" $key %{_jvmdir}/%{sdkdir -- %{?1}} $PRIORITY  --family %{family}
89362c
  %{set_if_needed_alternatives  $key %{family}}
660215
done
660215
89362c
key=java_sdk_%{javaver}_%{origin}
89362c
alternatives --install %{_jvmdir}/java-%{javaver}-%{origin} $key %{_jvmdir}/%{sdkdir -- %{?1}} $PRIORITY  --family %{family}
89362c
%{set_if_needed_alternatives  $key %{family}}
89362c
}
660215
89362c
%define post_devel() %{expand:
660215
update-desktop-database %{_datadir}/applications &> /dev/null || :
660215
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
660215
660215
exit 0
660215
}
660215
660215
%define postun_devel() %{expand:
89362c
  if [ "x$debug"  == "xtrue" ] ; then
89362c
    set -x
89362c
  fi
89362c
  post_state=$1 # from postun, https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_syntax
89362c
  %{save_and_remove_alternatives  javac %{sdkbindir -- %{?1}}/javac $post_state %{family}}
89362c
  %{save_and_remove_alternatives  java_sdk_%{origin} %{_jvmdir}/%{sdkdir -- %{?1}} $post_state %{family}}
89362c
  %{save_and_remove_alternatives  java_sdk_%{javaver} %{_jvmdir}/%{sdkdir -- %{?1}} $post_state %{family}}
89362c
  %{save_and_remove_alternatives  java_sdk_%{javaver}_%{origin} %{_jvmdir}/%{sdkdir -- %{?1}} $post_state %{family}}
660215
660215
update-desktop-database %{_datadir}/applications &> /dev/null || :
660215
660215
if [ $1 -eq 0 ] ; then
660215
    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
660215
    %{update_desktop_icons}
660215
fi
660215
exit 0
660215
}
660215
660215
%define posttrans_devel() %{expand:
89362c
%{alternatives_javac_install --  %{?1}}
660215
%{update_desktop_icons}
660215
}
660215
89362c
%define alternatives_javadoc_install() %{expand:
89362c
if [ "x$debug"  == "xtrue" ] ; then
89362c
  set -x
89362c
fi
660215
PRIORITY=%{priority}
660215
if [ "%{?1}" == %{debug_suffix} ]; then
660215
  let PRIORITY=PRIORITY-1
660215
fi
660215
89362c
key=javadocdir
89362c
alternatives --install %{_javadocdir}/java $key %{_javadocdir}/%{uniquejavadocdir -- %{?1}}/api $PRIORITY  --family %{family_noarch}
89362c
%{set_if_needed_alternatives  $key %{family_noarch}}
660215
exit 0
660215
}
660215
660215
%define postun_javadoc() %{expand:
89362c
if [ "x$debug"  == "xtrue" ] ; then
89362c
  set -x
89362c
fi
89362c
  post_state=$1 # from postun, https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_syntax
89362c
  %{save_and_remove_alternatives  javadocdir  %{_javadocdir}/%{uniquejavadocdir -- %{?1}}/api $post_state %{family_noarch}}
660215
exit 0
660215
}
660215
89362c
%define alternatives_javadoczip_install() %{expand:
89362c
if [ "x$debug"  == "xtrue" ] ; then
89362c
  set -x
89362c
fi
660215
PRIORITY=%{priority}
660215
if [ "%{?1}" == %{debug_suffix} ]; then
660215
  let PRIORITY=PRIORITY-1
660215
fi
89362c
key=javadoczip
89362c
alternatives --install %{_javadocdir}/java-zip $key %{_javadocdir}/%{uniquejavadocdir -- %{?1}}.zip $PRIORITY  --family %{family_noarch}
89362c
%{set_if_needed_alternatives  $key %{family_noarch}}
660215
exit 0
660215
}
660215
660215
%define postun_javadoc_zip() %{expand:
89362c
  if [ "x$debug"  == "xtrue" ] ; then
89362c
    set -x
89362c
  fi
89362c
  post_state=$1 # from postun, https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_syntax
89362c
  %{save_and_remove_alternatives  javadoczip  %{_javadocdir}/%{uniquejavadocdir -- %{?1}}.zip $post_state %{family_noarch}}
660215
exit 0
660215
}
660215
660215
%define files_jre() %{expand:
660215
%{_datadir}/icons/hicolor/*x*/apps/java-%{javaver}-%{origin}.png
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libsplashscreen.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libawt_xawt.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjawt.so
660215
}
660215
660215
660215
%define files_jre_headless() %{expand:
660215
%license %{_jvmdir}/%{sdkdir -- %{?1}}/legal
e42bf6
%doc %{_defaultdocdir}/%{uniquejavadocdir -- %{?1}}/NEWS
660215
%dir %{_sysconfdir}/.java/.systemPrefs
660215
%dir %{_sysconfdir}/.java
660215
%dir %{_jvmdir}/%{sdkdir -- %{?1}}
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/release
660215
%{_jvmdir}/%{jrelnk -- %{?1}}
660215
%dir %{_jvmdir}/%{sdkdir -- %{?1}}/bin
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/java
0f3be5
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/%{alt_java_name}
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jjs
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/keytool
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/pack200
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/rmid
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/rmiregistry
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/unpack200
660215
%dir %{_jvmdir}/%{sdkdir -- %{?1}}/lib
660215
%ifarch %{jit_arches}
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/classlist
660215
%endif
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/jexec
9d60fa
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/jspawnhelper
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/jrt-fs.jar
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/modules
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/psfont.properties.ja
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/psfontj2d.properties
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/tzdb.dat
660215
%dir %{_jvmdir}/%{sdkdir -- %{?1}}/lib/jli
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/jli/libjli.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/jvm.cfg
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libattach.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libawt.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libextnet.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjsig.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libawt_headless.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libdt_socket.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libfontmanager.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libinstrument.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libj2gss.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libj2pcsc.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libj2pkcs11.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjaas.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjava.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjavajpeg.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjdwp.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjimage.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjsound.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/liblcms.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libmanagement.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libmanagement_agent.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libmanagement_ext.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libmlib_image.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libnet.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libnio.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libprefs.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/librmi.so
0f3be5
# Some architectures don't have the serviceability agent
0f3be5
%ifarch %{sa_arches}
9d7641
%ifnarch %{zero_arches}
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libsaproc.so
660215
%endif
9d7641
%endif
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libsctp.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libsunec.so
be8a6c
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libsystemconf.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libunpack.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libverify.so
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libzip.so
660215
%dir %{_jvmdir}/%{sdkdir -- %{?1}}/lib/jfr
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/jfr/default.jfc
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/jfr/profile.jfc
660215
%{_mandir}/man1/java-%{uniquesuffix -- %{?1}}.1*
0f3be5
%{_mandir}/man1/%{alt_java_name}-%{uniquesuffix -- %{?1}}.1*
660215
%{_mandir}/man1/jjs-%{uniquesuffix -- %{?1}}.1*
660215
%{_mandir}/man1/keytool-%{uniquesuffix -- %{?1}}.1*
660215
%{_mandir}/man1/pack200-%{uniquesuffix -- %{?1}}.1*
660215
%{_mandir}/man1/rmid-%{uniquesuffix -- %{?1}}.1*
660215
%{_mandir}/man1/rmiregistry-%{uniquesuffix -- %{?1}}.1*
660215
%{_mandir}/man1/unpack200-%{uniquesuffix -- %{?1}}.1*
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/server/
0f3be5
%ifarch %{share_arches}
660215
%attr(444, root, root) %ghost %{_jvmdir}/%{sdkdir -- %{?1}}/lib/server/classes.jsa
660215
%endif
660215
%dir %{etcjavasubdir}
660215
%dir %{etcjavadir -- %{?1}}
660215
%dir %{etcjavadir -- %{?1}}/lib
660215
%dir %{etcjavadir -- %{?1}}/lib/security
660215
%{etcjavadir -- %{?1}}/lib/security/cacerts
660215
%dir %{etcjavadir -- %{?1}}/conf
660215
%dir %{etcjavadir -- %{?1}}/conf/management
660215
%dir %{etcjavadir -- %{?1}}/conf/security
660215
%dir %{etcjavadir -- %{?1}}/conf/security/policy
660215
%dir %{etcjavadir -- %{?1}}/conf/security/policy/limited
660215
%dir %{etcjavadir -- %{?1}}/conf/security/policy/unlimited
660215
%config(noreplace) %{etcjavadir -- %{?1}}/lib/security/default.policy
9d7641
%config(noreplace) %{etcjavadir -- %{?1}}/lib/security/blocked.certs
660215
%config(noreplace) %{etcjavadir -- %{?1}}/lib/security/public_suffix_list.dat
660215
%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/policy/limited/exempt_local.policy
660215
%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/policy/limited/default_local.policy
660215
%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/policy/limited/default_US_export.policy
660215
%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/policy/unlimited/default_local.policy
660215
%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/policy/unlimited/default_US_export.policy
660215
 %{etcjavadir -- %{?1}}/conf/security/policy/README.txt
660215
%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/java.policy
660215
%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/java.security
660215
%config(noreplace) %{etcjavadir -- %{?1}}/conf/logging.properties
660215
%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/nss.cfg
9d60fa
%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/nss.fips.cfg
660215
%config(noreplace) %{etcjavadir -- %{?1}}/conf/management/jmxremote.access
660215
# this is conifg template, thus not config-noreplace
660215
%config  %{etcjavadir -- %{?1}}/conf/management/jmxremote.password.template
660215
%config(noreplace) %{etcjavadir -- %{?1}}/conf/management/management.properties
660215
%config(noreplace) %{etcjavadir -- %{?1}}/conf/net.properties
660215
%config(noreplace) %{etcjavadir -- %{?1}}/conf/sound.properties
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/conf
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/security
660215
%if %is_system_jdk
660215
%if %{is_release_build -- %{?1}}
660215
%ghost %{_bindir}/java
0f3be5
%ghost %{_bindir}/%{alt_java_name}
660215
%ghost %{_jvmdir}/jre
660215
# https://bugzilla.redhat.com/show_bug.cgi?id=1312019
660215
%ghost %{_bindir}/jjs
660215
%ghost %{_bindir}/keytool
660215
%ghost %{_bindir}/pack200
660215
%ghost %{_bindir}/rmid
660215
%ghost %{_bindir}/rmiregistry
660215
%ghost %{_bindir}/unpack200
660215
%ghost %{_jvmdir}/jre-%{origin}
660215
%ghost %{_jvmdir}/jre-%{javaver}
660215
%ghost %{_jvmdir}/jre-%{javaver}-%{origin}
660215
%endif
660215
%endif
0f3be5
# https://bugzilla.redhat.com/show_bug.cgi?id=1820172
0f3be5
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Directory_Replacement/
0f3be5
%ghost %{_jvmdir}/%{sdkdir -- %{?1}}/conf.rpmmoved
0f3be5
%ghost %{_jvmdir}/%{sdkdir -- %{?1}}/lib/security.rpmmoved
660215
}
660215
660215
%define files_devel() %{expand:
660215
%dir %{_jvmdir}/%{sdkdir -- %{?1}}/bin
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jar
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jarsigner
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/javac
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/javadoc
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/javap
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jconsole
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jcmd
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jdb
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jdeps
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jdeprscan
e42bf6
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jfr
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jimage
0f3be5
# Some architectures don't have the serviceability agent
0f3be5
%ifarch %{sa_arches}
9d7641
%ifnarch %{zero_arches}
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jhsdb
660215
%endif
9d7641
%endif
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jinfo
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jlink
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jmap
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jmod
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jps
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jrunscript
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jshell
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jstack
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jstat
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jstatd
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/rmic
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/serialver
660215
%ifarch %{aot_arches}
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jaotc
660215
%endif
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/include
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/ct.sym
660215
%if %{with_systemtap}
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/tapset
660215
%endif
660215
%{_datadir}/applications/*jconsole%{?1}.desktop
660215
%{_mandir}/man1/jar-%{uniquesuffix -- %{?1}}.1*
660215
%{_mandir}/man1/jarsigner-%{uniquesuffix -- %{?1}}.1*
660215
%{_mandir}/man1/javac-%{uniquesuffix -- %{?1}}.1*
660215
%{_mandir}/man1/javadoc-%{uniquesuffix -- %{?1}}.1*
660215
%{_mandir}/man1/javap-%{uniquesuffix -- %{?1}}.1*
660215
%{_mandir}/man1/jconsole-%{uniquesuffix -- %{?1}}.1*
660215
%{_mandir}/man1/jcmd-%{uniquesuffix -- %{?1}}.1*
660215
%{_mandir}/man1/jdb-%{uniquesuffix -- %{?1}}.1*
660215
%{_mandir}/man1/jdeps-%{uniquesuffix -- %{?1}}.1*
660215
%{_mandir}/man1/jinfo-%{uniquesuffix -- %{?1}}.1*
660215
%{_mandir}/man1/jmap-%{uniquesuffix -- %{?1}}.1*
660215
%{_mandir}/man1/jps-%{uniquesuffix -- %{?1}}.1*
660215
%{_mandir}/man1/jrunscript-%{uniquesuffix -- %{?1}}.1*
660215
%{_mandir}/man1/jstack-%{uniquesuffix -- %{?1}}.1*
660215
%{_mandir}/man1/jstat-%{uniquesuffix -- %{?1}}.1*
660215
%{_mandir}/man1/jstatd-%{uniquesuffix -- %{?1}}.1*
660215
%{_mandir}/man1/rmic-%{uniquesuffix -- %{?1}}.1*
660215
%{_mandir}/man1/serialver-%{uniquesuffix -- %{?1}}.1*
660215
%if %{with_systemtap}
660215
%dir %{tapsetroot}
660215
%dir %{tapsetdirttapset}
660215
%dir %{tapsetdir}
660215
%{tapsetdir}/*%{_arch}%{?1}.stp
660215
%endif
660215
%if %is_system_jdk
660215
%if %{is_release_build -- %{?1}}
660215
%ghost %{_bindir}/javac
660215
%ghost %{_jvmdir}/java
0f3be5
%ghost %{_jvmdir}/%{alt_java_name}
660215
%ghost %{_bindir}/jaotc
660215
%ghost %{_bindir}/jlink
660215
%ghost %{_bindir}/jmod
660215
%ghost %{_bindir}/jhsdb
660215
%ghost %{_bindir}/jar
660215
%ghost %{_bindir}/jarsigner
660215
%ghost %{_bindir}/javadoc
660215
%ghost %{_bindir}/javap
660215
%ghost %{_bindir}/jcmd
660215
%ghost %{_bindir}/jconsole
660215
%ghost %{_bindir}/jdb
660215
%ghost %{_bindir}/jdeps
660215
%ghost %{_bindir}/jdeprscan
660215
%ghost %{_bindir}/jimage
660215
%ghost %{_bindir}/jinfo
660215
%ghost %{_bindir}/jmap
660215
%ghost %{_bindir}/jps
660215
%ghost %{_bindir}/jrunscript
660215
%ghost %{_bindir}/jshell
660215
%ghost %{_bindir}/jstack
660215
%ghost %{_bindir}/jstat
660215
%ghost %{_bindir}/jstatd
660215
%ghost %{_bindir}/rmic
660215
%ghost %{_bindir}/serialver
660215
%ghost %{_jvmdir}/java-%{origin}
660215
%ghost %{_jvmdir}/java-%{javaver}
660215
%ghost %{_jvmdir}/java-%{javaver}-%{origin}
660215
%endif
660215
%endif
660215
}
660215
660215
%define files_jmods() %{expand:
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/jmods
660215
}
660215
660215
%define files_demo() %{expand:
660215
%license %{_jvmdir}/%{sdkdir -- %{?1}}/legal
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/demo
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/sample
660215
}
660215
660215
%define files_src() %{expand:
660215
%license %{_jvmdir}/%{sdkdir -- %{?1}}/legal
660215
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/src.zip
660215
}
660215
e42bf6
%define files_static_libs() %{expand:
0f3be5
%dir %{_jvmdir}/%{sdkdir -- %{?1}}/lib/static
0f3be5
%dir %{_jvmdir}/%{sdkdir -- %{?1}}/lib/static/linux-%{archinstall}
0f3be5
%dir %{_jvmdir}/%{sdkdir -- %{?1}}/lib/static/linux-%{archinstall}/glibc
0f3be5
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/static/linux-%{archinstall}/glibc/lib*.a
e42bf6
}
e42bf6
660215
%define files_javadoc() %{expand:
660215
%doc %{_javadocdir}/%{uniquejavadocdir -- %{?1}}
0f3be5
%license %{_jvmdir}/%{sdkdir -- %{?1}}/legal
660215
%if %is_system_jdk
660215
%if %{is_release_build -- %{?1}}
660215
%ghost %{_javadocdir}/java
660215
%endif
660215
%endif
660215
}
660215
660215
%define files_javadoc_zip() %{expand:
660215
%doc %{_javadocdir}/%{uniquejavadocdir -- %{?1}}.zip
0f3be5
%license %{_jvmdir}/%{sdkdir -- %{?1}}/legal
660215
%if %is_system_jdk
660215
%if %{is_release_build -- %{?1}}
660215
%ghost %{_javadocdir}/java-zip
660215
%endif
660215
%endif
660215
}
660215
660215
# not-duplicated requires/provides/obsoletes for normal/debug packages
660215
%define java_rpo() %{expand:
660215
Requires: fontconfig%{?_isa}
660215
Requires: xorg-x11-fonts-Type1
660215
# Require libXcomposite explicitly since it's only dynamically loaded
660215
# at runtime. Fixes screenshot issues. See JDK-8150954.
660215
Requires: libXcomposite%{?_isa}
660215
# Requires rest of java
660215
Requires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release}
660215
OrderWithRequires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release}
660215
# for java-X-openjdk package's desktop binding
9d60fa
%if 0%{?rhel} >= 8
660215
Recommends: gtk3%{?_isa}
9d60fa
%endif
660215
660215
Provides: java-%{javaver}-%{origin}%{?1} = %{epoch}:%{version}-%{release}
660215
660215
# Standard JPackage base provides
660215
Provides: jre-%{javaver}%{?1} = %{epoch}:%{version}-%{release}
660215
Provides: jre-%{javaver}-%{origin}%{?1} = %{epoch}:%{version}-%{release}
660215
Provides: java-%{javaver}%{?1} = %{epoch}:%{version}-%{release}
660215
%if %is_system_jdk
660215
Provides: java-%{origin}%{?1} = %{epoch}:%{version}-%{release}
660215
Provides: jre-%{origin}%{?1} = %{epoch}:%{version}-%{release}
660215
Provides: java%{?1} = %{epoch}:%{version}-%{release}
660215
Provides: jre%{?1} = %{epoch}:%{version}-%{release}
660215
%endif
660215
}
660215
660215
%define java_headless_rpo() %{expand:
660215
# Require /etc/pki/java/cacerts
660215
Requires: ca-certificates
660215
# Require javapackages-filesystem for ownership of /usr/lib/jvm/ and macros
660215
Requires: javapackages-filesystem
660215
# Require zone-info data provided by tzdata-java sub-package
89362c
# 2022a required as of JDK-8283350 in 11.0.16
89362c
Requires: tzdata-java >= 2022a
0f3be5
# for support of kernel stream control
660215
# libsctp.so.1 is being `dlopen`ed on demand
660215
Requires: lksctp-tools%{?_isa}
be8a6c
%if ! 0%{?flatpak}
660215
# tool to copy jdk's configs - should be Recommends only, but then only dnf/yum enforce it,
660215
# not rpm transaction and so no configs are persisted when pure rpm -u is run. It may be
660215
# considered as regression
be8a6c
Requires: copy-jdk-configs >= 4.0
660215
OrderWithRequires: copy-jdk-configs
be8a6c
%endif
660215
# for printing support
660215
Requires: cups-libs
89362c
# for system security properties
89362c
Requires: crypto-policies
89362c
# for FIPS PKCS11 provider
89362c
Requires: nss
660215
# Post requires alternatives to install tool alternatives
be8a6c
Requires(post):   %{alternatives_requires}
660215
# Postun requires alternatives to uninstall tool alternatives
be8a6c
Requires(postun): %{alternatives_requires}
660215
# for optional support of kernel stream control, card reader and printing bindings
9d60fa
%if 0%{?rhel} >= 8
660215
Suggests: lksctp-tools%{?_isa}, pcsc-lite-devel%{?_isa}
9d60fa
%endif
660215
660215
# Standard JPackage base provides
660215
Provides: jre-%{javaver}-%{origin}-headless%{?1} = %{epoch}:%{version}-%{release}
660215
Provides: jre-%{javaver}-headless%{?1} = %{epoch}:%{version}-%{release}
660215
Provides: java-%{javaver}-%{origin}-headless%{?1} = %{epoch}:%{version}-%{release}
660215
Provides: java-%{javaver}-headless%{?1} = %{epoch}:%{version}-%{release}
660215
%if %is_system_jdk
660215
Provides: java-%{origin}-headless%{?1} = %{epoch}:%{version}-%{release}
660215
Provides: jre-%{origin}-headless%{?1} = %{epoch}:%{version}-%{release}
660215
Provides: jre-headless%{?1} = %{epoch}:%{version}-%{release}
660215
Provides: java-headless%{?1} = %{epoch}:%{version}-%{release}
660215
%endif
660215
}
660215
660215
%define java_devel_rpo() %{expand:
660215
# Requires base package
660215
Requires:         %{name}%{?1}%{?_isa} = %{epoch}:%{version}-%{release}
660215
OrderWithRequires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release}
660215
# Post requires alternatives to install tool alternatives
be8a6c
Requires(post):   %{alternatives_requires}
660215
# Postun requires alternatives to uninstall tool alternatives
be8a6c
Requires(postun): %{alternatives_requires}
660215
660215
# Standard JPackage devel provides
660215
Provides: java-sdk-%{javaver}-%{origin}%{?1} = %{epoch}:%{version}-%{release}
660215
Provides: java-sdk-%{javaver}%{?1} = %{epoch}:%{version}-%{release}
660215
Provides: java-%{javaver}-devel%{?1} = %{epoch}:%{version}-%{release}
660215
Provides: java-%{javaver}-%{origin}-devel%{?1} = %{epoch}:%{version}-%{release}
660215
%if %is_system_jdk
660215
Provides: java-devel-%{origin}%{?1} = %{epoch}:%{version}-%{release}
660215
Provides: java-sdk-%{origin}%{?1} = %{epoch}:%{version}-%{release}
660215
Provides: java-devel%{?1} = %{epoch}:%{version}-%{release}
660215
Provides: java-sdk%{?1} = %{epoch}:%{version}-%{release}
660215
%endif
660215
}
660215
e42bf6
%define java_static_libs_rpo() %{expand:
e42bf6
Requires:         %{name}-devel%{?1}%{?_isa} = %{epoch}:%{version}-%{release}
e42bf6
OrderWithRequires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release}
e42bf6
}
e42bf6
660215
%define java_jmods_rpo() %{expand:
660215
# Requires devel package
660215
# as jmods are bytecode, they should be OK without any _isa
660215
Requires:         %{name}-devel%{?1} = %{epoch}:%{version}-%{release}
660215
OrderWithRequires: %{name}-headless%{?1} = %{epoch}:%{version}-%{release}
660215
660215
Provides: java-%{javaver}-jmods%{?1} = %{epoch}:%{version}-%{release}
660215
Provides: java-%{javaver}-%{origin}-jmods%{?1} = %{epoch}:%{version}-%{release}
660215
%if %is_system_jdk
660215
Provides: java-jmods%{?1} = %{epoch}:%{version}-%{release}
660215
%endif
660215
}
660215
660215
%define java_demo_rpo() %{expand:
660215
Requires: %{name}%{?1}%{?_isa} = %{epoch}:%{version}-%{release}
660215
OrderWithRequires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release}
660215
660215
Provides: java-%{javaver}-demo%{?1} = %{epoch}:%{version}-%{release}
660215
Provides: java-%{javaver}-%{origin}-demo%{?1} = %{epoch}:%{version}-%{release}
660215
%if %is_system_jdk
660215
Provides: java-demo%{?1} = %{epoch}:%{version}-%{release}
9d7641
Provides: java-%{origin}-demo%{?1} = %{epoch}:%{version}-%{release}
660215
%endif
660215
}
660215
660215
%define java_javadoc_rpo() %{expand:
660215
OrderWithRequires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release}
660215
# Post requires alternatives to install javadoc alternative
be8a6c
Requires(post):   %{alternatives_requires}
660215
# Postun requires alternatives to uninstall javadoc alternative
be8a6c
Requires(postun): %{alternatives_requires}
660215
660215
# Standard JPackage javadoc provides
9d7641
Provides: java-%{javaver}-javadoc%{?1}%{?2} = %{epoch}:%{version}-%{release}
9d7641
Provides: java-%{javaver}-%{origin}-javadoc%{?1}%{?2} = %{epoch}:%{version}-%{release}
660215
%if %is_system_jdk
9d7641
Provides: java-javadoc%{?1}%{?2} = %{epoch}:%{version}-%{release}
660215
%endif
660215
}
660215
660215
%define java_src_rpo() %{expand:
660215
Requires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release}
660215
660215
# Standard JPackage sources provides
660215
Provides: java-%{javaver}-src%{?1} = %{epoch}:%{version}-%{release}
660215
Provides: java-%{javaver}-%{origin}-src%{?1} = %{epoch}:%{version}-%{release}
660215
%if %is_system_jdk
660215
Provides: java-src%{?1} = %{epoch}:%{version}-%{release}
9d7641
Provides: java-%{origin}-src%{?1} = %{epoch}:%{version}-%{release}
660215
%endif
660215
}
660215
660215
# Prevent brp-java-repack-jars from being run
660215
%global __jar_repack 0
660215
660215
Name:    java-%{javaver}-%{origin}
660215
Version: %{newjavaver}.%{buildver}
9d60fa
Release: %{?eaprefix}%{rpmrelease}%{?extraver}%{?dist}
660215
# java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons
660215
# and this change was brought into RHEL-4. java-1.5.0-ibm packages
660215
# also included the epoch in their virtual provides. This created a
660215
# situation where in-the-wild java-1.5.0-ibm packages provided "java =
660215
# 1:1.5.0". In RPM terms, "1.6.0 < 1:1.5.0" since 1.6.0 is
660215
# interpreted as 0:1.6.0. So the "java >= 1.6.0" requirement would be
660215
# satisfied by the 1:1.5.0 packages. Thus we need to set the epoch in
660215
# JDK package >= 1.6.0 to 1, and packages referring to JDK virtual
660215
# provides >= 1.6.0 must specify the epoch, "java >= 1:1.6.0".
660215
660215
Epoch:   1
be8a6c
Summary: %{origin_nice} %{featurever} Runtime Environment
9d7641
%if 0%{?rhel} <= 8
660215
Group:   Development/Languages
9d7641
%endif
660215
660215
# HotSpot code is licensed under GPLv2
660215
# JDK library code is licensed under GPLv2 with the Classpath exception
660215
# The Apache license is used in code taken from Apache projects (primarily xalan & xerces)
660215
# DOM levels 2 & 3 and the XML digital signature schemas are licensed under the W3C Software License
660215
# The JSR166 concurrency code is in the public domain
660215
# The BSD and MIT licenses are used for a number of third-party libraries (see ADDITIONAL_LICENSE_INFO)
660215
# The OpenJDK source tree includes:
660215
# - JPEG library (IJG), zlib & libpng (zlib), giflib (MIT), harfbuzz (ISC),
660215
# - freetype (FTL), jline (BSD) and LCMS (MIT)
660215
# - jquery (MIT), jdk.crypto.cryptoki PKCS 11 wrapper (RSA)
660215
# - public_suffix_list.dat from publicsuffix.org (MPLv2.0)
660215
# The test code includes copies of NSS under the Mozilla Public License v2.0
660215
# The PCSClite headers are under a BSD with advertising license
660215
# The elliptic curve cryptography (ECC) source code is licensed under the LGPLv2.1 or any later version
660215
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
660215
URL:      http://openjdk.java.net/
660215
660215
e42bf6
# to regenerate source0 (jdk) run update_package.sh
660215
# update_package.sh contains hard-coded repos, revisions, tags, and projects to regenerate the source archives
89362c
Source0: openjdk-jdk%{featurever}u-%{vcstag}-4curve.tar.xz
e42bf6
e42bf6
# Use 'icedtea_sync.sh' to update the following
be8a6c
# They are based on code contained in the IcedTea project (6.x).
e42bf6
# Systemtap tapsets. Zipped up to keep it small.
e42bf6
Source8: tapsets-icedtea-%{icedteaver}.tar.xz
660215
660215
# Desktop files. Adapted from IcedTea
660215
Source9: jconsole.desktop.in
660215
e42bf6
# Release notes
e42bf6
Source10: NEWS
e42bf6
660215
# nss configuration file
660215
Source11: nss.cfg.in
660215
660215
# Removed libraries that we link instead
660215
Source12: remove-intree-libraries.sh
660215
660215
# Ensure we aren't using the limited crypto policy
660215
Source13: TestCryptoLevel.java
660215
660215
# Ensure ECDSA is working
660215
Source14: TestECDSA.java
660215
be8a6c
# Verify system crypto (policy) can be disabled via a property
be8a6c
Source15: TestSecurityProperties.java
9d60fa
0f3be5
# Ensure vendor settings are correct
0f3be5
Source16: CheckVendor.java
0f3be5
be8a6c
# nss fips configuration file
be8a6c
Source17: nss.fips.cfg.in
be8a6c
660215
############################################
660215
#
660215
# RPM/distribution specific patches
660215
#
660215
############################################
660215
660215
# Ignore AWTError when assistive technologies are loaded
660215
Patch1:    rh1648242-accessible_toolkit_crash_do_not_break_jvm.patch
660215
# Restrict access to java-atk-wrapper classes
660215
Patch2:    rh1648644-java_access_bridge_privileged_security.patch
9d60fa
# NSS via SunPKCS11 Provider (disabled due to memory leak).
9d60fa
Patch1000: rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch
9d7641
# RH1750419: enable build of speculative store bypass hardened alt-java (CVE-2018-3639)
0f3be5
Patch600: rh1750419-redhat_alt_java.patch
be8a6c
# RH1582504: Use RSA as default for keytool, as DSA is disabled in all crypto policies except LEGACY
be8a6c
Patch1003: rh1842572-rsa_default_for_keytool.patch
be8a6c
89362c
# Crypto policy and FIPS support patches
89362c
# Patch is generated from the fips tree at https://github.com/rh-openjdk/jdk11u/tree/fips
89362c
# as follows: git diff %%{vcstag} src make > fips-11u-$(git show -s --format=%h HEAD).patch
89362c
# Diff is limited to src and make subdirectories to exclude .github changes
89362c
# Fixes currently included:
89362c
# PR3694, RH1340845: Add security.useSystemPropertiesFile option to java.security to use system crypto policy
89362c
# PR3695: Allow use of system crypto policy to be disabled by the user
9d60fa
# RH1655466: Support RHEL FIPS mode using SunPKCS11 provider
0f3be5
# RH1818909: No ciphersuites availale for SSLSocket in FIPS mode
0f3be5
# RH1860986: Disable TLSv1.3 with the NSS-FIPS provider until PKCS#11 v3.0 support is available
be8a6c
# RH1915071: Always initialise JavaSecuritySystemConfiguratorAccess
be8a6c
# RH1929465: Improve system FIPS detection
be8a6c
# RH1996182: Login to the NSS software token in FIPS mode
9d7641
# RH1991003: Allow plain key import unless com.redhat.fips.plainKeySupport is set to false
89362c
# RH2021263: Make sure java.security.Security is initialised when retrieving JavaSecuritySystemConfiguratorAccess instance
89362c
# RH2021263: Return in C code after having generated Java exception
89362c
# RH2052819: Improve Security initialisation, now FIPS support no longer relies on crypto policy support
89362c
# RH2051605: Detect NSS at Runtime for FIPS detection
89362c
# RH2052819: Fix FIPS reliance on crypto policies
89362c
# RH2036462: sun.security.pkcs11.wrapper.PKCS11.getInstance breakage
89362c
# RH2090378: Revert to disabling system security properties and FIPS mode support together
89362c
Patch1001: fips-11u-%{fipsver}.patch
660215
660215
#############################################
660215
#
660215
# Shenandoah specific patches
660215
#
660215
#############################################
660215
660215
# Currently empty
660215
660215
#############################################
660215
#
9d60fa
# Upstreamable patches
660215
#
9d60fa
# This section includes patches which need to
9d60fa
# be reviewed & pushed to the current development
9d60fa
# tree of OpenJDK.
660215
#############################################
660215
9d60fa
Patch3:    rh649512-remove_uses_of_far_in_jpeg_libjpeg_turbo_1_4_compat_for_jdk10_and_up.patch
89362c
# JDK-8275535, RH2053256: Retrying a failed authentication on multiple LDAP servers can lead to users blocked
89362c
Patch8: jdk8275535-rh2053256-ldap_auth.patch
660215
660215
#############################################
660215
#
9d7641
# Backportable patches
9d7641
#
9d7641
# This section includes patches which are
9d7641
# present in the current development tree, but
9d7641
# need to be reviewed & pushed to the appropriate
9d7641
# updates tree of OpenJDK.
9d7641
#############################################
9d7641
9d7641
#############################################
9d7641
#
89362c
# Patches appearing in 11.0.15
660215
#
0f3be5
# This section includes patches which are present
0f3be5
# in the listed OpenJDK 11u release and should be
0f3be5
# able to be removed once that release is out
0f3be5
# and used by this RPM.
660215
#############################################
660215
660215
BuildRequires: autoconf
660215
BuildRequires: automake
660215
BuildRequires: alsa-lib-devel
660215
BuildRequires: binutils
660215
BuildRequires: cups-devel
660215
BuildRequires: desktop-file-utils
660215
# elfutils only are OK for build without AOT
660215
BuildRequires: elfutils-devel
9d60fa
BuildRequires: fontconfig-devel
660215
BuildRequires: freetype-devel
660215
BuildRequires: giflib-devel
660215
BuildRequires: gcc-c++
660215
BuildRequires: gdb
be8a6c
BuildRequires: harfbuzz-devel
660215
BuildRequires: lcms2-devel
660215
BuildRequires: libjpeg-devel
660215
BuildRequires: libpng-devel
660215
BuildRequires: libxslt
660215
BuildRequires: libX11-devel
660215
BuildRequires: libXi-devel
660215
BuildRequires: libXinerama-devel
9d60fa
BuildRequires: libXrandr-devel
9d60fa
BuildRequires: libXrender-devel
660215
BuildRequires: libXt-devel
660215
BuildRequires: libXtst-devel
89362c
# Requirement for setting up nss.cfg and nss.fips.cfg
89362c
BuildRequires: nss-devel
89362c
# Requirement for system security property test
89362c
BuildRequires: crypto-policies
660215
BuildRequires: pkgconfig
660215
BuildRequires: xorg-x11-proto-devel
660215
BuildRequires: zip
660215
BuildRequires: unzip
660215
BuildRequires: javapackages-filesystem
660215
BuildRequires: java-%{buildjdkver}-openjdk-devel
660215
# Zero-assembler build requirement
9d7641
%ifarch %{zero_arches}
660215
BuildRequires: libffi-devel
660215
%endif
89362c
# 2022a required as of JDK-8283350 in 11.0.16
89362c
BuildRequires: tzdata-java >= 2022a
660215
# Earlier versions have a bug in tree vectorization on PPC
660215
BuildRequires: gcc >= 4.8.3-8
660215
660215
%if %{with_systemtap}
660215
BuildRequires: systemtap-sdt-devel
660215
%endif
9d7641
BuildRequires: make
660215
660215
# this is always built, also during debug-only build
660215
# when it is built in debug-only this package is just placeholder
660215
%{java_rpo %{nil}}
660215
660215
%description
be8a6c
The %{origin_nice} %{featurever} runtime environment.
660215
660215
%if %{include_debug_build}
660215
%package slowdebug
be8a6c
Summary: %{origin_nice} %{featurever} Runtime Environment %{debug_on}
9d7641
%if 0%{?rhel} <= 8
660215
Group:   Development/Languages
9d7641
%endif
660215
660215
%{java_rpo -- %{debug_suffix_unquoted}}
660215
%description slowdebug
be8a6c
The %{origin_nice} %{featurever} runtime environment.
660215
%{debug_warning}
660215
%endif
660215
0f3be5
%if %{include_fastdebug_build}
0f3be5
%package fastdebug
be8a6c
Summary: %{origin_nice} %{featurever} Runtime Environment %{fastdebug_on}
9d7641
%if 0%{?rhel} <= 8
0f3be5
Group:   Development/Languages
9d7641
%endif
0f3be5
0f3be5
%{java_rpo -- %{fastdebug_suffix_unquoted}}
0f3be5
%description fastdebug
be8a6c
The %{origin_nice} %{featurever} runtime environment.
0f3be5
%{fastdebug_warning}
0f3be5
%endif
0f3be5
660215
%if %{include_normal_build}
660215
%package headless
be8a6c
Summary: %{origin_nice} %{featurever} Headless Runtime Environment
9d7641
%if 0%{?rhel} <= 8
660215
Group:   Development/Languages
9d7641
%endif
660215
660215
%{java_headless_rpo %{nil}}
660215
660215
%description headless
be8a6c
The %{origin_nice} %{featurever} runtime environment without audio and video support.
660215
%endif
660215
660215
%if %{include_debug_build}
660215
%package headless-slowdebug
be8a6c
Summary: %{origin_nice} %{featurever} Runtime Environment %{debug_on}
660215
Group:   Development/Languages
660215
660215
%{java_headless_rpo -- %{debug_suffix_unquoted}}
660215
660215
%description headless-slowdebug
be8a6c
The %{origin_nice} %{featurever} runtime environment without audio and video support.
660215
%{debug_warning}
660215
%endif
660215
0f3be5
%if %{include_fastdebug_build}
0f3be5
%package headless-fastdebug
be8a6c
Summary: %{origin_nice} %{featurever} Runtime Environment %{fastdebug_on}
0f3be5
Group:   Development/Languages
0f3be5
0f3be5
%{java_headless_rpo -- %{fastdebug_suffix_unquoted}}
0f3be5
0f3be5
%description headless-fastdebug
be8a6c
The %{origin_nice} %{featurever} runtime environment without audio and video support.
0f3be5
%{fastdebug_warning}
0f3be5
%endif
0f3be5
660215
%if %{include_normal_build}
660215
%package devel
be8a6c
Summary: %{origin_nice} %{featurever} Development Environment
9d7641
%if 0%{?rhel} <= 8
9d7641
Group:   Development/Languages
9d7641
%endif
660215
660215
%{java_devel_rpo %{nil}}
660215
660215
%description devel
be8a6c
The %{origin_nice} %{featurever} development tools.
660215
%endif
660215
660215
%if %{include_debug_build}
660215
%package devel-slowdebug
be8a6c
Summary: %{origin_nice} %{featurever} Development Environment %{debug_on}
9d7641
%if 0%{?rhel} <= 8
9d7641
Group:   Development/Languages
9d7641
%endif
660215
660215
%{java_devel_rpo -- %{debug_suffix_unquoted}}
660215
660215
%description devel-slowdebug
be8a6c
The %{origin_nice} %{featurever} development tools.
660215
%{debug_warning}
660215
%endif
660215
0f3be5
%if %{include_fastdebug_build}
0f3be5
%package devel-fastdebug
be8a6c
Summary: %{origin_nice} %{featurever} Development Environment %{fastdebug_on}
0f3be5
Group:   Development/Tools
0f3be5
0f3be5
%{java_devel_rpo -- %{fastdebug_suffix_unquoted}}
0f3be5
0f3be5
%description devel-fastdebug
be8a6c
The %{origin_nice} %{featurever} development tools.
0f3be5
%{fastdebug_warning}
0f3be5
%endif
0f3be5
be8a6c
%if %{include_staticlibs}
be8a6c
660215
%if %{include_normal_build}
e42bf6
%package static-libs
be8a6c
Summary: %{origin_nice} %{featurever} libraries for static linking
e42bf6
e42bf6
%{java_static_libs_rpo %{nil}}
e42bf6
e42bf6
%description static-libs
be8a6c
The %{origin_nice} %{featurever} libraries for static linking.
e42bf6
%endif
e42bf6
e42bf6
%if %{include_debug_build}
e42bf6
%package static-libs-slowdebug
be8a6c
Summary: %{origin_nice} %{featurever} libraries for static linking %{debug_on}
e42bf6
e42bf6
%{java_static_libs_rpo -- %{debug_suffix_unquoted}}
e42bf6
e42bf6
%description static-libs-slowdebug
be8a6c
The %{origin_nice} %{featurever} libraries for static linking.
e42bf6
%{debug_warning}
e42bf6
%endif
e42bf6
0f3be5
%if %{include_fastdebug_build}
0f3be5
%package static-libs-fastdebug
be8a6c
Summary: %{origin_nice} %{featurever} libraries for static linking %{fastdebug_on}
0f3be5
0f3be5
%{java_static_libs_rpo -- %{fastdebug_suffix_unquoted}}
0f3be5
0f3be5
%description static-libs-fastdebug
be8a6c
The %{origin_nice} %{featurever} libraries for static linking.
0f3be5
%{fastdebug_warning}
0f3be5
%endif
0f3be5
be8a6c
# staticlibs
be8a6c
%endif
be8a6c
e42bf6
%if %{include_normal_build}
660215
%package jmods
be8a6c
Summary: JMods for %{origin_nice} %{featurever}
9d7641
%if 0%{?rhel} <= 8
9d7641
Group:   Development/Languages
9d7641
%endif
660215
660215
%{java_jmods_rpo %{nil}}
660215
660215
%description jmods
be8a6c
The JMods for %{origin_nice} %{featurever}.
660215
%endif
660215
660215
%if %{include_debug_build}
660215
%package jmods-slowdebug
be8a6c
Summary: JMods for %{origin_nice} %{featurever} %{debug_on}
9d7641
%if 0%{?rhel} <= 8
9d7641
Group:   Development/Languages
9d7641
%endif
660215
660215
%{java_jmods_rpo -- %{debug_suffix_unquoted}}
660215
660215
%description jmods-slowdebug
be8a6c
The JMods for %{origin_nice} %{featurever}.
660215
%{debug_warning}
660215
%endif
660215
0f3be5
%if %{include_fastdebug_build}
0f3be5
%package jmods-fastdebug
be8a6c
Summary: JMods for %{origin_nice} %{featurever} %{fastdebug_on}
0f3be5
Group:   Development/Tools
0f3be5
0f3be5
%{java_jmods_rpo -- %{fastdebug_suffix_unquoted}}
0f3be5
0f3be5
%description jmods-fastdebug
be8a6c
The JMods for %{origin_nice} %{featurever}.
0f3be5
%{fastdebug_warning}
0f3be5
%endif
0f3be5
660215
%if %{include_normal_build}
660215
%package demo
be8a6c
Summary: %{origin_nice} %{featurever} Demos
9d7641
%if 0%{?rhel} <= 8
660215
Group:   Development/Languages
9d7641
%endif
660215
660215
%{java_demo_rpo %{nil}}
660215
660215
%description demo
be8a6c
The %{origin_nice} %{featurever} demos.
660215
%endif
660215
660215
%if %{include_debug_build}
660215
%package demo-slowdebug
be8a6c
Summary: %{origin_nice} %{featurever} Demos %{debug_on}
9d7641
%if 0%{?rhel} <= 8
660215
Group:   Development/Languages
9d7641
%endif
660215
660215
%{java_demo_rpo -- %{debug_suffix_unquoted}}
660215
660215
%description demo-slowdebug
be8a6c
The %{origin_nice} %{featurever} demos.
660215
%{debug_warning}
660215
%endif
660215
0f3be5
%if %{include_fastdebug_build}
0f3be5
%package demo-fastdebug
be8a6c
Summary: %{origin_nice} %{featurever} Demos %{fastdebug_on}
0f3be5
Group:   Development/Languages
0f3be5
0f3be5
%{java_demo_rpo -- %{fastdebug_suffix_unquoted}}
0f3be5
0f3be5
%description demo-fastdebug
be8a6c
The %{origin_nice} %{featurever} demos.
0f3be5
%{fastdebug_warning}
0f3be5
%endif
0f3be5
660215
%if %{include_normal_build}
660215
%package src
be8a6c
Summary: %{origin_nice} %{featurever} Source Bundle
9d7641
%if 0%{?rhel} <= 8
660215
Group:   Development/Languages
9d7641
%endif
660215
660215
%{java_src_rpo %{nil}}
660215
660215
%description src
be8a6c
The %{compatiblename}-src sub-package contains the complete %{origin_nice} %{featurever}
660215
class library source code for use by IDE indexers and debuggers.
660215
%endif
660215
660215
%if %{include_debug_build}
660215
%package src-slowdebug
be8a6c
Summary: %{origin_nice} %{featurever} Source Bundle %{for_debug}
9d7641
%if 0%{?rhel} <= 8
660215
Group:   Development/Languages
9d7641
%endif
660215
660215
%{java_src_rpo -- %{debug_suffix_unquoted}}
660215
660215
%description src-slowdebug
be8a6c
The %{compatiblename}-src-slowdebug sub-package contains the complete %{origin_nice} %{featurever}
be8a6c
 class library source code for use by IDE indexers and debuggers, %{for_debug}.
660215
%endif
660215
0f3be5
%if %{include_fastdebug_build}
0f3be5
%package src-fastdebug
be8a6c
Summary: %{origin_nice} %{featurever} Source Bundle %{for_fastdebug}
0f3be5
Group:   Development/Languages
0f3be5
0f3be5
%{java_src_rpo -- %{fastdebug_suffix_unquoted}}
0f3be5
0f3be5
%description src-fastdebug
be8a6c
The %{compatiblename}-src-fastdebug sub-package contains the complete %{origin_nice} %{featurever}
be8a6c
 class library source code for use by IDE indexers and debuggers, %{for_fastdebug}.
0f3be5
%endif
0f3be5
660215
%if %{include_normal_build}
660215
%package javadoc
be8a6c
Summary: %{origin_nice} %{featurever} API documentation
9d7641
%if 0%{?rhel} <= 8
660215
Group:   Documentation
9d7641
%endif
660215
Requires: javapackages-filesystem
9d60fa
Obsoletes: javadoc-debug
660215
9d7641
%{java_javadoc_rpo -- %{nil} %{nil}}
660215
660215
%description javadoc
be8a6c
The %{origin_nice} %{featurever} API documentation.
660215
660215
%package javadoc-zip
be8a6c
Summary: %{origin_nice} %{featurever} API documentation compressed in a single archive
9d7641
%if 0%{?rhel} <= 8
660215
Group:   Documentation
9d7641
%endif
660215
Requires: javapackages-filesystem
9d60fa
Obsoletes: javadoc-zip-debug
660215
9d7641
%{java_javadoc_rpo -- %{nil} -zip}
9d7641
%{java_javadoc_rpo -- %{nil} %{nil}}
660215
660215
%description javadoc-zip
be8a6c
The %{origin_nice} %{featurever} API documentation compressed in a single archive.
660215
%endif
660215
660215
%prep
e42bf6
89362c
echo "Preparing %{oj_vendor_version}"
89362c
e42bf6
# Using the echo macro breaks rpmdev-bumpspec, as it parses the first line of stdout :-(
e42bf6
%if 0%{?stapinstall:1}
e42bf6
  echo "CPU: %{_target_cpu}, arch install directory: %{archinstall}, SystemTap install directory: %{stapinstall}"
e42bf6
%else
e42bf6
  %{error:Unrecognised architecture %{_target_cpu}}
e42bf6
%endif
e42bf6
660215
if [ %{include_normal_build} -eq 0 -o  %{include_normal_build} -eq 1 ] ; then
660215
  echo "include_normal_build is %{include_normal_build}"
660215
else
0f3be5
  echo "include_normal_build is %{include_normal_build}, that is invalid. Use 1 for yes or 0 for no"
660215
  exit 11
660215
fi
660215
if [ %{include_debug_build} -eq 0 -o  %{include_debug_build} -eq 1 ] ; then
660215
  echo "include_debug_build is %{include_debug_build}"
660215
else
0f3be5
  echo "include_debug_build is %{include_debug_build}, that is invalid. Use 1 for yes or 0 for no"
660215
  exit 12
660215
fi
0f3be5
if [ %{include_fastdebug_build} -eq 0 -o  %{include_fastdebug_build} -eq 1 ] ; then
0f3be5
  echo "include_fastdebug_build is %{include_fastdebug_build}"
0f3be5
else
0f3be5
  echo "include_fastdebug_build is %{include_fastdebug_build}, that is invalid. Use 1 for yes or 0 for no"
660215
  exit 13
660215
fi
0f3be5
if [ %{include_debug_build} -eq 0 -a  %{include_normal_build} -eq 0 -a  %{include_fastdebug_build} -eq 0 ] ; then
0f3be5
  echo "You have disabled all builds (normal,fastdebug,slowdebug). That is a no go."
0f3be5
  exit 14
0f3be5
fi
660215
%setup -q -c -n %{uniquesuffix ""} -T -a 0
660215
# https://bugzilla.redhat.com/show_bug.cgi?id=1189084
660215
prioritylength=`expr length %{priority}`
660215
if [ $prioritylength -ne 8 ] ; then
660215
 echo "priority must be 8 digits in total, violated"
660215
 exit 14
660215
fi
660215
660215
# OpenJDK patches
be8a6c
# Remove libraries that are linked by both static and dynamic builds
be8a6c
sh %{SOURCE12} %{top_level_dir_name}
660215
be8a6c
# Patch the JDK
660215
pushd %{top_level_dir_name}
660215
%patch1 -p1
660215
%patch2 -p1
660215
%patch3 -p1
89362c
# Add crypto policy and FIPS support
89362c
%patch1001 -p1
89362c
# nss.cfg PKCS11 support; must come last as it also alters java.security
89362c
%patch1000 -p1
660215
popd # openjdk
660215
0f3be5
%patch600
0f3be5
%patch1003
89362c
89362c
%patch8
660215
660215
# Extract systemtap tapsets
660215
%if %{with_systemtap}
660215
tar --strip-components=1 -x -I xz -f %{SOURCE8}
660215
%if %{include_debug_build}
660215
cp -r tapset tapset%{debug_suffix}
660215
%endif
0f3be5
%if %{include_fastdebug_build}
0f3be5
cp -r tapset tapset%{fastdebug_suffix}
0f3be5
%endif
660215
660215
for suffix in %{build_loop} ; do
660215
  for file in "tapset"$suffix/*.in; do
e42bf6
    OUTPUT_FILE=`echo $file | sed -e "s:\.stp\.in$:-%{version}-%{release}.%{_arch}.stp:g"`
660215
    sed -e "s:@ABS_SERVER_LIBJVM_SO@:%{_jvmdir}/%{sdkdir -- $suffix}/lib/server/libjvm.so:g" $file > $file.1
be8a6c
    sed -e "s:@JAVA_SPEC_VER@:%{javaver}:g" $file.1 > $file.2
660215
# TODO find out which architectures other than i686 have a client vm
660215
%ifarch %{ix86}
be8a6c
    sed -e "s:@ABS_CLIENT_LIBJVM_SO@:%{_jvmdir}/%{sdkdir -- $suffix}/lib/client/libjvm.so:g" $file.2 > $OUTPUT_FILE
660215
%else
be8a6c
    sed -e "/@ABS_CLIENT_LIBJVM_SO@/d" $file.2 > $OUTPUT_FILE
660215
%endif
660215
    sed -i -e "s:@ABS_JAVA_HOME_DIR@:%{_jvmdir}/%{sdkdir -- $suffix}:g" $OUTPUT_FILE
660215
    sed -i -e "s:@INSTALL_ARCH_DIR@:%{archinstall}:g" $OUTPUT_FILE
660215
    sed -i -e "s:@prefix@:%{_jvmdir}/%{sdkdir -- $suffix}/:g" $OUTPUT_FILE
660215
  done
660215
done
660215
# systemtap tapsets ends
660215
%endif
660215
660215
# Prepare desktop files
e42bf6
# The _X_ syntax indicates variables that are replaced by make upstream
e42bf6
# The @X@ syntax indicates variables that are replaced by configure upstream
660215
for suffix in %{build_loop} ; do
660215
for file in %{SOURCE9}; do
660215
    FILE=`basename $file | sed -e s:\.in$::g`
660215
    EXT="${FILE##*.}"
660215
    NAME="${FILE%.*}"
660215
    OUTPUT_FILE=$NAME$suffix.$EXT
e42bf6
    sed    -e  "s:_SDKBINDIR_:%{sdkbindir -- $suffix}:g" $file > $OUTPUT_FILE
e42bf6
    sed -i -e  "s:@target_cpu@:%{_arch}:g" $OUTPUT_FILE
e42bf6
    sed -i -e  "s:@OPENJDK_VER@:%{version}-%{release}.%{_arch}$suffix:g" $OUTPUT_FILE
e42bf6
    sed -i -e  "s:@JAVA_VER@:%{javaver}:g" $OUTPUT_FILE
660215
    sed -i -e  "s:@JAVA_VENDOR@:%{origin}:g" $OUTPUT_FILE
660215
done
660215
done
660215
660215
# Setup nss.cfg
660215
sed -e "s:@NSS_LIBDIR@:%{NSS_LIBDIR}:g" %{SOURCE11} > nss.cfg
660215
9d60fa
# Setup nss.fips.cfg
be8a6c
sed -e "s:@NSS_LIBDIR@:%{NSS_LIBDIR}:g" %{SOURCE17} > nss.fips.cfg
660215
660215
%build
660215
# How many CPU's do we have?
660215
export NUM_PROC=%(/usr/bin/getconf _NPROCESSORS_ONLN 2> /dev/null || :)
660215
export NUM_PROC=${NUM_PROC:-1}
660215
%if 0%{?_smp_ncpus_max}
660215
# Honor %%_smp_ncpus_max
660215
[ ${NUM_PROC} -gt %{?_smp_ncpus_max} ] && export NUM_PROC=%{?_smp_ncpus_max}
660215
%endif
660215
660215
%ifarch s390x sparc64 alpha %{power64} %{aarch64}
660215
export ARCH_DATA_MODEL=64
660215
%endif
660215
%ifarch alpha
660215
export CFLAGS="$CFLAGS -mieee"
660215
%endif
660215
660215
# We use ourcppflags because the OpenJDK build seems to
660215
# pass EXTRA_CFLAGS to the HotSpot C++ compiler...
be8a6c
EXTRA_CFLAGS="%ourcppflags -Wno-error"
be8a6c
EXTRA_CPP_FLAGS="%ourcppflags"
660215
660215
%ifarch %{power64} ppc
660215
# fix rpmlint warnings
660215
EXTRA_CFLAGS="$EXTRA_CFLAGS -fno-strict-aliasing"
660215
%endif
9d7641
%ifarch %{ix86}
9d7641
# Align stack boundary on x86_32
9d7641
EXTRA_CFLAGS="$(echo ${EXTRA_CFLAGS} | sed -e 's|-mstackrealign|-mincoming-stack-boundary=2 -mpreferred-stack-boundary=4|')"
9d7641
EXTRA_CPP_FLAGS="$(echo ${EXTRA_CPP_FLAGS} | sed -e 's|-mstackrealign|-mincoming-stack-boundary=2 -mpreferred-stack-boundary=4|')"
9d7641
%endif
9d7641
# Fixes annocheck warnings in assembler files due to missing build notes
e42bf6
EXTRA_ASFLAGS="${EXTRA_CFLAGS} -Wa,--generate-missing-build-notes=yes"
9d7641
export EXTRA_CFLAGS EXTRA_CPP_FLAGS EXTRA_ASFLAGS
9d7641
9d7641
function buildjdk() {
9d7641
    local outputdir=${1}
9d7641
    local buildjdk=${2}
9d7641
    local maketargets="${3}"
9d7641
    local debuglevel=${4}
9d7641
    local link_opt=${5}
9d7641
9d7641
    local top_dir_abs_src_path=$(pwd)/%{top_level_dir_name}
9d7641
    local top_dir_abs_build_path=$(pwd)/${outputdir}
9d7641
9d7641
    echo "Using output directory: ${outputdir}";
9d7641
    echo "Checking build JDK ${buildjdk} is operational..."
9d7641
    ${buildjdk}/bin/java -version
9d7641
    echo "Using make targets: ${maketargets}"
9d7641
    echo "Using debuglevel: ${debuglevel}"
9d7641
    echo "Using link_opt: ${link_opt}"
9d7641
    echo "Building %{newjavaver}-%{buildver}, pre=%{ea_designator}, opt=%{lts_designator}"
9d7641
9d7641
    mkdir -p ${outputdir}
9d7641
    pushd ${outputdir}
9d7641
9d7641
    bash ${top_dir_abs_src_path}/configure \
9d7641
%ifarch %{zero_arches}
660215
    --with-jvm-variants=zero \
660215
%endif
660215
%ifarch %{ppc64le}
660215
    --with-jobs=1 \
660215
%endif
be8a6c
    --with-version-build=%{buildver} \
9d60fa
    --with-version-pre="%{ea_designator}" \
660215
    --with-version-opt=%{lts_designator} \
89362c
    --with-vendor-version-string="%{oj_vendor_version}" \
0f3be5
    --with-vendor-name="%{oj_vendor}" \
0f3be5
    --with-vendor-url="%{oj_vendor_url}" \
0f3be5
    --with-vendor-bug-url="%{oj_vendor_bug_url}" \
0f3be5
    --with-vendor-vm-bug-url="%{oj_vendor_bug_url}" \
9d7641
    --with-boot-jdk=${buildjdk} \
9d7641
    --with-debug-level=${debuglevel} \
9d7641
    --with-native-debug-symbols="%{debug_symbols}" \
89362c
    --disable-sysconf-nss \
660215
    --enable-unlimited-crypto \
660215
    --with-zlib=system \
be8a6c
    --with-libjpeg=${link_opt} \
be8a6c
    --with-giflib=${link_opt} \
be8a6c
    --with-libpng=${link_opt} \
be8a6c
    --with-lcms=${link_opt} \
be8a6c
    --with-harfbuzz=${link_opt} \
660215
    --with-stdc++lib=dynamic \
660215
    --with-extra-cxxflags="$EXTRA_CPP_FLAGS" \
660215
    --with-extra-cflags="$EXTRA_CFLAGS" \
e42bf6
    --with-extra-asflags="$EXTRA_ASFLAGS" \
660215
    --with-extra-ldflags="%{ourldflags}" \
660215
    --with-num-cores="$NUM_PROC" \
660215
    --disable-javac-server \
0f3be5
    --with-jvm-features="%{shenandoah_feature},%{zgc_feature}" \
660215
    --disable-warnings-as-errors
660215
9d7641
    cat spec.gmk
be8a6c
9d7641
    make \
9d7641
      JAVAC_FLAGS=-g \
9d7641
      LOG=trace \
9d7641
      WARNINGS_ARE_ERRORS="-Wno-error" \
9d7641
      CFLAGS_WARNINGS_ARE_ERRORS="-Wno-error" \
9d7641
      $maketargets || ( pwd; find ${top_dir_abs_src_path} ${top_dir_abs_build_path} -name "hs_err_pid*.log" | xargs cat && false )
be8a6c
9d7641
    popd
9d7641
}
9d7641
9d7641
function installjdk() {
9d7641
    local outputdir=${1}
9d7641
    local installdir=${2}
9d7641
    local imagepath=${installdir}/images/%{jdkimage}
9d7641
9d7641
    echo "Installing build from ${outputdir} to ${installdir}..."
9d7641
    mkdir -p ${installdir}
9d7641
    echo "Installing images..."
9d7641
    mv ${outputdir}/images ${installdir}
9d7641
    if [ -d ${outputdir}/bundles ] ; then
9d7641
	echo "Installing bundles...";
9d7641
	mv ${outputdir}/bundles ${installdir} ;
9d7641
    fi
9d7641
    if [ -d ${outputdir}/docs ] ; then
9d7641
	echo "Installing docs...";
9d7641
	mv ${outputdir}/docs ${installdir} ;
9d7641
    fi