Blame SPECS/java-11-openjdk.spec

c0c534
# RPM conditionals so as to be able to dynamically produce
c0c534
# slowdebug/release builds. See:
c0c534
# http://rpm.org/user_doc/conditional_builds.html
c0c534
#
c0c534
# Examples:
c0c534
#
c0c534
# Produce release *and* slowdebug builds on x86_64 (default):
c0c534
# $ rpmbuild -ba java-1.8.0-openjdk.spec
c0c534
#
c0c534
# Produce only release builds (no slowdebug builds) on x86_64:
c0c534
# $ rpmbuild -ba java-1.8.0-openjdk.spec --without slowdebug
c0c534
#
c0c534
# Only produce a release build on x86_64:
ac0427
# $ rhpkg mockbuild --without slowdebug
c0c534
#
c0c534
# Only produce a debug build on x86_64:
ac0427
# $ rhpkg local --without release
c0c534
#
c0c534
# Enable slowdebug builds by default on relevant arches.
c0c534
%bcond_without slowdebug
c0c534
# Enable release builds by default on relevant arches.
c0c534
%bcond_without release
438e03
# Enable static library builds by default.
438e03
%bcond_without staticlibs
ac0427
# Remove build artifacts by default
ac0427
%bcond_with artifacts
c0c534
07b2a4
# Workaround for stripping of debug symbols from static libraries
438e03
%if %{with staticlibs}
07b2a4
# RHEL 7 doesn't have __brp_strip_static_archive so need to redefine
07b2a4
# the entire os_install_post macro
07b2a4
%define __os_install_post    \
07b2a4
    /usr/lib/rpm/redhat/brp-compress \
07b2a4
    %{!?__debug_package:\
07b2a4
    /usr/lib/rpm/redhat/brp-strip %{__strip} \
07b2a4
    /usr/lib/rpm/redhat/brp-strip-comment-note %{__strip} %{__objdump} \
07b2a4
    } \
07b2a4
    %{!?__jar_repack:/usr/lib/rpm/redhat/brp-java-repack-jars} \
07b2a4
%{nil}
438e03
%global include_staticlibs 1
438e03
%else
438e03
%global include_staticlibs 0
438e03
%endif
07b2a4
b76b7f
# The -g flag says to use strip -g instead of full strip on DSOs or EXEs.
b76b7f
# This fixes detailed NMT and other tools which need minimal debug info.
b76b7f
# See: https://bugzilla.redhat.com/show_bug.cgi?id=1520879
b76b7f
%global _find_debuginfo_opts -g
b76b7f
c0c534
# note: parametrized macros are order-sensitive (unlike not-parametrized) even with normal macros
c0c534
# also necessary when passing it as parameter to other macros. If not macro, then it is considered a switch
c0c534
# see the difference between global and define:
c0c534
# See https://github.com/rpm-software-management/rpm/issues/127 to comments at  "pmatilai commented on Aug 18, 2017"
c0c534
# (initiated in https://bugzilla.redhat.com/show_bug.cgi?id=1482192)
c0c534
%global debug_suffix_unquoted -debug
438e03
%global main_suffix_unquoted -main
438e03
%global staticlibs_suffix_unquoted -staticlibs
c0c534
# quoted one for shell operations
c0c534
%global debug_suffix "%{debug_suffix_unquoted}"
c0c534
%global normal_suffix ""
438e03
%global main_suffix "%{main_suffix_unquoted}"
438e03
%global staticlibs_suffix "%{staticlibs_suffix_unquoted}"
c0c534
c0c534
# if you want only debug build but providing java build only normal build but set normalbuild_parameter
20ef41
%global debug_warning This package is unoptimised with full debugging. Install only as needed and remove ASAP.
ac0427
%global debug_on unoptimised with full debugging on
ac0427
%global for_debug for packages with debugging on and no optimisation
c0c534
c0c534
%if %{with release}
c0c534
%global include_normal_build 1
c0c534
%else
c0c534
%global include_normal_build 0
c0c534
%endif
c0c534
c0c534
%if %{include_normal_build}
c0c534
%global build_loop1 %{normal_suffix}
c0c534
%else
c0c534
%global build_loop1 %{nil}
c0c534
%endif
c0c534
c0c534
%global aarch64         aarch64 arm64 armv8
c0c534
# we need to distinguish between big and little endian PPC64
c0c534
%global ppc64le         ppc64le
c0c534
%global ppc64be         ppc64 ppc64p7
8d5b3a
# Set of architectures which support multiple ABIs
c0c534
%global multilib_arches %{power64} sparc64 x86_64
8d5b3a
# Set of architectures for which we build slowdebug builds
8d5b3a
%global debug_arches    %{ix86} x86_64 sparcv9 sparc64 %{aarch64} %{power64} s390x
8d5b3a
# Set of architectures with a Just-In-Time (JIT) compiler
8d5b3a
%global jit_arches      %{debug_arches} %{arm}
8d5b3a
# Set of architectures which run a full bootstrap cycle
8d5b3a
%global bootstrap_arches %{jit_arches}
8d5b3a
# Set of architectures which support SystemTap tapsets
8d5b3a
%global systemtap_arches %{jit_arches}
8d5b3a
# Set of architectures with a Ahead-Of-Time (AOT) compiler
c0c534
%global aot_arches      x86_64 %{aarch64}
8d5b3a
# Set of architectures which support the serviceability agent
8d5b3a
%global sa_arches       %{ix86} x86_64 sparcv9 sparc64 %{aarch64} %{power64} %{arm}
8d5b3a
# Set of architectures which support class data sharing
8d5b3a
# As of JDK-8005165 in OpenJDK 10, class sharing is not arch-specific
8d5b3a
# However, it does segfault on the Zero assembler port, so currently JIT only
8d5b3a
%global share_arches    %{jit_arches}
8d5b3a
# Set of architectures for which we build the Shenandoah garbage collector
8d5b3a
%global shenandoah_arches x86_64 %{aarch64}
8d5b3a
# Set of architectures for which we build the Z garbage collector
8d5b3a
%global zgc_arches x86_64
20ef41
# Set of architectures for which alt-java has SSB mitigation
20ef41
%global ssbd_arches x86_64
c0c534
c0c534
# By default, we build a debug build during main build on JIT architectures
c0c534
%if %{with slowdebug}
8d5b3a
%ifarch %{debug_arches}
c0c534
%global include_debug_build 1
c0c534
%else
c0c534
%global include_debug_build 0
c0c534
%endif
c0c534
%else
c0c534
%global include_debug_build 0
c0c534
%endif
c0c534
8d5b3a
# On certain architectures, we compile the Shenandoah GC
8d5b3a
%ifarch %{shenandoah_arches}
c0c534
%global use_shenandoah_hotspot 1
8d5b3a
%global shenandoah_feature shenandoahgc
c0c534
%else
c0c534
%global use_shenandoah_hotspot 0
8d5b3a
%global shenandoah_feature -shenandoahgc
8d5b3a
%endif
8d5b3a
8d5b3a
# On certain architectures, we compile the ZGC
8d5b3a
%ifarch %{zgc_arches}
8d5b3a
%global use_zgc_hotspot 1
8d5b3a
%global zgc_feature zgc
8d5b3a
%else
8d5b3a
%global use_zgc_hotspot 0
8d5b3a
%global zgc_feature -zgc
c0c534
%endif
c0c534
c0c534
%if %{include_debug_build}
c0c534
%global build_loop2 %{debug_suffix}
c0c534
%else
c0c534
%global build_loop2 %{nil}
c0c534
%endif
c0c534
c0c534
# if you disable both builds, then the build fails
3aaaac
# Note that the debug build requires the normal build for docs
ac0427
%global build_loop %{build_loop1} %{build_loop2}
c0c534
# note: that order: normal_suffix debug_suffix, in case of both enabled
c0c534
# is expected in one single case at the end of the build
c0c534
%global rev_build_loop  %{build_loop2} %{build_loop1}
c0c534
438e03
%if %{include_staticlibs}
438e03
%global staticlibs_loop %{staticlibs_suffix}
438e03
%else
438e03
%global staticlibs_loop %{nil}
438e03
%endif
438e03
8d5b3a
%ifarch %{bootstrap_arches}
c0c534
%global bootstrap_build 1
c0c534
%else
c0c534
%global bootstrap_build 1
c0c534
%endif
c0c534
438e03
%if %{include_staticlibs}
438e03
# Extra target for producing the static-libraries. Separate from
438e03
# other targets since this target is configured to use in-tree
438e03
# AWT dependencies: lcms, libjpeg, libpng, libharfbuzz, giflib
438e03
# and possibly others
438e03
%global static_libs_target static-libs-image
ac0427
%else
ac0427
%global static_libs_target %{nil}
438e03
%endif
c0c534
ac0427
# RPM JDK builds keep the debug symbols internal, to be later stripped by RPM
ac0427
%global debug_symbols internal
ac0427
ac0427
# unlike portables,the rpms have to use static_libs_target very dynamically
ac0427
%global bootstrap_targets images
ac0427
%global release_targets images docs-zip
ac0427
# No docs nor bootcycle for debug builds
ac0427
%global debug_targets images
ac0427
c0c534
c0c534
# Filter out flags from the optflags macro that cause problems with the OpenJDK build
c0c534
# We filter out -O flags so that the optimization of HotSpot is not lowered from O3 to O2
c0c534
# We filter out -Wall which will otherwise cause HotSpot to produce hundreds of thousands of warnings (100+mb logs)
c0c534
# We replace it with -Wformat (required by -Werror=format-security) and -Wno-cpp to avoid FORTIFY_SOURCE warnings
c0c534
# We filter out -fexceptions as the HotSpot build explicitly does -fno-exceptions and it's otherwise the default for C++
c0c534
%global ourflags %(echo %optflags | sed -e 's|-Wall|-Wformat -Wno-cpp|' | sed -r -e 's|-O[0-9]*||')
c0c534
%global ourcppflags %(echo %ourflags | sed -e 's|-fexceptions||')
c0c534
%global ourldflags %{__global_ldflags}
c0c534
c0c534
# With disabled nss is NSS deactivated, so NSS_LIBDIR can contain the wrong path
c0c534
# the initialization must be here. Later the pkg-config have buggy behavior
c0c534
# looks like openjdk RPM specific bug
c0c534
# Always set this so the nss.cfg file is not broken
c0c534
%global NSS_LIBDIR %(pkg-config --variable=libdir nss)
c0c534
c0c534
# fix for https://bugzilla.redhat.com/show_bug.cgi?id=1111349
ac0427
%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.*|libunpack[.]so.*|libzip[.]so.*
c0c534
c0c534
%global __provides_exclude ^(%{_privatelibs})$
c0c534
%global __requires_exclude ^(%{_privatelibs})$
c0c534
c0c534
# In some cases, the arch used by the JDK does
c0c534
# not match _arch.
c0c534
# Also, in some cases, the machine name used by SystemTap
07b2a4
# does not match that given by _target_cpu
c0c534
%ifarch x86_64
c0c534
%global archinstall amd64
07b2a4
%global stapinstall x86_64
c0c534
%endif
c0c534
%ifarch ppc
c0c534
%global archinstall ppc
07b2a4
%global stapinstall powerpc
c0c534
%endif
c0c534
%ifarch %{ppc64be}
c0c534
%global archinstall ppc64
07b2a4
%global stapinstall powerpc
c0c534
%endif
c0c534
%ifarch %{ppc64le}
c0c534
%global archinstall ppc64le
07b2a4
%global stapinstall powerpc
c0c534
%endif
c0c534
%ifarch %{ix86}
c0c534
%global archinstall i686
07b2a4
%global stapinstall i386
c0c534
%endif
c0c534
%ifarch ia64
c0c534
%global archinstall ia64
07b2a4
%global stapinstall ia64
c0c534
%endif
c0c534
%ifarch s390
c0c534
%global archinstall s390
07b2a4
%global stapinstall s390
c0c534
%endif
c0c534
%ifarch s390x
c0c534
%global archinstall s390x
07b2a4
%global stapinstall s390
c0c534
%endif
c0c534
%ifarch %{arm}
c0c534
%global archinstall arm
07b2a4
%global stapinstall arm
c0c534
%endif
c0c534
%ifarch %{aarch64}
c0c534
%global archinstall aarch64
07b2a4
%global stapinstall arm64
c0c534
%endif
c0c534
# 32 bit sparc, optimized for v9
c0c534
%ifarch sparcv9
c0c534
%global archinstall sparc
07b2a4
%global stapinstall %{_target_cpu}
c0c534
%endif
c0c534
# 64 bit sparc
c0c534
%ifarch sparc64
c0c534
%global archinstall sparcv9
07b2a4
%global stapinstall %{_target_cpu}
c0c534
%endif
07b2a4
# Need to support noarch for srpm build
07b2a4
%ifarch noarch
07b2a4
%global archinstall %{nil}
07b2a4
%global stapinstall %{nil}
c0c534
%endif
c0c534
8d5b3a
%ifarch %{systemtap_arches}
c0c534
%global with_systemtap 1
c0c534
%else
c0c534
%global with_systemtap 0
c0c534
%endif
c0c534
c0c534
# New Version-String scheme-style defines
20ef41
%global featurever 11
20ef41
%global interimver 0
ac0427
%global updatever 13
20ef41
%global patchver 0
20ef41
# If you bump featurever, you must bump also vendor_version_string
8d5b3a
# Used via new version scheme. JDK 11 was
8d5b3a
# GA'ed in September 2018 => 18.9
8d5b3a
%global vendor_version_string 18.9
20ef41
# buildjdkver is usually same as %%{featurever},
20ef41
# but in time of bootstrap of next jdk, it is featurever-1,
d00a18
# and this it is better to change it here, on single place
20ef41
%global buildjdkver %{featurever}
e50716
# Add LTS designator for RHEL builds
e50716
%if 0%{?rhel}
e50716
  %global lts_designator "LTS"
e50716
  %global lts_designator_zip -%{lts_designator}
e50716
%else
e50716
  %global lts_designator ""
e50716
  %global lts_designator_zip ""
e50716
%endif
c0c534
8d5b3a
# Define vendor information used by OpenJDK
8d5b3a
%global oj_vendor Red Hat, Inc.
438e03
%global oj_vendor_url https://www.redhat.com/
8d5b3a
# Define what url should JVM offer in case of a crash report
8d5b3a
# order may be important, epel may have rhel declared
8d5b3a
%if 0%{?epel}
8d5b3a
%global oj_vendor_bug_url  https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora%20EPEL&component=%{name}&version=epel%{epel}
8d5b3a
%else
8d5b3a
%if 0%{?fedora}
8d5b3a
# Does not work for rawhide, keeps the version field empty
8d5b3a
%global oj_vendor_bug_url  https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=%{name}&version=%{fedora}
8d5b3a
%else
8d5b3a
%if 0%{?rhel}
8d5b3a
%global oj_vendor_bug_url  https://bugzilla.redhat.com/enter_bug.cgi?product=Red%20Hat%20Enterprise%20Linux%20%{rhel}&component=%{name}
8d5b3a
%else
8d5b3a
%global oj_vendor_bug_url  https://bugzilla.redhat.com/enter_bug.cgi
8d5b3a
%endif
8d5b3a
%endif
8d5b3a
%endif
8d5b3a
07b2a4
# Define IcedTea version used for SystemTap tapsets and desktop file
07b2a4
%global icedteaver      3.15.0
07b2a4
c0c534
# Standard JPackage naming and versioning defines
c0c534
%global origin          openjdk
c0c534
%global origin_nice     OpenJDK
c0c534
%global top_level_dir_name   %{origin}
438e03
%global top_level_dir_name_backup %{top_level_dir_name}-backup
ac0427
%global buildver        8
ac0427
%global rpmrelease      1
07b2a4
#%%global tagsuffix      %%{nil}
c0c534
# priority must be 7 digits in total
c0c534
# setting to 1, so debug ones can have 0
ac0427
%global priority 00000%{interimver}1
ac0427
%global newjavaver %{featurever}.%{interimver}.%{updatever}.%{patchver}
c0c534
20ef41
# Omit trailing 0 in filenames when the patch version is 0
20ef41
%if 0%{?patchver} > 0
20ef41
%global filever %{newjavaver}
20ef41
%else
20ef41
%global filever %{featurever}.%{interimver}.%{updatever}
20ef41
%endif
20ef41
20ef41
%global javaver         %{featurever}
c0c534
3aaaac
# Define milestone (EA for pre-releases, GA for releases)
3aaaac
# Release will be (where N is usually a number starting at 1):
3aaaac
# - 0.N%%{?extraver}%%{?dist} for EA releases,
3aaaac
# - N%%{?extraver}{?dist} for GA releases
3aaaac
%global is_ga           1
3aaaac
%if %{is_ga}
3aaaac
%global ea_designator ""
3aaaac
%global ea_designator_zip ""
3aaaac
%global extraver %{nil}
3aaaac
%global eaprefix %{nil}
3aaaac
%else
3aaaac
%global ea_designator ea
3aaaac
%global ea_designator_zip -%{ea_designator}
3aaaac
%global extraver .%{ea_designator}
3aaaac
%global eaprefix 0.
3aaaac
%endif
3aaaac
c0c534
# parametrized macros are order-sensitive
20ef41
%global compatiblename  java-%{featurever}-%{origin}
c0c534
%global fullversion     %{compatiblename}-%{version}-%{release}
07b2a4
# images directories from upstream build
07b2a4
%global jdkimage                jdk
07b2a4
%global static_libs_image       static-libs
c0c534
# output dir stub
438e03
%define buildoutputdir() %{expand:build/jdk11.build%1}
ac0427
%define installoutputdir() %{expand:install/jdk11.install%1}
c0c534
# we can copy the javadoc to not arched dir, or make it not noarch
e50716
# javadoc is no longer noarch, as it have aot on only some arches
e50716
%global uniquejavadocdir()    %{expand:%{fullversion}.%{_arch}%1}
c0c534
# main id and dir of this jdk
c0c534
%global uniquesuffix()        %{expand:%{fullversion}.%{_arch}%1}
c0c534
c0c534
# Standard JPackage directories and symbolic links.
c0c534
%global sdkdir()        %{expand:%{uniquesuffix %%1}}
c0c534
%global jrelnk()        %{expand:jre-%{javaver}-%{origin}-%{version}-%{release}.%{_arch}%1}
c0c534
c0c534
%global sdkbindir()     %{expand:%{_jvmdir}/%{sdkdir %%1}/bin}
c0c534
%global jrebindir()     %{expand:%{_jvmdir}/%{sdkdir %%1}/bin}
c0c534
6e367a
%global alt_java_name     alt-java
6e367a
c0c534
%global rpm_state_dir %{_localstatedir}/lib/rpm-state/
c0c534
c0c534
%if %{with_systemtap}
c0c534
# Where to install systemtap tapset (links)
c0c534
# We would like these to be in a package specific sub-dir,
c0c534
# but currently systemtap doesn't support that, so we have to
c0c534
# use the root tapset dir for now. To distinguish between 64
c0c534
# and 32 bit architectures we place the tapsets under the arch
c0c534
# specific dir (note that systemtap will only pickup the tapset
c0c534
# for the primary arch for now). Systemtap uses the machine name
07b2a4
# aka target_cpu as architecture specific directory name.
c0c534
%global tapsetroot /usr/share/systemtap
c0c534
%global tapsetdirttapset %{tapsetroot}/tapset/
07b2a4
%global tapsetdir %{tapsetdirttapset}/%{stapinstall}
c0c534
%endif
c0c534
c0c534
# not-duplicated scriptlets for normal/debug packages
c0c534
%global update_desktop_icons /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
c0c534
c0c534
c0c534
%define post_script() %{expand:
c0c534
update-desktop-database %{_datadir}/applications &> /dev/null || :
c0c534
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
c0c534
exit 0
c0c534
}
c0c534
c0c534
c0c534
%define post_headless() %{expand:
8d5b3a
%ifarch %{share_arches}
c0c534
%{jrebindir %%1}/java -Xshare:dump >/dev/null 2>/dev/null
c0c534
%endif
c0c534
c0c534
PRIORITY=%{priority}
c0c534
if [ "%1" == %{debug_suffix} ]; then
c0c534
  let PRIORITY=PRIORITY-1
c0c534
fi
c0c534
c0c534
ext=.gz
c0c534
alternatives \\
c0c534
  --install %{_bindir}/java java %{jrebindir %%1}/java $PRIORITY  --family %{name}.%{_arch} \\
c0c534
  --slave %{_jvmdir}/jre jre %{_jvmdir}/%{sdkdir %%1} \\
6e367a
  --slave %{_bindir}/%{alt_java_name} %{alt_java_name} %{jrebindir %%1}/%{alt_java_name} \\
c0c534
  --slave %{_bindir}/jjs jjs %{jrebindir %%1}/jjs \\
c0c534
  --slave %{_bindir}/keytool keytool %{jrebindir %%1}/keytool \\
c0c534
  --slave %{_bindir}/pack200 pack200 %{jrebindir %%1}/pack200 \\
c0c534
  --slave %{_bindir}/rmid rmid %{jrebindir %%1}/rmid \\
c0c534
  --slave %{_bindir}/rmiregistry rmiregistry %{jrebindir %%1}/rmiregistry \\
c0c534
  --slave %{_bindir}/unpack200 unpack200 %{jrebindir %%1}/unpack200 \\
c0c534
  --slave %{_mandir}/man1/java.1$ext java.1$ext \\
c0c534
  %{_mandir}/man1/java-%{uniquesuffix %%1}.1$ext \\
6e367a
  --slave %{_mandir}/man1/%{alt_java_name}.1$ext %{alt_java_name}.1$ext \\
6e367a
  %{_mandir}/man1/%{alt_java_name}-%{uniquesuffix %%1}.1$ext \\
c0c534
  --slave %{_mandir}/man1/jjs.1$ext jjs.1$ext \\
c0c534
  %{_mandir}/man1/jjs-%{uniquesuffix %%1}.1$ext \\
c0c534
  --slave %{_mandir}/man1/keytool.1$ext keytool.1$ext \\
c0c534
  %{_mandir}/man1/keytool-%{uniquesuffix %%1}.1$ext \\
c0c534
  --slave %{_mandir}/man1/pack200.1$ext pack200.1$ext \\
c0c534
  %{_mandir}/man1/pack200-%{uniquesuffix %%1}.1$ext \\
c0c534
  --slave %{_mandir}/man1/rmid.1$ext rmid.1$ext \\
c0c534
  %{_mandir}/man1/rmid-%{uniquesuffix %%1}.1$ext \\
c0c534
  --slave %{_mandir}/man1/rmiregistry.1$ext rmiregistry.1$ext \\
c0c534
  %{_mandir}/man1/rmiregistry-%{uniquesuffix %%1}.1$ext \\
c0c534
  --slave %{_mandir}/man1/unpack200.1$ext unpack200.1$ext \\
c0c534
  %{_mandir}/man1/unpack200-%{uniquesuffix %%1}.1$ext
c0c534
c0c534
for X in %{origin} %{javaver} ; do
c0c534
  alternatives --install %{_jvmdir}/jre-"$X" jre_"$X" %{_jvmdir}/%{sdkdir %%1} $PRIORITY --family %{name}.%{_arch}
c0c534
done
c0c534
c0c534
update-alternatives --install %{_jvmdir}/jre-%{javaver}-%{origin} jre_%{javaver}_%{origin} %{_jvmdir}/%{jrelnk %%1} $PRIORITY  --family %{name}.%{_arch}
c0c534
c0c534
c0c534
update-desktop-database %{_datadir}/applications &> /dev/null || :
c0c534
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
c0c534
c0c534
# see pretrans where this file is declared
c0c534
# also see that pretrans is only for non-debug
c0c534
if [ ! "%1" == %{debug_suffix} ]; then
c0c534
  if [ -f %{_libexecdir}/copy_jdk_configs_fixFiles.sh ] ; then
c0c534
    sh  %{_libexecdir}/copy_jdk_configs_fixFiles.sh %{rpm_state_dir}/%{name}.%{_arch}  %{_jvmdir}/%{sdkdir %%1}
c0c534
  fi
c0c534
fi
c0c534
c0c534
exit 0
c0c534
}
c0c534
c0c534
%global postun_script() %{expand:
c0c534
update-desktop-database %{_datadir}/applications &> /dev/null || :
c0c534
if [ $1 -eq 0 ] ; then
c0c534
    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
c0c534
    %{update_desktop_icons}
c0c534
fi
c0c534
exit 0
c0c534
}
c0c534
c0c534
c0c534
%global postun_headless() %{expand:
c0c534
  alternatives --remove java %{jrebindir %%1}/java
c0c534
  alternatives --remove jre_%{origin} %{_jvmdir}/%{sdkdir %%1}
c0c534
  alternatives --remove jre_%{javaver} %{_jvmdir}/%{sdkdir %%1}
c0c534
  alternatives --remove jre_%{javaver}_%{origin} %{_jvmdir}/%{jrelnk %%1}
c0c534
}
c0c534
c0c534
%global posttrans_script() %{expand:
c0c534
%{update_desktop_icons}
c0c534
}
c0c534
c0c534
%global post_devel() %{expand:
c0c534
c0c534
PRIORITY=%{priority}
c0c534
if [ "%1" == %{debug_suffix} ]; then
c0c534
  let PRIORITY=PRIORITY-1
c0c534
fi
c0c534
c0c534
ext=.gz
c0c534
alternatives \\
c0c534
  --install %{_bindir}/javac javac %{sdkbindir %%1}/javac $PRIORITY  --family %{name}.%{_arch} \\
c0c534
  --slave %{_jvmdir}/java java_sdk %{_jvmdir}/%{sdkdir %%1} \\
c0c534
%ifarch %{aot_arches}
c0c534
  --slave %{_bindir}/jaotc jaotc %{sdkbindir %%1}/jaotc \\
c0c534
%endif
c0c534
  --slave %{_bindir}/jlink jlink %{sdkbindir %%1}/jlink \\
c0c534
  --slave %{_bindir}/jmod jmod %{sdkbindir %%1}/jmod \\
8d5b3a
%ifarch %{sa_arches}
c0c534
  --slave %{_bindir}/jhsdb jhsdb %{sdkbindir %%1}/jhsdb \\
e50716
%endif
c0c534
  --slave %{_bindir}/jar jar %{sdkbindir %%1}/jar \\
c0c534
  --slave %{_bindir}/jarsigner jarsigner %{sdkbindir %%1}/jarsigner \\
c0c534
  --slave %{_bindir}/javadoc javadoc %{sdkbindir %%1}/javadoc \\
c0c534
  --slave %{_bindir}/javap javap %{sdkbindir %%1}/javap \\
c0c534
  --slave %{_bindir}/jcmd jcmd %{sdkbindir %%1}/jcmd \\
c0c534
  --slave %{_bindir}/jconsole jconsole %{sdkbindir %%1}/jconsole \\
c0c534
  --slave %{_bindir}/jdb jdb %{sdkbindir %%1}/jdb \\
c0c534
  --slave %{_bindir}/jdeps jdeps %{sdkbindir %%1}/jdeps \\
c0c534
  --slave %{_bindir}/jdeprscan jdeprscan %{sdkbindir %%1}/jdeprscan \\
f78025
  --slave %{_bindir}/jfr jfr %{sdkbindir %%1}/jfr \\
c0c534
  --slave %{_bindir}/jimage jimage %{sdkbindir %%1}/jimage \\
c0c534
  --slave %{_bindir}/jinfo jinfo %{sdkbindir %%1}/jinfo \\
c0c534
  --slave %{_bindir}/jmap jmap %{sdkbindir %%1}/jmap \\
c0c534
  --slave %{_bindir}/jps jps %{sdkbindir %%1}/jps \\
c0c534
  --slave %{_bindir}/jrunscript jrunscript %{sdkbindir %%1}/jrunscript \\
c0c534
  --slave %{_bindir}/jshell jshell %{sdkbindir %%1}/jshell \\
c0c534
  --slave %{_bindir}/jstack jstack %{sdkbindir %%1}/jstack \\
c0c534
  --slave %{_bindir}/jstat jstat %{sdkbindir %%1}/jstat \\
c0c534
  --slave %{_bindir}/jstatd jstatd %{sdkbindir %%1}/jstatd \\
c0c534
  --slave %{_bindir}/rmic rmic %{sdkbindir %%1}/rmic \\
c0c534
  --slave %{_bindir}/serialver serialver %{sdkbindir %%1}/serialver \\
c0c534
  --slave %{_mandir}/man1/jar.1$ext jar.1$ext \\
c0c534
  %{_mandir}/man1/jar-%{uniquesuffix %%1}.1$ext \\
c0c534
  --slave %{_mandir}/man1/jarsigner.1$ext jarsigner.1$ext \\
c0c534
  %{_mandir}/man1/jarsigner-%{uniquesuffix %%1}.1$ext \\
c0c534
  --slave %{_mandir}/man1/javac.1$ext javac.1$ext \\
c0c534
  %{_mandir}/man1/javac-%{uniquesuffix %%1}.1$ext \\
c0c534
  --slave %{_mandir}/man1/javadoc.1$ext javadoc.1$ext \\
c0c534
  %{_mandir}/man1/javadoc-%{uniquesuffix %%1}.1$ext \\
c0c534
  --slave %{_mandir}/man1/javap.1$ext javap.1$ext \\
c0c534
  %{_mandir}/man1/javap-%{uniquesuffix %%1}.1$ext \\
c0c534
  --slave %{_mandir}/man1/jcmd.1$ext jcmd.1$ext \\
c0c534
  %{_mandir}/man1/jcmd-%{uniquesuffix %%1}.1$ext \\
c0c534
  --slave %{_mandir}/man1/jconsole.1$ext jconsole.1$ext \\
c0c534
  %{_mandir}/man1/jconsole-%{uniquesuffix %%1}.1$ext \\
c0c534
  --slave %{_mandir}/man1/jdb.1$ext jdb.1$ext \\
c0c534
  %{_mandir}/man1/jdb-%{uniquesuffix %%1}.1$ext \\
c0c534
  --slave %{_mandir}/man1/jdeps.1$ext jdeps.1$ext \\
c0c534
  %{_mandir}/man1/jdeps-%{uniquesuffix %%1}.1$ext \\
c0c534
  --slave %{_mandir}/man1/jinfo.1$ext jinfo.1$ext \\
c0c534
  %{_mandir}/man1/jinfo-%{uniquesuffix %%1}.1$ext \\
c0c534
  --slave %{_mandir}/man1/jmap.1$ext jmap.1$ext \\
c0c534
  %{_mandir}/man1/jmap-%{uniquesuffix %%1}.1$ext \\
c0c534
  --slave %{_mandir}/man1/jps.1$ext jps.1$ext \\
c0c534
  %{_mandir}/man1/jps-%{uniquesuffix %%1}.1$ext \\
c0c534
  --slave %{_mandir}/man1/jrunscript.1$ext jrunscript.1$ext \\
c0c534
  %{_mandir}/man1/jrunscript-%{uniquesuffix %%1}.1$ext \\
c0c534
  --slave %{_mandir}/man1/jstack.1$ext jstack.1$ext \\
c0c534
  %{_mandir}/man1/jstack-%{uniquesuffix %%1}.1$ext \\
c0c534
  --slave %{_mandir}/man1/jstat.1$ext jstat.1$ext \\
c0c534
  %{_mandir}/man1/jstat-%{uniquesuffix %%1}.1$ext \\
c0c534
  --slave %{_mandir}/man1/jstatd.1$ext jstatd.1$ext \\
c0c534
  %{_mandir}/man1/jstatd-%{uniquesuffix %%1}.1$ext \\
c0c534
  --slave %{_mandir}/man1/rmic.1$ext rmic.1$ext \\
c0c534
  %{_mandir}/man1/rmic-%{uniquesuffix %%1}.1$ext \\
c0c534
  --slave %{_mandir}/man1/serialver.1$ext serialver.1$ext \\
c0c534
  %{_mandir}/man1/serialver-%{uniquesuffix %%1}.1$ext \\
c0c534
c0c534
for X in %{origin} %{javaver} ; do
c0c534
  alternatives \\
c0c534
    --install %{_jvmdir}/java-"$X" java_sdk_"$X" %{_jvmdir}/%{sdkdir %%1} $PRIORITY  --family %{name}.%{_arch}
c0c534
done
c0c534
c0c534
update-alternatives --install %{_jvmdir}/java-%{javaver}-%{origin} java_sdk_%{javaver}_%{origin} %{_jvmdir}/%{sdkdir %%1} $PRIORITY  --family %{name}.%{_arch}
c0c534
c0c534
update-desktop-database %{_datadir}/applications &> /dev/null || :
c0c534
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
c0c534
c0c534
exit 0
c0c534
}
c0c534
c0c534
%global postun_devel() %{expand:
c0c534
  alternatives --remove javac %{sdkbindir %%1}/javac
c0c534
  alternatives --remove java_sdk_%{origin} %{_jvmdir}/%{sdkdir %%1}
c0c534
  alternatives --remove java_sdk_%{javaver} %{_jvmdir}/%{sdkdir %%1}
c0c534
  alternatives --remove java_sdk_%{javaver}_%{origin} %{_jvmdir}/%{sdkdir %%1}
c0c534
c0c534
update-desktop-database %{_datadir}/applications &> /dev/null || :
c0c534
c0c534
if [ $1 -eq 0 ] ; then
c0c534
    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
c0c534
    %{update_desktop_icons}
c0c534
fi
c0c534
exit 0
c0c534
}
c0c534
c0c534
%global posttrans_devel() %{expand:
c0c534
%{update_desktop_icons}
c0c534
}
c0c534
c0c534
%global post_javadoc() %{expand:
c0c534
c0c534
PRIORITY=%{priority}
c0c534
if [ "%1" == %{debug_suffix} ]; then
c0c534
  let PRIORITY=PRIORITY-1
c0c534
fi
c0c534
c0c534
alternatives \\
c0c534
  --install %{_javadocdir}/java javadocdir %{_javadocdir}/%{uniquejavadocdir %%1}/api \\
c0c534
  $PRIORITY  --family %{name}
c0c534
exit 0
c0c534
}
c0c534
c0c534
%global postun_javadoc() %{expand:
c0c534
  alternatives --remove javadocdir %{_javadocdir}/%{uniquejavadocdir %%1}/api
c0c534
exit 0
c0c534
}
c0c534
c0c534
%global post_javadoc_zip() %{expand:
c0c534
c0c534
PRIORITY=%{priority}
c0c534
if [ "%1" == %{debug_suffix} ]; then
c0c534
  let PRIORITY=PRIORITY-1
c0c534
fi
c0c534
c0c534
alternatives \\
c0c534
  --install %{_javadocdir}/java-zip javadoczip %{_javadocdir}/%{uniquejavadocdir %%1}.zip \\
c0c534
  $PRIORITY  --family %{name}
c0c534
exit 0
c0c534
}
c0c534
c0c534
%global postun_javadoc_zip() %{expand:
c0c534
  alternatives --remove javadoczip %{_javadocdir}/%{uniquejavadocdir %%1}.zip
c0c534
exit 0
c0c534
}
c0c534
c0c534
%define files_jre() %{expand:
c0c534
%{_datadir}/icons/hicolor/*x*/apps/java-%{javaver}-%{origin}.png
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libsplashscreen.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libawt_xawt.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libjawt.so
c0c534
}
c0c534
c0c534
c0c534
%define files_jre_headless() %{expand:
c0c534
%license %{_jvmdir}/%{sdkdir %%1}/legal
eda148
%doc %{_defaultdocdir}/%{uniquejavadocdir %%1}/NEWS
c0c534
%dir %{_sysconfdir}/.java/.systemPrefs
c0c534
%dir %{_sysconfdir}/.java
c0c534
%dir %{_jvmdir}/%{sdkdir %%1}
c0c534
%{_jvmdir}/%{sdkdir %%1}/release
c0c534
%{_jvmdir}/%{jrelnk %%1}
c0c534
%dir %{_jvmdir}/%{sdkdir %%1}/bin
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/java
6e367a
%{_jvmdir}/%{sdkdir %%1}/bin/%{alt_java_name}
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/jjs
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/keytool
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/pack200
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/rmid
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/rmiregistry
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/unpack200
c0c534
%dir %{_jvmdir}/%{sdkdir %%1}/lib
c0c534
%ifarch %{jit_arches}
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/classlist
c0c534
%endif
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/jexec
3aaaac
%{_jvmdir}/%{sdkdir %%1}/lib/jspawnhelper
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/jrt-fs.jar
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/modules
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/psfont.properties.ja
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/psfontj2d.properties
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/tzdb.dat
c0c534
%dir %{_jvmdir}/%{sdkdir %%1}/lib/jli
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/jli/libjli.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/jvm.cfg
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libattach.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libawt.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libextnet.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libjsig.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libawt_headless.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libdt_socket.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libfontmanager.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libinstrument.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libj2gss.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libj2pcsc.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libj2pkcs11.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libjaas.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libjava.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libjavajpeg.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libjdwp.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libjimage.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libjsound.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/liblcms.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libmanagement.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libmanagement_agent.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libmanagement_ext.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libmlib_image.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libnet.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libnio.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libprefs.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/librmi.so
8d5b3a
# Some architectures don't have the serviceability agent
8d5b3a
%ifarch %{sa_arches}
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libsaproc.so
c0c534
%endif
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libsctp.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libsunec.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libunpack.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libverify.so
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/libzip.so
c0c534
%dir %{_jvmdir}/%{sdkdir %%1}/lib/jfr
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/jfr/default.jfc
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/jfr/profile.jfc
c0c534
%{_mandir}/man1/java-%{uniquesuffix %%1}.1*
6e367a
%{_mandir}/man1/%{alt_java_name}-%{uniquesuffix %%1}.1*
c0c534
%{_mandir}/man1/jjs-%{uniquesuffix %%1}.1*
c0c534
%{_mandir}/man1/keytool-%{uniquesuffix %%1}.1*
c0c534
%{_mandir}/man1/pack200-%{uniquesuffix %%1}.1*
c0c534
%{_mandir}/man1/rmid-%{uniquesuffix %%1}.1*
c0c534
%{_mandir}/man1/rmiregistry-%{uniquesuffix %%1}.1*
c0c534
%{_mandir}/man1/unpack200-%{uniquesuffix %%1}.1*
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/server/
8d5b3a
%ifarch %{share_arches}
c0c534
%attr(444, root, root) %ghost %{_jvmdir}/%{sdkdir %%1}/lib/server/classes.jsa
c0c534
%endif
c0c534
%dir %{_jvmdir}/%{sdkdir %%1}/lib/security
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/security/cacerts
c0c534
%dir %{_jvmdir}/%{sdkdir %%1}/conf
c0c534
%dir %{_jvmdir}/%{sdkdir %%1}/conf/management
c0c534
%dir %{_jvmdir}/%{sdkdir %%1}/conf/security
c0c534
%dir %{_jvmdir}/%{sdkdir %%1}/conf/security/policy
c0c534
%dir %{_jvmdir}/%{sdkdir %%1}/conf/security/policy/limited
c0c534
%dir %{_jvmdir}/%{sdkdir %%1}/conf/security/policy/unlimited
c0c534
%config(noreplace) %{_jvmdir}/%{sdkdir %%1}/lib/security/default.policy
c0c534
%config(noreplace) %{_jvmdir}/%{sdkdir %%1}/lib/security/blacklisted.certs
c0c534
%config(noreplace) %{_jvmdir}/%{sdkdir %%1}/lib/security/public_suffix_list.dat
c0c534
%config(noreplace) %{_jvmdir}/%{sdkdir %%1}/conf/security/policy/limited/exempt_local.policy
c0c534
%config(noreplace) %{_jvmdir}/%{sdkdir %%1}/conf/security/policy/limited/default_local.policy
c0c534
%config(noreplace) %{_jvmdir}/%{sdkdir %%1}/conf/security/policy/limited/default_US_export.policy
c0c534
%config(noreplace) %{_jvmdir}/%{sdkdir %%1}/conf/security/policy/unlimited/default_local.policy
c0c534
%config(noreplace) %{_jvmdir}/%{sdkdir %%1}/conf/security/policy/unlimited/default_US_export.policy
c0c534
 %{_jvmdir}/%{sdkdir %%1}/conf/security/policy/README.txt
c0c534
%config(noreplace) %{_jvmdir}/%{sdkdir %%1}/conf/security/java.policy
c0c534
%config(noreplace) %{_jvmdir}/%{sdkdir %%1}/conf/security/java.security
c0c534
%config(noreplace) %{_jvmdir}/%{sdkdir %%1}/conf/logging.properties
c0c534
%config(noreplace) %{_jvmdir}/%{sdkdir %%1}/conf/security/nss.cfg
c0c534
%config(noreplace) %{_jvmdir}/%{sdkdir %%1}/conf/management/jmxremote.access
ac0427
# This is a configuration template and thus not config-noreplace
c0c534
%config  %{_jvmdir}/%{sdkdir %%1}/conf/management/jmxremote.password.template
c0c534
%config(noreplace) %{_jvmdir}/%{sdkdir %%1}/conf/management/management.properties
c0c534
%config(noreplace) %{_jvmdir}/%{sdkdir %%1}/conf/net.properties
c0c534
%config(noreplace) %{_jvmdir}/%{sdkdir %%1}/conf/sound.properties
c0c534
}
c0c534
c0c534
%global files_devel() %{expand:
c0c534
%dir %{_jvmdir}/%{sdkdir %%1}/bin
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/jar
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/jarsigner
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/javac
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/javadoc
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/javap
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/jconsole
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/jcmd
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/jdb
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/jdeps
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/jdeprscan
f78025
%{_jvmdir}/%{sdkdir %%1}/bin/jfr
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/jimage
8d5b3a
# Some architectures don't have the serviceability agent
8d5b3a
%ifarch %{sa_arches}
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/jhsdb
c0c534
%endif
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/jinfo
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/jlink
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/jmap
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/jmod
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/jps
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/jrunscript
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/jshell
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/jstack
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/jstat
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/jstatd
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/rmic
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/serialver
c0c534
%ifarch %{aot_arches}
c0c534
%{_jvmdir}/%{sdkdir %%1}/bin/jaotc
c0c534
%endif
c0c534
%{_jvmdir}/%{sdkdir %%1}/include
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/ct.sym
c0c534
%if %{with_systemtap}
c0c534
%{_jvmdir}/%{sdkdir %%1}/tapset
c0c534
%endif
c0c534
%{_datadir}/applications/*jconsole%1.desktop
c0c534
%{_mandir}/man1/jar-%{uniquesuffix %%1}.1*
c0c534
%{_mandir}/man1/jarsigner-%{uniquesuffix %%1}.1*
c0c534
%{_mandir}/man1/javac-%{uniquesuffix %%1}.1*
c0c534
%{_mandir}/man1/javadoc-%{uniquesuffix %%1}.1*
c0c534
%{_mandir}/man1/javap-%{uniquesuffix %%1}.1*
c0c534
%{_mandir}/man1/jconsole-%{uniquesuffix %%1}.1*
c0c534
%{_mandir}/man1/jcmd-%{uniquesuffix %%1}.1*
c0c534
%{_mandir}/man1/jdb-%{uniquesuffix %%1}.1*
c0c534
%{_mandir}/man1/jdeps-%{uniquesuffix %%1}.1*
c0c534
%{_mandir}/man1/jinfo-%{uniquesuffix %%1}.1*
c0c534
%{_mandir}/man1/jmap-%{uniquesuffix %%1}.1*
c0c534
%{_mandir}/man1/jps-%{uniquesuffix %%1}.1*
c0c534
%{_mandir}/man1/jrunscript-%{uniquesuffix %%1}.1*
c0c534
%{_mandir}/man1/jstack-%{uniquesuffix %%1}.1*
c0c534
%{_mandir}/man1/jstat-%{uniquesuffix %%1}.1*
c0c534
%{_mandir}/man1/jstatd-%{uniquesuffix %%1}.1*
c0c534
%{_mandir}/man1/rmic-%{uniquesuffix %%1}.1*
c0c534
%{_mandir}/man1/serialver-%{uniquesuffix %%1}.1*
c0c534
%if %{with_systemtap}
c0c534
%dir %{tapsetroot}
c0c534
%dir %{tapsetdirttapset}
c0c534
%dir %{tapsetdir}
c0c534
%{tapsetdir}/*%{_arch}%1.stp
c0c534
%endif
c0c534
}
c0c534
c0c534
%define files_jmods() %{expand:
c0c534
%{_jvmdir}/%{sdkdir %%1}/jmods
c0c534
}
c0c534
c0c534
%define files_demo() %{expand:
c0c534
%license %{_jvmdir}/%{sdkdir %%1}/legal
c0c534
%{_jvmdir}/%{sdkdir %%1}/demo
c0c534
%{_jvmdir}/%{sdkdir %%1}/sample
c0c534
}
c0c534
c0c534
%define files_src() %{expand:
c0c534
%license %{_jvmdir}/%{sdkdir %%1}/legal
c0c534
%{_jvmdir}/%{sdkdir %%1}/lib/src.zip
c0c534
}
c0c534
07b2a4
%define files_static_libs() %{expand:
d5c0b6
%dir %{_jvmdir}/%{sdkdir %%1}/lib/static
d5c0b6
%dir %{_jvmdir}/%{sdkdir %%1}/lib/static/linux-%{archinstall}
d5c0b6
%dir %{_jvmdir}/%{sdkdir %%1}/lib/static/linux-%{archinstall}/glibc
8d5b3a
%{_jvmdir}/%{sdkdir %%1}/lib/static/linux-%{archinstall}/glibc/lib*.a
07b2a4
}
07b2a4
c0c534
%define files_javadoc() %{expand:
c0c534
%doc %{_javadocdir}/%{uniquejavadocdir %%1}
d5c0b6
%license %{_jvmdir}/%{sdkdir %%1}/legal
c0c534
}
c0c534
c0c534
%define files_javadoc_zip() %{expand:
c0c534
%doc %{_javadocdir}/%{uniquejavadocdir %%1}.zip
d5c0b6
%license %{_jvmdir}/%{sdkdir %%1}/legal
c0c534
}
c0c534
c0c534
# not-duplicated requires/provides/obsolate for normal/debug packages
c0c534
%global java_rpo() %{expand:
c0c534
Requires: fontconfig%{?_isa}
c0c534
Requires: xorg-x11-fonts-Type1
c0c534
# Requires rest of java
c0c534
Requires: %{name}-headless%1%{?_isa} = %{epoch}:%{version}-%{release}
c0c534
OrderWithRequires: %{name}-headless%1%{?_isa} = %{epoch}:%{version}-%{release}
c0c534
# for java-X-openjdk package's desktop binding
ac0427
# rhel7 do not have weak dependencies
ac0427
%if 0%{?rhel} >= 8
ac0427
Recommends: gtk3%{?_isa}
ac0427
%endif
c0c534
c0c534
Provides: java-%{javaver}-%{origin}%1 = %{epoch}:%{version}-%{release}
c0c534
c0c534
# Standard JPackage base provides
e50716
#Provides: jre = %{javaver}%1
e50716
#Provides: jre-%{origin}%1 = %{epoch}:%{version}-%{release}
c0c534
Provides: jre-%{javaver}%1 = %{epoch}:%{version}-%{release}
c0c534
Provides: jre-%{javaver}-%{origin}%1 = %{epoch}:%{version}-%{release}
c0c534
Provides: java-%{javaver}%1 = %{epoch}:%{version}-%{release}
e50716
#Provides: java-%{origin}%1 = %{epoch}:%{version}-%{release}
e50716
#Provides: java%1 = %{epoch}:%{javaver}
c0c534
}
c0c534
c0c534
%global java_headless_rpo() %{expand:
c0c534
# Require /etc/pki/java/cacerts
c0c534
Requires: ca-certificates
c0c534
# Require jpackage-utils for ownership of /usr/lib/jvm/ and macros
c0c534
Requires: javapackages-tools
c0c534
# Require zone-info data provided by tzdata-java sub-package
438e03
# 2020f required as of JDK-8259048 in October CPU
438e03
Requires: tzdata-java >= 2020f
b76b7f
# for support of kernel stream control
c0c534
# libsctp.so.1 is being `dlopen`ed on demand
ac0427
%if 0%{?rhel} >= 8
ac0427
Suggests: lksctp-tools%{?_isa}, pcsc-lite-libs%{?_isa}
ac0427
%else
c0c534
Requires: lksctp-tools%{?_isa}
b76b7f
# For smartcard support
b76b7f
# libpcsclite.so & libpcsclite.so.1 are both tried for dlopen
b76b7f
# and this package provides the latter (see RH910107)
b76b7f
Requires: pcsc-lite-libs%{?_isa}
ac0427
%endif
c0c534
# tool to copy jdk's configs - should be Recommends only, but then only dnf/yum enforce it,
c0c534
# not rpm transaction and so no configs are persisted when pure rpm -u is run. It may be
c0c534
# considered as regression
c0c534
Requires: copy-jdk-configs >= 3.3
c0c534
OrderWithRequires: copy-jdk-configs
b76b7f
# for printing support
b76b7f
Requires: cups-libs%{?_isa}
c0c534
# Post requires alternatives to install tool alternatives
c0c534
Requires(post):   %{_sbindir}/alternatives
c0c534
# in version 1.7 and higher for --family switch
c0c534
Requires(post):   chkconfig >= 1.7
c0c534
# Postun requires alternatives to uninstall tool alternatives
c0c534
Requires(postun): %{_sbindir}/alternatives
c0c534
# in version 1.7 and higher for --family switch
c0c534
Requires(postun):   chkconfig >= 1.7
b76b7f
b76b7f
# rhel7 do not have weak depndencies
c0c534
c0c534
# Standard JPackage base provides
e50716
#Provides: jre-headless%1 = %{epoch}:%{javaver}
c0c534
Provides: jre-%{javaver}-%{origin}-headless%1 = %{epoch}:%{version}-%{release}
e50716
#Provides: jre-%{origin}-headless%1 = %{epoch}:%{version}-%{release}
c0c534
Provides: jre-%{javaver}-headless%1 = %{epoch}:%{version}-%{release}
c0c534
Provides: java-%{javaver}-%{origin}-headless%1 = %{epoch}:%{version}-%{release}
c0c534
Provides: java-%{javaver}-headless%1 = %{epoch}:%{version}-%{release}
e50716
#Provides: java-%{origin}-headless%1 = %{epoch}:%{version}-%{release}
e50716
#Provides: java-headless%1 = %{epoch}:%{javaver}
c0c534
c0c534
# https://bugzilla.redhat.com/show_bug.cgi?id=1312019
c0c534
Provides: /usr/bin/jjs
c0c534
c0c534
}
c0c534
c0c534
%global java_devel_rpo() %{expand:
c0c534
# Require base package
c0c534
Requires:         %{name}%1%{?_isa} = %{epoch}:%{version}-%{release}
c0c534
OrderWithRequires: %{name}-headless%1%{?_isa} = %{epoch}:%{version}-%{release}
c0c534
# Post requires alternatives to install tool alternatives
c0c534
Requires(post):   %{_sbindir}/alternatives
c0c534
# in version 1.7 and higher for --family switch
c0c534
Requires(post):   chkconfig >= 1.7
c0c534
# Postun requires alternatives to uninstall tool alternatives
c0c534
Requires(postun): %{_sbindir}/alternatives
c0c534
# in version 1.7 and higher for --family switch
c0c534
Requires(postun):   chkconfig >= 1.7
c0c534
c0c534
# Standard JPackage devel provides
c0c534
Provides: java-sdk-%{javaver}-%{origin}%1 = %{epoch}:%{version}
c0c534
Provides: java-sdk-%{javaver}%1 = %{epoch}:%{version}
c0c534
#Provides: java-sdk-%{origin}%1 = %{epoch}:%{version}
c0c534
#Provides: java-sdk%1 = %{epoch}:%{javaver}
c0c534
Provides: java-%{javaver}-devel%1 = %{epoch}:%{version}
c0c534
Provides: java-%{javaver}-%{origin}-devel%1 = %{epoch}:%{version}
c0c534
#Provides: java-devel-%{origin}%1 = %{epoch}:%{version}
c0c534
#Provides: java-devel%1 = %{epoch}:%{javaver}
c0c534
c0c534
}
c0c534
07b2a4
%define java_static_libs_rpo() %{expand:
07b2a4
Requires:         %{name}-devel%{?1}%{?_isa} = %{epoch}:%{version}-%{release}
07b2a4
OrderWithRequires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release}
07b2a4
}
07b2a4
c0c534
%define java_jmods_rpo() %{expand:
c0c534
# Requires devel package
c0c534
# as jmods are bytecode, they should be OK without any _isa
c0c534
Requires:         %{name}-devel%1 = %{epoch}:%{version}-%{release}
c0c534
OrderWithRequires: %{name}-headless%1 = %{epoch}:%{version}-%{release}
c0c534
c0c534
Provides: java-jmods%1 = %{epoch}:%{version}-%{release}
c0c534
Provides: java-%{javaver}-jmods%1 = %{epoch}:%{version}-%{release}
c0c534
Provides: java-%{javaver}-%{origin}-jmods%1 = %{epoch}:%{version}-%{release}
c0c534
c0c534
}
c0c534
c0c534
%global java_demo_rpo() %{expand:
c0c534
Requires: %{name}%1%{?_isa} = %{epoch}:%{version}-%{release}
c0c534
OrderWithRequires: %{name}-headless%1%{?_isa} = %{epoch}:%{version}-%{release}
c0c534
c0c534
Provides: java-demo%1 = %{epoch}:%{version}-%{release}
c0c534
Provides: java-%{javaver}-demo%1 = %{epoch}:%{version}-%{release}
c0c534
Provides: java-%{javaver}-%{origin}-demo%1 = %{epoch}:%{version}-%{release}
c0c534
c0c534
}
c0c534
c0c534
%global java_javadoc_rpo() %{expand:
c0c534
OrderWithRequires: %{name}-headless%1%{?_isa} = %{epoch}:%{version}-%{release}
c0c534
# Post requires alternatives to install javadoc alternative
c0c534
Requires(post):   %{_sbindir}/alternatives
c0c534
# in version 1.7 and higher for --family switch
c0c534
Requires(post):   chkconfig >= 1.7
c0c534
# Postun requires alternatives to uninstall javadoc alternative
c0c534
Requires(postun): %{_sbindir}/alternatives
c0c534
# in version 1.7 and higher for --family switch
c0c534
Requires(postun):   chkconfig >= 1.7
c0c534
c0c534
# Standard JPackage javadoc provides.
c0c534
Provides: java-javadoc%1 = %{epoch}:%{version}-%{release}
c0c534
Provides: java-%{javaver}-javadoc%1 = %{epoch}:%{version}-%{release}
c0c534
Provides: java-%{javaver}-%{origin}-javadoc%1 = %{epoch}:%{version}-%{release}
c0c534
}
c0c534
c0c534
%global java_src_rpo() %{expand:
c0c534
Requires: %{name}-headless%1%{?_isa} = %{epoch}:%{version}-%{release}
c0c534
c0c534
# Standard JPackage sources provides.
c0c534
Provides: java-src%1 = %{epoch}:%{version}-%{release}
c0c534
Provides: java-%{javaver}-src%1 = %{epoch}:%{version}-%{release}
c0c534
Provides: java-%{javaver}-%{origin}-src%1 = %{epoch}:%{version}-%{release}
c0c534
}
c0c534
c0c534
# Prevent brp-java-repack-jars from being run.
c0c534
%global __jar_repack 0
c0c534
c0c534
Name:    java-%{javaver}-%{origin}
c0c534
Version: %{newjavaver}.%{buildver}
3aaaac
Release: %{?eaprefix}%{rpmrelease}%{?extraver}%{?dist}
c0c534
# java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons
c0c534
# and this change was brought into RHEL-4. java-1.5.0-ibm packages
c0c534
# also included the epoch in their virtual provides. This created a
c0c534
# situation where in-the-wild java-1.5.0-ibm packages provided "java =
c0c534
# 1:1.5.0". In RPM terms, "1.6.0 < 1:1.5.0" since 1.6.0 is
c0c534
# interpreted as 0:1.6.0. So the "java >= 1.6.0" requirement would be
c0c534
# satisfied by the 1:1.5.0 packages. Thus we need to set the epoch in
c0c534
# JDK package >= 1.6.0 to 1, and packages referring to JDK virtual
c0c534
# provides >= 1.6.0 must specify the epoch, "java >= 1:1.6.0".
c0c534
c0c534
Epoch:   1
20ef41
Summary: %{origin_nice} %{featurever} Runtime Environment
ac0427
%if 0%{?rhel} <= 8
c0c534
Group:   Development/Languages
ac0427
%endif
c0c534
c0c534
# HotSpot code is licensed under GPLv2
c0c534
# JDK library code is licensed under GPLv2 with the Classpath exception
c0c534
# The Apache license is used in code taken from Apache projects (primarily xalan & xerces)
c0c534
# DOM levels 2 & 3 and the XML digital signature schemas are licensed under the W3C Software License
c0c534
# The JSR166 concurrency code is in the public domain
c0c534
# The BSD and MIT licenses are used for a number of third-party libraries (see ADDITIONAL_LICENSE_INFO)
c0c534
# The OpenJDK source tree includes:
c0c534
# - JPEG library (IJG), zlib & libpng (zlib), giflib (MIT), harfbuzz (ISC),
c0c534
# - freetype (FTL), jline (BSD) and LCMS (MIT)
c0c534
# - jquery (MIT), jdk.crypto.cryptoki PKCS 11 wrapper (RSA)
c0c534
# - public_suffix_list.dat from publicsuffix.org (MPLv2.0)
c0c534
# The test code includes copies of NSS under the Mozilla Public License v2.0
c0c534
# The PCSClite headers are under a BSD with advertising license
c0c534
# The elliptic curve cryptography (ECC) source code is licensed under the LGPLv2.1 or any later version
c0c534
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
c0c534
URL:      http://openjdk.java.net/
c0c534
c0c534
07b2a4
# to regenerate source0 (jdk) run update_package.sh
c0c534
# update_package.sh contains hard-coded repos, revisions, tags, and projects to regenerate the source archives
20ef41
Source0: jdk-updates-jdk%{featurever}u-jdk-%{filever}+%{buildver}%{?tagsuffix:-%{tagsuffix}}-4curve.tar.xz
07b2a4
07b2a4
# Use 'icedtea_sync.sh' to update the following
07b2a4
# They are based on code contained in the IcedTea project (3.x).
07b2a4
# Systemtap tapsets. Zipped up to keep it small.
07b2a4
Source8: tapsets-icedtea-%{icedteaver}.tar.xz
c0c534
c0c534
# Desktop files. Adapted from IcedTea
c0c534
Source9: jconsole.desktop.in
c0c534
eda148
# Release notes
eda148
Source10: NEWS
eda148
c0c534
# nss configuration file
c0c534
Source11: nss.cfg.in
c0c534
c0c534
# Removed libraries that we link instead
c0c534
Source12: remove-intree-libraries.sh
c0c534
c0c534
# Ensure we aren't using the limited crypto policy
c0c534
Source13: TestCryptoLevel.java
c0c534
c0c534
# Ensure ECDSA is working
c0c534
Source14: TestECDSA.java
c0c534
8d5b3a
# Ensure vendor settings are correct
8d5b3a
Source15: CheckVendor.java
8d5b3a
c0c534
############################################
c0c534
#
c0c534
# RPM/distribution specific patches
c0c534
#
c0c534
############################################
c0c534
c0c534
# NSS via SunPKCS11 Provider (disabled comment
c0c534
# due to memory leak).
c82467
Patch1000: rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch
c0c534
c0c534
# Ignore AWTError when assistive technologies are loaded
c82467
Patch1:    rh1648242-accessible_toolkit_crash_do_not_break_jvm.patch
c0c534
# Restrict access to java-atk-wrapper classes
c82467
Patch2:    rh1648644-java_access_bridge_privileged_security.patch
c82467
Patch3:    rh649512-remove_uses_of_far_in_jpeg_libjpeg_turbo_1_4_compat_for_jdk10_and_up.patch
c0c534
# Follow system wide crypto policy RHBZ#1249083
c82467
Patch4:    pr3183-rh1340845-support_fedora_rhel_system_crypto_policy.patch
20ef41
# RH1750419: Enable build of speculative store bypass hardened alt-java (CVE-2018-3639)
20ef41
Patch600: rh1750419-redhat_alt_java.patch
c82467
c82467
#############################################
c82467
#
d00a18
# Shenandoah specific patches
c82467
#
c82467
#############################################
c0c534
c0c534
#############################################
c0c534
#
c0c534
# OpenJDK specific patches
c0c534
#
c0c534
#############################################
c0c534
b76b7f
# JDK-8009550, RH910107: Search for libpcsclite.so.1 if libpcsclite.so fails
b76b7f
Patch7: jdk8009550-rh910107-search_for_versioned_libpcsclite.patch
e50716
e50716
#############################################
e50716
#
e50716
# JDK 9+ only patches
e50716
#
e50716
#############################################
e50716
07b2a4
#############################################
07b2a4
#
438e03
# Patches appearing in 11.0.12
07b2a4
#
07b2a4
# This section includes patches which are present
07b2a4
# in the listed OpenJDK 8u release and should be
07b2a4
# able to be removed once that release is out
07b2a4
# and used by this RPM.
07b2a4
#############################################
07b2a4
c0c534
BuildRequires: autoconf
c0c534
BuildRequires: automake
c0c534
BuildRequires: alsa-lib-devel
c0c534
BuildRequires: binutils
c0c534
BuildRequires: cups-devel
c0c534
BuildRequires: desktop-file-utils
c0c534
# elfutils only are OK for build without AOT
c0c534
BuildRequires: elfutils-devel
c0c534
BuildRequires: fontconfig
c0c534
BuildRequires: freetype-devel
c0c534
BuildRequires: giflib-devel
c0c534
BuildRequires: gcc-c++
c0c534
BuildRequires: gdb
c0c534
BuildRequires: gtk2-devel
c0c534
# LCMS on rhel7 is older then LCMS in intree JDK
c0c534
BuildRequires: lcms2-devel
c0c534
BuildRequires: libjpeg-devel
c0c534
BuildRequires: libpng-devel
c0c534
BuildRequires: libxslt
c0c534
BuildRequires: libX11-devel
c0c534
BuildRequires: libXi-devel
c0c534
BuildRequires: libXinerama-devel
c0c534
BuildRequires: libXt-devel
c0c534
BuildRequires: libXtst-devel
c0c534
# Requirements for setting up the nss.cfg
c0c534
BuildRequires: nss-devel
c0c534
BuildRequires: pkgconfig
c0c534
BuildRequires: xorg-x11-proto-devel
c0c534
BuildRequires: zip
c0c534
BuildRequires: javapackages-tools
b76b7f
BuildRequires: java-%{buildjdkver}-openjdk-devel
c0c534
# Zero-assembler build requirement
c0c534
%ifnarch %{jit_arches}
c0c534
BuildRequires: libffi-devel
c0c534
%endif
438e03
# 2020f required as of JDK-8259048 in October CPU
438e03
BuildRequires: tzdata-java >= 2020f
c0c534
# Earlier versions have a bug in tree vectorization on PPC
c0c534
BuildRequires: gcc >= 4.8.3-8
c0c534
c0c534
%if %{with_systemtap}
c0c534
BuildRequires: systemtap-sdt-devel
c0c534
%endif
c0c534
c0c534
# this is always built, also during debug-only build
c0c534
# when it is built in debug-only this package is just placeholder
c0c534
%{java_rpo %{nil}}
c0c534
c0c534
%description
20ef41
The %{origin_nice} %{featurever} runtime environment.
c0c534
c0c534
%if %{include_debug_build}
c0c534
%package debug
20ef41
Summary: %{origin_nice} %{featurever} Runtime Environment %{debug_on}
ac0427
%if 0%{?rhel} <= 8
c0c534
Group:   Development/Languages
ac0427
%endif
c0c534
c0c534
%{java_rpo -- %{debug_suffix_unquoted}}
c0c534
%description debug
20ef41
The %{origin_nice} %{featurever} runtime environment.
c0c534
%{debug_warning}
c0c534
%endif
c0c534
c0c534
%if %{include_normal_build}
c0c534
%package headless
20ef41
Summary: %{origin_nice} %{featurever} Headless Runtime Environment
ac0427
%if 0%{?rhel} <= 8
c0c534
Group:   Development/Languages
ac0427
%endif
c0c534
c0c534
%{java_headless_rpo %{nil}}
c0c534
c0c534
%description headless
20ef41
The %{origin_nice} %{featurever} runtime environment without audio and video support.
c0c534
%endif
c0c534
c0c534
%if %{include_debug_build}
c0c534
%package headless-debug
20ef41
Summary: %{origin_nice} %{featurever} Runtime Environment %{debug_on}
ac0427
%if 0%{?rhel} <= 8
c0c534
Group:   Development/Languages
ac0427
%endif
c0c534
c0c534
%{java_headless_rpo -- %{debug_suffix_unquoted}}
c0c534
c0c534
%description headless-debug
20ef41
The %{origin_nice} %{featurever} runtime environment without audio and video support.
c0c534
%{debug_warning}
c0c534
%endif
c0c534
c0c534
%if %{include_normal_build}
c0c534
%package devel
20ef41
Summary: %{origin_nice} %{featurever} Development Environment
ac0427
%if 0%{?rhel} <= 8
c0c534
Group:   Development/Tools
ac0427
%endif
c0c534
c0c534
%{java_devel_rpo %{nil}}
c0c534
c0c534
%description devel
20ef41
The %{origin_nice} %{featurever} development tools.
c0c534
%endif
c0c534
c0c534
%if %{include_debug_build}
c0c534
%package devel-debug
20ef41
Summary: %{origin_nice} %{featurever} Development Environment %{debug_on}
ac0427
%if 0%{?rhel} <= 8
c0c534
Group:   Development/Tools
ac0427
%endif
c0c534
c0c534
%{java_devel_rpo -- %{debug_suffix_unquoted}}
c0c534
c0c534
%description devel-debug
20ef41
The %{origin_nice} %{featurever} development tools.
c0c534
%{debug_warning}
c0c534
%endif
c0c534
438e03
%if %{include_staticlibs}
438e03
c0c534
%if %{include_normal_build}
07b2a4
%package static-libs
20ef41
Summary: %{origin_nice} %{featurever} libraries for static linking
07b2a4
07b2a4
%{java_static_libs_rpo %{nil}}
07b2a4
07b2a4
%description static-libs
20ef41
The %{origin_nice} %{featurever} libraries for static linking.
07b2a4
%endif
07b2a4
07b2a4
%if %{include_debug_build}
07b2a4
%package static-libs-debug
20ef41
Summary: %{origin_nice} %{featurever} libraries for static linking %{debug_on}
07b2a4
07b2a4
%{java_static_libs_rpo -- %{debug_suffix_unquoted}}
07b2a4
07b2a4
%description static-libs-debug
20ef41
The %{origin_nice} %{featurever} libraries for static linking.
07b2a4
%{debug_warning}
07b2a4
%endif
07b2a4
438e03
# staticlibs
438e03
%endif
438e03
07b2a4
%if %{include_normal_build}
c0c534
%package jmods
20ef41
Summary: JMods for %{origin_nice} %{featurever}
ac0427
%if 0%{?rhel} <= 8
c0c534
Group:   Development/Tools
ac0427
%endif
c0c534
c0c534
%{java_jmods_rpo %{nil}}
c0c534
c0c534
%description jmods
20ef41
The JMods for %{origin_nice} %{featurever}.
c0c534
%endif
c0c534
c0c534
%if %{include_debug_build}
c0c534
%package jmods-debug
20ef41
Summary: JMods for %{origin_nice} %{featurever} %{debug_on}
ac0427
%if 0%{?rhel} <= 8
c0c534
Group:   Development/Tools
ac0427
%endif
c0c534
c0c534
%{java_jmods_rpo -- %{debug_suffix_unquoted}}
c0c534
c0c534
%description jmods-debug
20ef41
The JMods for %{origin_nice} %{featurever}.
c0c534
%{debug_warning}
c0c534
%endif
c0c534
c0c534
%if %{include_normal_build}
c0c534
%package demo
20ef41
Summary: %{origin_nice} %{featurever} Demos
ac0427
%if 0%{?rhel} <= 8
c0c534
Group:   Development/Languages
ac0427
%endif
c0c534
c0c534
%{java_demo_rpo %{nil}}
c0c534
c0c534
%description demo
20ef41
The %{origin_nice} %{featurever} demos.
c0c534
%endif
c0c534
c0c534
%if %{include_debug_build}
c0c534
%package demo-debug
20ef41
Summary: %{origin_nice} %{featurever} Demos %{debug_on}
ac0427
%if 0%{?rhel} <= 8
c0c534
Group:   Development/Languages
ac0427
%endif
c0c534
c0c534
%{java_demo_rpo -- %{debug_suffix_unquoted}}
c0c534
c0c534
%description demo-debug
20ef41
The %{origin_nice} %{featurever} demos.
c0c534
%{debug_warning}
c0c534
%endif
c0c534
c0c534
%if %{include_normal_build}
c0c534
%package src
20ef41
Summary: %{origin_nice} %{featurever} Source Bundle
ac0427
%if 0%{?rhel} <= 8
c0c534
Group:   Development/Languages
ac0427
%endif
c0c534
c0c534
%{java_src_rpo %{nil}}
c0c534
c0c534
%description src
20ef41
The %{compatiblename}-src sub-package contains the complete %{origin_nice} %{featurever}
20ef41
 class library source code for use by IDE indexers and debuggers.
c0c534
%endif
c0c534
c0c534
%if %{include_debug_build}
c0c534
%package src-debug
20ef41
Summary: %{origin_nice} %{featurever} Source Bundle %{for_debug}
ac0427
%if 0%{?rhel} <= 8
c0c534
Group:   Development/Languages
ac0427
%endif
c0c534
c0c534
%{java_src_rpo -- %{debug_suffix_unquoted}}
c0c534
c0c534
%description src-debug
20ef41
The %{compatiblename}-src-debug sub-package contains the complete %{origin_nice} %{featurever}
20ef41
 class library source code for use by IDE indexers and debuggers, %{for_debug}.
c0c534
%endif
c0c534
c0c534
%if %{include_normal_build}
c0c534
%package javadoc
20ef41
Summary: %{origin_nice} %{featurever} API documentation
ac0427
%if 0%{?rhel} <= 8
c0c534
Group:   Documentation
ac0427
%endif
c0c534
Requires: javapackages-tools
c0c534
c0c534
%{java_javadoc_rpo %{nil}}
c0c534
c0c534
%description javadoc
20ef41
The %{origin_nice} %{featurever} API documentation.
c0c534
%endif
c0c534
c0c534
%if %{include_normal_build}
c0c534
%package javadoc-zip
20ef41
Summary: %{origin_nice} %{featurever} API documentation compressed in a single archive
ac0427
%if 0%{?rhel} <= 8
c0c534
Group:   Documentation
ac0427
%endif
c0c534
Requires: javapackages-tools
c0c534
c0c534
%{java_javadoc_rpo %{nil}}
c0c534
c0c534
%description javadoc-zip
20ef41
The %{origin_nice} %{featurever} API documentation compressed in a single archive.
c0c534
%endif
c0c534
c0c534
%if %{include_debug_build}
c0c534
%package javadoc-debug
20ef41
Summary: %{origin_nice} %{featurever} API documentation %{for_debug}
ac0427
%if 0%{?rhel} <= 8
c0c534
Group:   Documentation
ac0427
%endif
c0c534
Requires: javapackages-tools
c0c534
c0c534
%{java_javadoc_rpo -- %{debug_suffix_unquoted}}
c0c534
c0c534
%description javadoc-debug
20ef41
The %{origin_nice} %{featurever} API documentation %{for_debug}.
c0c534
%endif
c0c534
c0c534
%if %{include_debug_build}
c0c534
%package javadoc-zip-debug
20ef41
Summary: %{origin_nice} %{featurever} API documentation compressed in a single archive %{for_debug}
ac0427
%if 0%{?rhel} <= 8
c0c534
Group:   Documentation
ac0427
%endif
c0c534
Requires: javapackages-tools
c0c534
c0c534
%{java_javadoc_rpo -- %{debug_suffix_unquoted}}
c0c534
c0c534
%description javadoc-zip-debug
20ef41
The %{origin_nice} %{featurever} API documentation compressed in a single archive %{for_debug}.
c0c534
%endif
c0c534
c0c534
%prep
07b2a4
07b2a4
# Using the echo macro breaks rpmdev-bumpspec, as it parses the first line of stdout :-(
07b2a4
%if 0%{?stapinstall:1}
07b2a4
  echo "CPU: %{_target_cpu}, arch install directory: %{archinstall}, SystemTap install directory: %{stapinstall}"
07b2a4
%else
07b2a4
  %{error:Unrecognised architecture %{_target_cpu}}
07b2a4
%endif
07b2a4
c0c534
if [ %{include_normal_build} -eq 0 -o  %{include_normal_build} -eq 1 ] ; then
c0c534
  echo "include_normal_build is %{include_normal_build}"
c0c534
else
c0c534
  echo "include_normal_build is %{include_normal_build}, thats invalid. Use 1 for yes or 0 for no"
c0c534
  exit 11
c0c534
fi
c0c534
if [ %{include_debug_build} -eq 0 -o  %{include_debug_build} -eq 1 ] ; then
c0c534
  echo "include_debug_build is %{include_debug_build}"
c0c534
else
c0c534
  echo "include_debug_build is %{include_debug_build}, thats invalid. Use 1 for yes or 0 for no"
c0c534
  exit 12
c0c534
fi
c0c534
if [ %{include_debug_build} -eq 0 -a  %{include_normal_build} -eq 0 ] ; then
c0c534
  echo "You have disabled both include_debug_build and include_normal_build. That is a no go."
c0c534
  exit 13
c0c534
fi
3aaaac
if [ %{include_normal_build} -eq 0 ] ; then
3aaaac
  echo "You have disabled the normal build, but this is required to provide docs for the debug build."
3aaaac
  exit 14
3aaaac
fi
c0c534
%setup -q -c -n %{uniquesuffix ""} -T -a 0
c0c534
# https://bugzilla.redhat.com/show_bug.cgi?id=1189084
c0c534
prioritylength=`expr length %{priority}`
c0c534
if [ $prioritylength -ne 7 ] ; then
c0c534
 echo "priority must be 7 digits in total, violated"
c0c534
 exit 14
c0c534
fi
c0c534
c0c534
# OpenJDK patches
438e03
# Remove libraries that are linked by both static and dynamic builds
438e03
sh %{SOURCE12} %{top_level_dir_name}
c0c534
438e03
# Patch the JDK
c0c534
pushd %{top_level_dir_name}
c0c534
%patch1 -p1
c0c534
%patch2 -p1
c0c534
%patch3 -p1
c0c534
%patch4 -p1
b76b7f
%patch7 -p1
c0c534
popd # openjdk
c0c534
c0c534
%patch1000
20ef41
%patch600
c0c534
c0c534
# Extract systemtap tapsets
c0c534
%if %{with_systemtap}
c0c534
tar --strip-components=1 -x -I xz -f %{SOURCE8}
c0c534
%if %{include_debug_build}
c0c534
cp -r tapset tapset%{debug_suffix}
c0c534
%endif
c0c534
c0c534
for suffix in %{build_loop} ; do
c0c534
  for file in "tapset"$suffix/*.in; do
07b2a4
    OUTPUT_FILE=`echo $file | sed -e "s:\.stp\.in$:-%{version}-%{release}.%{_arch}.stp:g"`
c0c534
    sed -e "s:@ABS_SERVER_LIBJVM_SO@:%{_jvmdir}/%{sdkdir $suffix}/lib/server/libjvm.so:g" $file > $file.1
c0c534
# TODO find out which architectures other than i686 have a client vm
c0c534
%ifarch %{ix86}
c0c534
    sed -e "s:@ABS_CLIENT_LIBJVM_SO@:%{_jvmdir}/%{sdkdir $suffix}/lib/client/libjvm.so:g" $file.1 > $OUTPUT_FILE
c0c534
%else
c0c534
    sed -e "/@ABS_CLIENT_LIBJVM_SO@/d" $file.1 > $OUTPUT_FILE
c0c534
%endif
c0c534
    sed -i -e "s:@ABS_JAVA_HOME_DIR@:%{_jvmdir}/%{sdkdir $suffix}:g" $OUTPUT_FILE
c0c534
    sed -i -e "s:@INSTALL_ARCH_DIR@:%{archinstall}:g" $OUTPUT_FILE
c0c534
    sed -i -e "s:@prefix@:%{_jvmdir}/%{sdkdir $suffix}/:g" $OUTPUT_FILE
c0c534
  done
c0c534
done
c0c534
# systemtap tapsets ends
c0c534
%endif
c0c534
c0c534
# Prepare desktop files
07b2a4
# The _X_ syntax indicates variables that are replaced by make upstream
07b2a4
# The @X@ syntax indicates variables that are replaced by configure upstream
c0c534
for suffix in %{build_loop} ; do
c0c534
for file in %{SOURCE9}; do
c0c534
    FILE=`basename $file | sed -e s:\.in$::g`
c0c534
    EXT="${FILE##*.}"
c0c534
    NAME="${FILE%.*}"
c0c534
    OUTPUT_FILE=$NAME$suffix.$EXT
07b2a4
    sed    -e  "s:_SDKBINDIR_:%{sdkbindir $suffix}:g" $file > $OUTPUT_FILE
07b2a4
    sed -i -e  "s:@target_cpu@:%{_arch}:g" $OUTPUT_FILE
07b2a4
    sed -i -e  "s:@OPENJDK_VER@:%{version}-%{release}.%{_arch}$suffix:g" $OUTPUT_FILE
07b2a4
    sed -i -e  "s:@JAVA_VER@:%{javaver}:g" $OUTPUT_FILE
c0c534
    sed -i -e  "s:@JAVA_VENDOR@:%{origin}:g" $OUTPUT_FILE
c0c534
done
c0c534
done
c0c534
c0c534
# Setup nss.cfg
c0c534
sed -e "s:@NSS_LIBDIR@:%{NSS_LIBDIR}:g" %{SOURCE11} > nss.cfg
c0c534
c0c534
c0c534
%build
c0c534
# How many CPU's do we have?
c0c534
export NUM_PROC=%(/usr/bin/getconf _NPROCESSORS_ONLN 2> /dev/null || :)
c0c534
export NUM_PROC=${NUM_PROC:-1}
c0c534
%if 0%{?_smp_ncpus_max}
c0c534
# Honor %%_smp_ncpus_max
c0c534
[ ${NUM_PROC} -gt %{?_smp_ncpus_max} ] && export NUM_PROC=%{?_smp_ncpus_max}
c0c534
%endif
c0c534
c0c534
%ifarch s390x sparc64 alpha %{power64} %{aarch64}
c0c534
export ARCH_DATA_MODEL=64
c0c534
%endif
c0c534
%ifarch alpha
c0c534
export CFLAGS="$CFLAGS -mieee"
c0c534
%endif
c0c534
c0c534
# We use ourcppflags because the OpenJDK build seems to
c0c534
# pass EXTRA_CFLAGS to the HotSpot C++ compiler...
c0c534
# Explicitly set the C++ standard as the default has changed on GCC >= 6
c0c534
EXTRA_CFLAGS="%ourcppflags -std=gnu++98 -Wno-error -fno-delete-null-pointer-checks"
c0c534
EXTRA_CPP_FLAGS="%ourcppflags -std=gnu++98 -fno-delete-null-pointer-checks"
d00a18
%ifarch %{ix86}
d00a18
EXTRA_CFLAGS="${EXTRA_CFLAGS} -mstackrealign"
d00a18
EXTRA_CPP_FLAGS="${EXTRA_CPP_FLAGS} -mstackrealign"
d00a18
%endif
c0c534
c0c534
%ifarch %{power64} ppc
c0c534
# fix rpmlint warnings
c0c534
EXTRA_CFLAGS="$EXTRA_CFLAGS -fno-strict-aliasing"
c0c534
%endif
eda148
EXTRA_ASFLAGS="${EXTRA_CFLAGS}"
eda148
export EXTRA_CFLAGS EXTRA_ASFLAGS
c0c534
ac0427
function buildjdk() {
ac0427
    local outputdir=${1}
ac0427
    local installdir=${2}
ac0427
    local buildjdk=${3}
ac0427
    local maketargets="${4}"
ac0427
    local debuglevel=${5}
ac0427
    local link_opt=${6}
ac0427
ac0427
    local top_dir_abs_src_path=$(pwd)/%{top_level_dir_name}
ac0427
    local top_dir_abs_build_path=$(pwd)/${outputdir}
ac0427
ac0427
    echo "Using output directory: ${outputdir}";
ac0427
    echo "Checking build JDK ${buildjdk} is operational..."
ac0427
    ${buildjdk}/bin/java -version
ac0427
    echo "Using make targets: ${maketargets}"
ac0427
    echo "Using debuglevel: ${debuglevel}"
ac0427
    echo "Using link_opt: ${link_opt}"
ac0427
    echo "Building %{newjavaver}-%{buildver}, pre=%{ea_designator}, opt=%{lts_designator}"
ac0427
ac0427
    mkdir -p ${outputdir} ${installdir}
ac0427
    pushd ${outputdir}
ac0427
ac0427
    bash ${top_dir_abs_src_path}/configure \
c0c534
%ifnarch %{jit_arches}
c0c534
    --with-jvm-variants=zero \
c0c534
%endif
c0c534
%ifarch %{ppc64le}
c0c534
    --with-jobs=1 \
c0c534
%endif
20ef41
    --with-version-build=%{buildver} \
3aaaac
    --with-version-pre="%{ea_designator}" \
e50716
    --with-version-opt=%{lts_designator} \
e50716
    --with-vendor-version-string="%{vendor_version_string}" \
8d5b3a
    --with-vendor-name="%{oj_vendor}" \
8d5b3a
    --with-vendor-url="%{oj_vendor_url}" \
8d5b3a
    --with-vendor-bug-url="%{oj_vendor_bug_url}" \
8d5b3a
    --with-vendor-vm-bug-url="%{oj_vendor_bug_url}" \
ac0427
    --with-boot-jdk=${buildjdk} \
ac0427
    --with-debug-level=${debuglevel} \
ac0427
    --with-native-debug-symbols="%{debug_symbols}" \
c0c534
    --enable-unlimited-crypto \
c0c534
    --with-zlib=system \
438e03
    --with-libjpeg=${link_opt} \
438e03
    --with-giflib=${link_opt} \
438e03
    --with-libpng=${link_opt} \
c0c534
    --with-lcms=bundled \
20ef41
    --with-harfbuzz=bundled \
c0c534
    --with-stdc++lib=dynamic \
c0c534
    --with-extra-cxxflags="$EXTRA_CPP_FLAGS" \
c0c534
    --with-extra-cflags="$EXTRA_CFLAGS" \
eda148
    --with-extra-asflags="$EXTRA_ASFLAGS" \
c0c534
    --with-extra-ldflags="%{ourldflags}" \
c0c534
    --with-num-cores="$NUM_PROC" \
c0c534
    --disable-javac-server \
8d5b3a
    --with-jvm-features="%{shenandoah_feature},%{zgc_feature}" \
c0c534
    --disable-warnings-as-errors
c0c534
ac0427
    cat spec.gmk
438e03
ac0427
    make \
ac0427
      JAVAC_FLAGS=-g \
ac0427
      LOG=trace \
ac0427
      WARNINGS_ARE_ERRORS="-Wno-error" \
ac0427
      CFLAGS_WARNINGS_ARE_ERRORS="-Wno-error" \
ac0427
      $maketargets || ( pwd; find ${top_dir_abs_src_path} ${top_dir_abs_build_path} -name "hs_err_pid*.log" | xargs cat && false )
438e03
ac0427
    popd
438e03
ac0427
    echo "Installing build from ${outputdir} to ${installdir}..."
ac0427
    echo "Installing images..."
ac0427
    mv ${outputdir}/images ${installdir}
ac0427
    if [ -d ${outputdir}/bundles ] ; then
ac0427
	echo "Installing bundles...";
ac0427
	mv ${outputdir}/bundles ${installdir} ;
ac0427
    fi
ac0427
    if [ -d ${outputdir}/docs ] ; then
ac0427
	echo "Installing docs...";
ac0427
	mv ${outputdir}/docs ${installdir} ;
ac0427
    fi
438e03
ac0427
%if !%{with artifacts}
ac0427
    echo "Removing output directory...";
ac0427
    rm -rf ${outputdir}
ac0427
%endif
ac0427
}
c0c534
ac0427
function installjdk() {
ac0427
    local imagepath=${1}
c0c534
ac0427
    # the build (erroneously) removes read permissions from some jars
ac0427
    # this is a regression in OpenJDK 7 (our compiler):
ac0427
    # http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1437
ac0427
    find ${imagepath} -iname '*.jar' -exec chmod ugo+r {} \;
c0c534
ac0427
    # Build screws up permissions on binaries
ac0427
    # https://bugs.openjdk.java.net/browse/JDK-8173610
ac0427
    find ${imagepath} -iname '*.so' -exec chmod +x {} \;
ac0427
    find ${imagepath}/bin/ -exec chmod +x {} \;
c0c534
ac0427
    # Install nss.cfg right away as we will be using the JRE above
ac0427
    install -m 644 nss.cfg ${imagepath}/conf/security/
c0c534
ac0427
    # Use system-wide tzdata
ac0427
    rm ${imagepath}/lib/tzdb.dat
ac0427
    ln -s %{_datadir}/javazi-1.8/tzdb.dat ${imagepath}/lib/tzdb.dat
c0c534
ac0427
    # Create fake alt-java as a placeholder for future alt-java
ac0427
    pushd ${imagepath}
ac0427
    # add alt-java man page
ac0427
    echo "Hardened java binary recommended for launching untrusted code from the Web e.g. javaws" > man/man1/%{alt_java_name}.1
ac0427
    cat man/man1/java.1 >> man/man1/%{alt_java_name}.1
ac0427
    popd
ac0427
}
ac0427
ac0427
for suffix in %{build_loop} ; do
ac0427
ac0427
  if [ "x$suffix" = "x" ] ; then
ac0427
      debugbuild=release
ac0427
  else
ac0427
      # change --something to something
ac0427
      debugbuild=`echo slow$suffix  | sed "s/-//g"`
ac0427
  fi
ac0427
ac0427
  systemjdk=/usr/lib/jvm/java-%{buildjdkver}-openjdk
ac0427
ac0427
  for loop in %{main_suffix} %{staticlibs_loop} ; do
ac0427
ac0427
    builddir=%{buildoutputdir ${suffix}${loop}}
ac0427
    bootbuilddir=boot${builddir}
ac0427
    installdir=%{installoutputdir ${suffix}${loop}}
ac0427
    bootinstalldir=boot${installdir}
ac0427
ac0427
    if test "x${loop}" = "x%{main_suffix}" ; then
ac0427
      # Copy the source tree so we can remove all in-tree libraries
ac0427
      cp -a %{top_level_dir_name} %{top_level_dir_name_backup}
ac0427
      # Remove all libraries that are linked
ac0427
      sh %{SOURCE12} %{top_level_dir_name} full
ac0427
      # Use system libraries
ac0427
      link_opt="system"
ac0427
      # Debug builds don't need same targets as release for
ac0427
      # build speed-up
ac0427
      maketargets="%{release_targets}"
ac0427
      if echo $debugbuild | grep -q "debug" ; then
ac0427
	maketargets="%{debug_targets}"
ac0427
      fi
ac0427
%if %{bootstrap_build}
ac0427
      buildjdk ${bootbuilddir} ${bootinstalldir} ${systemjdk} "%{bootstrap_targets}" ${debugbuild} ${link_opt}
ac0427
      buildjdk ${builddir} ${installdir} $(pwd)/${bootinstalldir}/images/%{jdkimage} "${maketargets}" ${debugbuild} ${link_opt}
ac0427
      %{!?with_artifacts:rm -rf ${bootinstalldir}}
ac0427
%else
ac0427
      buildjdk ${builddir} ${installdir} ${systemjdk} "${maketargets}" ${debugbuild} ${link_opt}
ac0427
%endif
ac0427
      # Restore original source tree we modified by removing full in-tree sources
ac0427
      rm -rf %{top_level_dir_name}
ac0427
      mv %{top_level_dir_name_backup} %{top_level_dir_name}
ac0427
    else
ac0427
      # Use bundled libraries for building statically
ac0427
      link_opt="bundled"
ac0427
      # Static library cycle only builds the static libraries
ac0427
      maketargets="%{static_libs_target}"
ac0427
      # Always just do the one build for the static libraries
ac0427
      buildjdk ${builddir} ${installdir} ${systemjdk} "${maketargets}" ${debugbuild} ${link_opt}
ac0427
    fi
ac0427
ac0427
  done # end of main / staticlibs loop
ac0427
ac0427
  # Final setup on the main image
ac0427
  top_dir_abs_main_build_path=$(pwd)/%{installoutputdir ${suffix}%{main_suffix}}
ac0427
  installjdk ${top_dir_abs_main_build_path}/images/%{jdkimage}
6e367a
c0c534
# build cycles
438e03
done # end of release / debug cycle loop
c0c534
c0c534
%check
c0c534
c0c534
# We test debug first as it will give better diagnostics on a crash
c0c534
for suffix in %{rev_build_loop} ; do
c0c534
ac0427
top_dir_abs_main_build_path=$(pwd)/%{installoutputdir ${suffix}%{main_suffix}}
438e03
%if %{include_staticlibs}
ac0427
top_dir_abs_staticlibs_build_path=$(pwd)/%{installoutputdir ${suffix}%{staticlibs_loop}}
438e03
%endif
438e03
438e03
export JAVA_HOME=${top_dir_abs_main_build_path}/images/%{jdkimage}
c0c534
3aaaac
#check Shenandoah is enabled
c0c534
%if %{use_shenandoah_hotspot}
c0c534
$JAVA_HOME//bin/java -XX:+UseShenandoahGC -version
c0c534
%endif
c0c534
c0c534
# Check unlimited policy has been used
c0c534
$JAVA_HOME/bin/javac -d . %{SOURCE13}
c0c534
$JAVA_HOME/bin/java --add-opens java.base/javax.crypto=ALL-UNNAMED TestCryptoLevel
c0c534
c0c534
# Check ECC is working
c0c534
$JAVA_HOME/bin/javac -d . %{SOURCE14}
c0c534
$JAVA_HOME/bin/java $(echo $(basename %{SOURCE14})|sed "s|\.java||")
c0c534
8d5b3a
# Check correct vendor values have been set
8d5b3a
$JAVA_HOME/bin/javac -d . %{SOURCE15}
438e03
$JAVA_HOME/bin/java $(echo $(basename %{SOURCE15})|sed "s|\.java||") "%{oj_vendor}" "%{oj_vendor_url}" "%{oj_vendor_bug_url}"
8d5b3a
20ef41
# Check java launcher has no SSB mitigation
20ef41
if ! nm $JAVA_HOME/bin/java | grep set_speculation ; then true ; else false; fi
20ef41
20ef41
# Check alt-java launcher has SSB mitigation on supported architectures
20ef41
%ifarch %{ssbd_arches}
20ef41
nm $JAVA_HOME/bin/%{alt_java_name} | grep set_speculation
20ef41
%else
20ef41
if ! nm $JAVA_HOME/bin/%{alt_java_name} | grep set_speculation ; then true ; else false; fi
20ef41
%endif
20ef41
438e03
%if %{include_staticlibs}
07b2a4
# Check debug symbols in static libraries (smoke test)
438e03
export STATIC_LIBS_HOME=${top_dir_abs_staticlibs_build_path}/images/%{static_libs_image}
07b2a4
readelf --debug-dump $STATIC_LIBS_HOME/lib/libfdlibm.a | grep w_remainder.c
07b2a4
readelf --debug-dump $STATIC_LIBS_HOME/lib/libfdlibm.a | grep e_remainder.c
438e03
%endif
07b2a4
ac0427
so_suffix="so"
c0c534
# Check debug symbols are present and can identify code
ac0427
find "$JAVA_HOME" -iname "*.$so_suffix" -print0 | while read -d $'\0' lib
c0c534
do
c0c534
  if [ -f "$lib" ] ; then
c0c534
    echo "Testing $lib for debug symbols"
c0c534
    # All these tests rely on RPM failing the build if the exit code of any set
c0c534
    # of piped commands is non-zero.
c0c534
c0c534
    # Test for .debug_* sections in the shared object. This is the main test
c0c534
    # Stripped objects will not contain these
c0c534
    eu-readelf -S "$lib" | grep "] .debug_"
c0c534
    test $(eu-readelf -S "$lib" | grep -E "\]\ .debug_(info|abbrev)" | wc --lines) == 2
c0c534
c0c534
    # Test FILE symbols. These will most likely be removed by anything that
c0c534
    # manipulates symbol tables because it's generally useless. So a nice test
c0c534
    # that nothing has messed with symbols
c0c534
    old_IFS="$IFS"
c0c534
    IFS=$'\n'
c0c534
    for line in $(eu-readelf -s "$lib" | grep "00000000      0 FILE    LOCAL  DEFAULT")
c0c534
    do
c0c534
     # We expect to see .cpp files, except for architectures like aarch64 and
c0c534
     # s390 where we expect .o and .oS files
c0c534
      echo "$line" | grep -E "ABS ((.*/)?[-_a-zA-Z0-9]+\.(c|cc|cpp|cxx|o|oS))?$"
c0c534
    done
c0c534
    IFS="$old_IFS"
c0c534
c0c534
    # If this is the JVM, look for javaCalls.(cpp|o) in FILEs, for extra sanity checking
c0c534
    if [ "`basename $lib`" = "libjvm.so" ]; then
c0c534
      eu-readelf -s "$lib" | \
c0c534
        grep -E "00000000      0 FILE    LOCAL  DEFAULT      ABS javaCalls.(cpp|o)$"
c0c534
    fi
c0c534
c0c534
    # Test that there are no .gnu_debuglink sections pointing to another
c0c534
    # debuginfo file. There shouldn't be any debuginfo files, so the link makes
c0c534
    # no sense either
c0c534
    eu-readelf -S "$lib" | grep 'gnu'
c0c534
    if eu-readelf -S "$lib" | grep '] .gnu_debuglink' | grep PROGBITS; then
c0c534
      echo "bad .gnu_debuglink section."
c0c534
      eu-readelf -x .gnu_debuglink "$lib"
c0c534
      false
c0c534
    fi
c0c534
  fi
c0c534
done
c0c534
c0c534
# Make sure gdb can do a backtrace based on line numbers on libjvm.so
c0c534
# javaCalls.cpp:58 should map to:
c0c534
# http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/file/ff3b27e6bcc2/src/share/vm/runtime/javaCalls.cpp#l58 
c0c534
# Using line number 1 might cause build problems. See:
c0c534
# https://bugzilla.redhat.com/show_bug.cgi?id=1539664
c0c534
# https://bugzilla.redhat.com/show_bug.cgi?id=1538767
d00a18
# Temporarily disabled on s390x as it sporadically crashes with SIGFPE, Arithmetic exception.
d00a18
%ifnarch s390x
c0c534
gdb -q "$JAVA_HOME/bin/java" <
c0c534
handle SIGSEGV pass nostop noprint
c0c534
handle SIGILL pass nostop noprint
c0c534
set breakpoint pending on
c0c534
break javaCalls.cpp:1
c0c534
commands 1
c0c534
backtrace
c0c534
quit
c0c534
end
c0c534
run -version
c0c534
EOF
c0c534
grep 'JavaCallWrapper::JavaCallWrapper' gdb.out
d00a18
%endif
c0c534
c0c534
# Check src.zip has all sources. See RHBZ#1130490
ac0427
$JAVA_HOME/bin/jar -tf $JAVA_HOME/lib/src.zip | grep 'sun.misc.Unsafe'
c0c534
c0c534
# Check class files include useful debugging information
c0c534
$JAVA_HOME/bin/javap -l java.lang.Object | grep "Compiled from"
c0c534
$JAVA_HOME/bin/javap -l java.lang.Object | grep LineNumberTable
c0c534
$JAVA_HOME/bin/javap -l java.lang.Object | grep LocalVariableTable
c0c534
c0c534
# Check generated class files include useful debugging information
c0c534
$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep "Compiled from"
c0c534
$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep LineNumberTable
c0c534
$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep LocalVariableTable
c0c534
c0c534
# build cycles check
c0c534
done
c0c534
c0c534
%install
c0c534
STRIP_KEEP_SYMTAB=libjvm*
c0c534
c0c534
for suffix in %{build_loop} ; do
c0c534
ac0427
top_dir_abs_main_build_path=$(pwd)/%{installoutputdir ${suffix}%{main_suffix}}
438e03
# Docs need to always be taken from the release build, as debug builds don't contain them
438e03
# On release builds, this will just be the same as top_dir_abs_main_build_path
ac0427
top_dir_abs_release_build_path=$(pwd)/%{installoutputdir ${normal_suffix}%{main_suffix}}
438e03
%if %{include_staticlibs}
ac0427
top_dir_abs_staticlibs_build_path=$(pwd)/%{installoutputdir ${suffix}%{staticlibs_loop}}
438e03
%endif
438e03
jdk_image=${top_dir_abs_main_build_path}/images/%{jdkimage}
438e03
c0c534
# Install the jdk
c0c534
mkdir -p $RPM_BUILD_ROOT%{_jvmdir}
438e03
cp -a ${jdk_image} $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}
c0c534
438e03
pushd ${jdk_image}
c0c534
c0c534
%if %{with_systemtap}
c0c534
  # Install systemtap support files
c0c534
  install -dm 755 $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}/tapset
c0c534
  # note, that uniquesuffix  is in BUILD dir in this case
c0c534
  cp -a $RPM_BUILD_DIR/%{uniquesuffix ""}/tapset$suffix/*.stp $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}/tapset/
c0c534
  pushd  $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}/tapset/
c0c534
   tapsetFiles=`ls *.stp`
c0c534
  popd
c0c534
  install -d -m 755 $RPM_BUILD_ROOT%{tapsetdir}
c0c534
  for name in $tapsetFiles ; do
c0c534
    targetName=`echo $name | sed "s/.stp/$suffix.stp/"`
c0c534
    ln -sf %{_jvmdir}/%{sdkdir $suffix}/tapset/$name $RPM_BUILD_ROOT%{tapsetdir}/$targetName
c0c534
  done
c0c534
%endif
c0c534
c0c534
  # Remove empty cacerts database
c0c534
  rm -f $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}/lib/security/cacerts
c0c534
  # Install cacerts symlink needed by some apps which hard-code the path
c0c534
  pushd $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}/lib/security
c0c534
      ln -sf /etc/pki/java/cacerts .
c0c534
  popd
c0c534
c0c534
  # Install version-ed symlinks
c0c534
  pushd $RPM_BUILD_ROOT%{_jvmdir}
c0c534
    ln -sf %{sdkdir $suffix} %{jrelnk $suffix}
c0c534
  popd
c0c534
c0c534
  # Install man pages
c0c534
  install -d -m 755 $RPM_BUILD_ROOT%{_mandir}/man1
c0c534
  for manpage in man/man1/*
c0c534
  do
c0c534
    # Convert man pages to UTF8 encoding
c0c534
    iconv -f ISO_8859-1 -t UTF8 $manpage -o $manpage.tmp
c0c534
    mv -f $manpage.tmp $manpage
c0c534
    install -m 644 -p $manpage $RPM_BUILD_ROOT%{_mandir}/man1/$(basename \
c0c534
      $manpage .1)-%{uniquesuffix $suffix}.1
c0c534
  done
c0c534
  # Remove man pages from jdk image
c0c534
  rm -rf $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}/man
c0c534
c0c534
popd
07b2a4
# Install static libs artefacts
438e03
%if %{include_staticlibs}
8d5b3a
mkdir -p $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}/lib/static/linux-%{archinstall}/glibc
438e03
cp -a ${top_dir_abs_staticlibs_build_path}/images/%{static_libs_image}/lib/*.a \
8d5b3a
  $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir $suffix}/lib/static/linux-%{archinstall}/glibc
438e03
%endif
c0c534
c0c534
# Install Javadoc documentation
3aaaac
# Always take docs from normal build to avoid building them twice
c0c534
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}
438e03
cp -a ${top_dir_abs_release_build_path}/images/docs $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir $suffix}
20ef41
built_doc_archive=jdk-%{filever}%{ea_designator_zip}+%{buildver}%{lts_designator_zip}-docs.zip
438e03
cp -a ${top_dir_abs_release_build_path}/bundles/${built_doc_archive} \
438e03
     $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir $suffix}.zip || ls -l ${top_dir_abs_release_build_path}/bundles/
c0c534
eda148
# Install release notes
eda148
commondocdir=${RPM_BUILD_ROOT}%{_defaultdocdir}/%{uniquejavadocdir $suffix}
eda148
install -d -m 755 ${commondocdir}
eda148
cp -a %{SOURCE10} ${commondocdir}
eda148
c0c534
# Install icons and menu entries
c0c534
for s in 16 24 32 48 ; do
c0c534
  install -D -p -m 644 \
c0c534
    %{top_level_dir_name}/src/java.desktop/unix/classes/sun/awt/X11/java-icon${s}.png \
c0c534
    $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${s}x${s}/apps/java-%{javaver}-%{origin}.png
c0c534
done
c0c534
c0c534
# Install desktop files
c0c534
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/{applications,pixmaps}
c0c534
for e in jconsole$suffix ; do
c0c534
    desktop-file-install --vendor=%{uniquesuffix $suffix} --mode=644 \
c0c534
        --dir=$RPM_BUILD_ROOT%{_datadir}/applications $e.desktop
c0c534
done
c0c534
c0c534
# Install /etc/.java/.systemPrefs/ directory
c0c534
# See https://bugzilla.redhat.com/show_bug.cgi?id=741821
c0c534
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/.java/.systemPrefs
c0c534
c0c534
# copy samples next to demos; samples are mostly js files
c0c534
cp -r %{top_level_dir_name}/src/sample  $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir $suffix}/
c0c534
c0c534
c0c534
# stabilize permissions
c0c534
find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir $suffix}/ -name "*.so" -exec chmod 755 {} \; ; 
c0c534
find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir $suffix}/ -type d -exec chmod 755 {} \; ; 
c0c534
find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir $suffix}/legal -type f -exec chmod 644 {} \; ; 
c0c534
c0c534
# end, dual install
c0c534
done
c0c534
c0c534
%if %{include_normal_build}
c0c534
# intentionally only for non-debug
c0c534
%pretrans headless -p <lua>
c0c534
-- see https://bugzilla.redhat.com/show_bug.cgi?id=1038092 for whole issue
c0c534
-- see https://bugzilla.redhat.com/show_bug.cgi?id=1290388 for pretrans over pre
c0c534
-- if copy-jdk-configs is in transaction, it installs in pretrans to temp
c0c534
-- if copy_jdk_configs is in temp, then it means that copy-jdk-configs is in transaction  and so is
c0c534
-- preferred over one in %%{_libexecdir}. If it is not in transaction, then depends
c0c534
-- whether copy-jdk-configs is installed or not. If so, then configs are copied
c0c534
-- (copy_jdk_configs from %%{_libexecdir} used) or not copied at all
c0c534
local posix = require "posix"
c0c534
local debug = false
c0c534
c0c534
SOURCE1 = "%{rpm_state_dir}/copy_jdk_configs.lua"
c0c534
SOURCE2 = "%{_libexecdir}/copy_jdk_configs.lua"
c0c534
c0c534
local stat1 = posix.stat(SOURCE1, "type");
c0c534
local stat2 = posix.stat(SOURCE2, "type");
c0c534
c0c534
  if (stat1 ~= nil) then
c0c534
  if (debug) then
c0c534
    print(SOURCE1 .." exists - copy-jdk-configs in transaction, using this one.")
c0c534
  end;
c0c534
  package.path = package.path .. ";" .. SOURCE1
c0c534
else
c0c534
  if (stat2 ~= nil) then
c0c534
  if (debug) then
c0c534
    print(SOURCE2 .." exists - copy-jdk-configs already installed and NOT in transaction. Using.")
c0c534
  end;
c0c534
  package.path = package.path .. ";" .. SOURCE2
c0c534
  else
c0c534
    if (debug) then
c0c534
      print(SOURCE1 .." does NOT exists")
c0c534
      print(SOURCE2 .." does NOT exists")
c0c534
      print("No config files will be copied")
c0c534
    end
c0c534
  return
c0c534
  end
c0c534
end
c0c534
-- run content of included file with fake args
c0c534
arg = {"--currentjvm", "%{uniquesuffix %{nil}}", "--jvmdir", "%{_jvmdir %{nil}}", "--origname", "%{name}", "--origjavaver", "%{javaver}", "--arch", "%{_arch}", "--temp", "%{rpm_state_dir}/%{name}.%{_arch}"}
c0c534
require "copy_jdk_configs.lua"
c0c534
c0c534
%post
c0c534
%{post_script %{nil}}
c0c534
c0c534
%post headless
c0c534
%{post_headless %{nil}}
c0c534
c0c534
%postun
c0c534
%{postun_script %{nil}}
c0c534
c0c534
%postun headless
c0c534
%{postun_headless %{nil}}
c0c534
c0c534
%posttrans
c0c534
%{posttrans_script %{nil}}
c0c534
c0c534
%post devel
c0c534
%{post_devel %{nil}}
c0c534
c0c534
%postun devel
c0c534
%{postun_devel %{nil}}
c0c534
c0c534
%posttrans  devel
c0c534
%{posttrans_devel %{nil}}
c0c534
c0c534
%post javadoc
c0c534
%{post_javadoc %{nil}}
c0c534
c0c534
%postun javadoc
c0c534
%{postun_javadoc %{nil}}
c0c534
c0c534
%post javadoc-zip