Blame java-latest-openjdk.spec

2ffe923
# RPM conditionals so as to be able to dynamically produce
2ffe923
# slowdebug/release builds. See:
2ffe923
# http://rpm.org/user_doc/conditional_builds.html
2ffe923
#
2ffe923
# Examples:
2ffe923
#
01a09a2
# Produce release, fastdebug *and* slowdebug builds on x86_64 (default):
01a09a2
# $ rpmbuild -ba java-latest-openjdk.spec
2ffe923
#
01a09a2
# Produce only release builds (no debug builds) on x86_64:
01a09a2
# $ rpmbuild -ba java-latest-openjdk.spec --without slowdebug --without fastdebug
2ffe923
#
2ffe923
# Only produce a release build on x86_64:
ff16d76
# $ fedpkg mockbuild --without slowdebug --without fastdebug
ff16d76
#
ff16d76
# Only produce a debug build on x86_64:
ff16d76
# $ fedpkg local --without release
2ffe923
#
01a09a2
# Enable fastdebug builds by default on relevant arches.
01a09a2
%bcond_without fastdebug
2ffe923
# Enable slowdebug builds by default on relevant arches.
2ffe923
%bcond_without slowdebug
2ffe923
# Enable release builds by default on relevant arches.
2ffe923
%bcond_without release
Severin Gehwolf 7ba3ca3
# Enable static library builds by default.
Severin Gehwolf 7ba3ca3
%bcond_without staticlibs
2ffe923
4848b86
# Workaround for stripping of debug symbols from static libraries
Severin Gehwolf 7ba3ca3
%if %{with staticlibs}
4848b86
%define __brp_strip_static_archive %{nil}
Severin Gehwolf 7ba3ca3
%global include_staticlibs 1
Severin Gehwolf 7ba3ca3
%else
Severin Gehwolf 7ba3ca3
%global include_staticlibs 0
Severin Gehwolf 7ba3ca3
%endif
4848b86
2ffe923
# The -g flag says to use strip -g instead of full strip on DSOs or EXEs.
2ffe923
# This fixes detailed NMT and other tools which need minimal debug info.
2ffe923
# See: https://bugzilla.redhat.com/show_bug.cgi?id=1520879
2ffe923
%global _find_debuginfo_opts -g
2ffe923
Severin Gehwolf 05a8506
# With LTO flags enabled, debuginfo checks fail for some reason. Disable
Severin Gehwolf 05a8506
# LTO for a passing build. This really needs to be looked at.
Severin Gehwolf 05a8506
%define _lto_cflags %{nil}
Severin Gehwolf 05a8506
2ffe923
# note: parametrized macros are order-sensitive (unlike not-parametrized) even with normal macros
2ffe923
# also necessary when passing it as parameter to other macros. If not macro, then it is considered a switch
2ffe923
# see the difference between global and define:
2ffe923
# See https://github.com/rpm-software-management/rpm/issues/127 to comments at  "pmatilai commented on Aug 18, 2017"
2ffe923
# (initiated in https://bugzilla.redhat.com/show_bug.cgi?id=1482192)
2ffe923
%global debug_suffix_unquoted -slowdebug
01a09a2
%global fastdebug_suffix_unquoted -fastdebug
Severin Gehwolf 7ba3ca3
%global main_suffix_unquoted -main
Severin Gehwolf 7ba3ca3
%global staticlibs_suffix_unquoted -staticlibs
2ffe923
# quoted one for shell operations
2ffe923
%global debug_suffix "%{debug_suffix_unquoted}"
01a09a2
%global fastdebug_suffix "%{fastdebug_suffix_unquoted}"
2ffe923
%global normal_suffix ""
Severin Gehwolf 7ba3ca3
%global main_suffix "%{main_suffix_unquoted}"
Severin Gehwolf 7ba3ca3
%global staticlibs_suffix "%{staticlibs_suffix_unquoted}"
2ffe923
01a09a2
%global debug_warning This package is unoptimised with full debugging. Install only as needed and remove ASAP.
Andrew John Hughes ca2c868
%global debug_on with full debugging on
Andrew John Hughes ca2c868
%global fastdebug_on with minimal debugging on
01a09a2
%global fastdebug_warning This package is optimised with full debugging. Install only as needed and remove ASAP.
Andrew John Hughes ca2c868
%global for_fastdebug_on for packages with minimal debugging on
Andrew John Hughes ca2c868
%global for_debug for packages with debugging on
2ffe923
2ffe923
%if %{with release}
2ffe923
%global include_normal_build 1
2ffe923
%else
2ffe923
%global include_normal_build 0
2ffe923
%endif
2ffe923
2ffe923
%if %{include_normal_build}
01a09a2
%global normal_build %{normal_suffix}
2ffe923
%else
01a09a2
%global normal_build %{nil}
2ffe923
%endif
2ffe923
2ffe923
# We have hardcoded list of files, which  is appearing in alternatives, and in files
2ffe923
# in alternatives those are slaves and master, very often triplicated by man pages
2ffe923
# in files all masters and slaves are ghosted
2ffe923
# the ghosts are here to allow installation via query like `dnf install /usr/bin/java`
2ffe923
# you can list those files, with appropriate sections: cat *.spec | grep -e --install -e --slave -e post_ 
2ffe923
# TODO - fix those hardcoded lists via single list
b1f2c50
# Those files must *NOT* be ghosted for *slowdebug* packages
b1f2c50
# FIXME - if you are moving jshell or jlink or similar, always modify all three sections
2ffe923
# you can check via headless and devels:
2ffe923
#    rpm -ql --noghost java-11-openjdk-headless-11.0.1.13-8.fc29.x86_64.rpm  | grep bin
2ffe923
# == rpm -ql           java-11-openjdk-headless-slowdebug-11.0.1.13-8.fc29.x86_64.rpm  | grep bin
2ffe923
# != rpm -ql           java-11-openjdk-headless-11.0.1.13-8.fc29.x86_64.rpm  | grep bin
2ffe923
# similarly for other %%{_jvmdir}/{jre,java} and %%{_javadocdir}/{java,java-zip}
92dbe30
%define is_release_build() %( if [ "%{?1}" == "%{debug_suffix_unquoted}" -o "%{?1}" == "%{fastdebug_suffix_unquoted}" ]; then echo "0" ; else echo "1"; fi )
2ffe923
2ffe923
# 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
2ffe923
# as sytem JDK, we mean any JDK which can run whole system java stack without issues (like bytecode issues, module issues, dependencies...)
2ffe923
%global is_system_jdk 0
2ffe923
2ffe923
%global aarch64         aarch64 arm64 armv8
2ffe923
# we need to distinguish between big and little endian PPC64
2ffe923
%global ppc64le         ppc64le
2ffe923
%global ppc64be         ppc64 ppc64p7
ff16d76
# Set of architectures which support multiple ABIs
2ffe923
%global multilib_arches %{power64} sparc64 x86_64
ff16d76
# Set of architectures for which we build debug builds
ff16d76
%global debug_arches    %{ix86} x86_64 sparcv9 sparc64 %{aarch64} %{power64} s390x
ff16d76
# Set of architectures with a Just-In-Time (JIT) compiler
ff16d76
%global jit_arches      %{debug_arches} %{arm}
ff16d76
# Set of architectures which run a full bootstrap cycle
ff16d76
%global bootstrap_arches %{jit_arches}
ff16d76
# Set of architectures which support SystemTap tapsets
ff16d76
%global systemtap_arches %{jit_arches}
ff16d76
# Set of architectures with a Ahead-Of-Time (AOT) compiler
2ffe923
%global aot_arches      x86_64 %{aarch64}
ff16d76
%global fastdebug_arches x86_64 ppc64le aarch64
ff16d76
# Set of architectures which support the serviceability agent
ff16d76
%global sa_arches       %{ix86} x86_64 sparcv9 sparc64 %{aarch64} %{power64} %{arm}
ff16d76
# Set of architectures which support class data sharing
ff16d76
# See https://bugzilla.redhat.com/show_bug.cgi?id=513605
ff16d76
# MetaspaceShared::generate_vtable_methods is not implemented for the PPC JIT
ff16d76
%global share_arches    %{ix86} x86_64 sparcv9 sparc64 %{aarch64} %{arm} s390x
ff16d76
# Set of architectures for which we build the Shenandoah garbage collector
ff16d76
%global shenandoah_arches x86_64 %{aarch64}
ff16d76
# Set of architectures for which we build the Z garbage collector
ff16d76
%global zgc_arches x86_64
2949517
# Set of architectures for which alt-java has SSB mitigation
2949517
%global ssbd_arches x86_64
404b854
# Set of architectures for which java has short vector math library (libsvml.so)
404b854
%global svml_arches x86_64
2ffe923
2ffe923
# By default, we build a debug build during main build on JIT architectures
2ffe923
%if %{with slowdebug}
ff16d76
%ifarch %{debug_arches}
2ffe923
%global include_debug_build 1
2ffe923
%else
2ffe923
%global include_debug_build 0
2ffe923
%endif
2ffe923
%else
2ffe923
%global include_debug_build 0
2ffe923
%endif
2ffe923
ff16d76
# On certain architectures, we compile the Shenandoah GC
ff16d76
%ifarch %{shenandoah_arches}
2ffe923
%global use_shenandoah_hotspot 1
2ffe923
%else
2ffe923
%global use_shenandoah_hotspot 0
2ffe923
%endif
2ffe923
01a09a2
# By default, we build a fastdebug build during main build only on fastdebug architectures
01a09a2
%if %{with fastdebug}
01a09a2
%ifarch %{fastdebug_arches}
01a09a2
%global include_fastdebug_build 1
01a09a2
%else
01a09a2
%global include_fastdebug_build 0
01a09a2
%endif
ed681ea
%else
ed681ea
%global include_fastdebug_build 0
01a09a2
%endif
01a09a2
2ffe923
%if %{include_debug_build}
01a09a2
%global slowdebug_build %{debug_suffix}
01a09a2
%else
01a09a2
%global slowdebug_build %{nil}
01a09a2
%endif
01a09a2
01a09a2
%if %{include_fastdebug_build}
01a09a2
%global fastdebug_build %{fastdebug_suffix}
2ffe923
%else
01a09a2
%global fastdebug_build %{nil}
2ffe923
%endif
2ffe923
01a09a2
# If you disable both builds, then the build fails
01a09a2
# Note that the debug build requires the normal build for docs
01a09a2
%global build_loop %{normal_build} %{fastdebug_build} %{slowdebug_build}
01a09a2
# Test slowdebug first as it provides the best diagnostics
01a09a2
%global rev_build_loop  %{slowdebug_build} %{fastdebug_build} %{normal_build}
2ffe923
Severin Gehwolf 7ba3ca3
%if %{include_staticlibs}
Severin Gehwolf 7ba3ca3
%global staticlibs_loop %{staticlibs_suffix}
Severin Gehwolf 7ba3ca3
%else
Severin Gehwolf 7ba3ca3
%global staticlibs_loop %{nil}
Severin Gehwolf 7ba3ca3
%endif
Severin Gehwolf 7ba3ca3
ff16d76
%ifarch %{bootstrap_arches}
2ffe923
%global bootstrap_build 1
2ffe923
%else
2ffe923
%global bootstrap_build 1
2ffe923
%endif
2ffe923
2ffe923
%if %{bootstrap_build}
Severin Gehwolf 7ba3ca3
%global release_targets bootcycle-images docs-zip
2ffe923
%else
Severin Gehwolf 7ba3ca3
%global release_targets images docs-zip
2ffe923
%endif
Severin Gehwolf 9e49564
# No docs nor bootcycle for debug builds
Severin Gehwolf 7ba3ca3
%global debug_targets images
Severin Gehwolf 7ba3ca3
Severin Gehwolf 7ba3ca3
%if %{include_staticlibs}
Severin Gehwolf 7ba3ca3
# Extra target for producing the static-libraries. Separate from
Severin Gehwolf 7ba3ca3
# other targets since this target is configured to use in-tree
Severin Gehwolf 7ba3ca3
# AWT dependencies: lcms, libjpeg, libpng, libharfbuzz, giflib
Severin Gehwolf 7ba3ca3
# and possibly others
Severin Gehwolf 7ba3ca3
%global static_libs_target static-libs-image
Severin Gehwolf 7ba3ca3
%endif
2ffe923
2ffe923
2ffe923
# Filter out flags from the optflags macro that cause problems with the OpenJDK build
2ffe923
# We filter out -O flags so that the optimization of HotSpot is not lowered from O3 to O2
2ffe923
# We filter out -Wall which will otherwise cause HotSpot to produce hundreds of thousands of warnings (100+mb logs)
2ffe923
# We replace it with -Wformat (required by -Werror=format-security) and -Wno-cpp to avoid FORTIFY_SOURCE warnings
2ffe923
# We filter out -fexceptions as the HotSpot build explicitly does -fno-exceptions and it's otherwise the default for C++
2ffe923
%global ourflags %(echo %optflags | sed -e 's|-Wall|-Wformat -Wno-cpp|' | sed -r -e 's|-O[0-9]*||')
2ffe923
%global ourcppflags %(echo %ourflags | sed -e 's|-fexceptions||')
2ffe923
%global ourldflags %{__global_ldflags}
2ffe923
2ffe923
# With disabled nss is NSS deactivated, so NSS_LIBDIR can contain the wrong path
2ffe923
# the initialization must be here. Later the pkg-config have buggy behavior
2ffe923
# looks like openjdk RPM specific bug
2ffe923
# Always set this so the nss.cfg file is not broken
2ffe923
%global NSS_LIBDIR %(pkg-config --variable=libdir nss)
2ffe923
2ffe923
# In some cases, the arch used by the JDK does
2ffe923
# not match _arch.
2ffe923
# Also, in some cases, the machine name used by SystemTap
2ffe923
# does not match that given by _build_cpu
2ffe923
%ifarch x86_64
2ffe923
%global archinstall amd64
2ffe923
%endif
2ffe923
%ifarch ppc
2ffe923
%global archinstall ppc
2ffe923
%endif
2ffe923
%ifarch %{ppc64be}
2ffe923
%global archinstall ppc64
2ffe923
%endif
2ffe923
%ifarch %{ppc64le}
2ffe923
%global archinstall ppc64le
2ffe923
%endif
2ffe923
%ifarch %{ix86}
2ffe923
%global archinstall i686
2ffe923
%endif
2ffe923
%ifarch ia64
2ffe923
%global archinstall ia64
2ffe923
%endif
2ffe923
%ifarch s390
2ffe923
%global archinstall s390
2ffe923
%endif
2ffe923
%ifarch s390x
2ffe923
%global archinstall s390x
2ffe923
%endif
2ffe923
%ifarch %{arm}
2ffe923
%global archinstall arm
2ffe923
%endif
2ffe923
%ifarch %{aarch64}
2ffe923
%global archinstall aarch64
2ffe923
%endif
2ffe923
# 32 bit sparc, optimized for v9
2ffe923
%ifarch sparcv9
2ffe923
%global archinstall sparc
2ffe923
%endif
2ffe923
# 64 bit sparc
2ffe923
%ifarch sparc64
2ffe923
%global archinstall sparcv9
2ffe923
%endif
2ffe923
%ifnarch %{jit_arches}
2ffe923
%global archinstall %{_arch}
2ffe923
%endif
2ffe923
2ffe923
2ffe923
ff16d76
%ifarch %{systemtap_arches}
2ffe923
%global with_systemtap 1
2ffe923
%else
2ffe923
%global with_systemtap 0
2ffe923
%endif
2ffe923
2ffe923
# New Version-String scheme-style defines
404b854
%global featurever 17
Andrew John Hughes ca2c868
%global interimver 0
404b854
%global updatever 0
Andrew John Hughes ca2c868
%global patchver 0
Andrew John Hughes ca2c868
# If you bump featurever, you must bump also vendor_version_string
404b854
# Used via new version scheme. JDK 17 was
404b854
# GA'ed in September 2021 => 21.9
404b854
%global vendor_version_string 21.9
Andrew John Hughes ca2c868
# buildjdkver is usually same as %%{featurever},
Andrew John Hughes ca2c868
# but in time of bootstrap of next jdk, it is featurever-1,
2ffe923
# and this it is better to change it here, on single place
Severin Gehwolf 4a0847c
%global buildjdkver 17
2ffe923
# We don't add any LTS designator for STS packages (this package).
2ffe923
# Neither for Fedora nor EPEL which would have %%{rhel} macro defined.
2ffe923
 %global lts_designator ""
2ffe923
 %global lts_designator_zip ""
2ffe923
ff16d76
# Define IcedTea version used for SystemTap tapsets and desktop file
ff16d76
%global icedteaver      3.15.0
ff16d76
2ffe923
# Standard JPackage naming and versioning defines
2ffe923
%global origin          openjdk
2ffe923
%global origin_nice     OpenJDK
2ffe923
%global top_level_dir_name   %{origin}
Severin Gehwolf 7ba3ca3
%global top_level_dir_name_backup %{top_level_dir_name}-backup
404b854
%global buildver        26
Severin Gehwolf 4a0847c
%global rpmrelease      1
Andrew John Hughes ca2c868
# 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
2ffe923
%if %is_system_jdk
Andrew John Hughes ca2c868
# Using 10 digits may overflow the int used for priority, so we combine the patch and build versions
Andrew John Hughes ca2c868
# It is very unlikely we will ever have a patch version > 4 or a build version > 20, so we combine as (patch * 20) + build.
Andrew John Hughes ca2c868
# This means 11.0.9.0+11 would have had a priority of 11000911 as before
Andrew John Hughes ca2c868
# 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
Andrew John Hughes ca2c868
%global combiver $( expr 20 '*' %{patchver} + %{buildver} )
Andrew John Hughes ca2c868
%global priority %( printf '%02d%02d%02d%02d' %{featurever} %{interimver} %{updatever} %{combiver} )
2ffe923
%else
2ffe923
# for techpreview, using 1, so slowdebugs can have 0
2ffe923
%global priority %( printf '%08d' 1 )
2ffe923
%endif
Andrew John Hughes ca2c868
%global newjavaver      %{featurever}.%{interimver}.%{updatever}.%{patchver}
Andrew John Hughes ca2c868
%global javaver         %{featurever}
2ffe923
Andrew John Hughes c5efa6b
# Strip up to 6 trailing zeros in newjavaver, as the JDK does, to get the correct version used in filenames
Andrew John Hughes c5efa6b
%global filever %(svn=%{newjavaver}; for i in 1 2 3 4 5 6 ; do svn=${svn%%.0} ; done; echo ${svn})
Andrew John Hughes c5efa6b
5a901e2
# Define milestone (EA for pre-releases, GA for releases)
5a901e2
# Release will be (where N is usually a number starting at 1):
5a901e2
# - 0.N%%{?extraver}%%{?dist} for EA releases,
5a901e2
# - N%%{?extraver}{?dist} for GA releases
404b854
%global is_ga           0
5a901e2
%if %{is_ga}
Andrew John Hughes c5efa6b
%global build_type GA
Andrew John Hughes c5efa6b
%global expected_ea_designator ""
5a901e2
%global ea_designator_zip ""
5a901e2
%global extraver %{nil}
5a901e2
%global eaprefix %{nil}
5a901e2
%else
Andrew John Hughes c5efa6b
%global build_type EA
Andrew John Hughes c5efa6b
%global expected_ea_designator ea
Andrew John Hughes c5efa6b
%global ea_designator_zip -%{expected_ea_designator}
Andrew John Hughes c5efa6b
%global extraver .%{expected_ea_designator}
5a901e2
%global eaprefix 0.
5a901e2
%endif
5a901e2
9d47beb
# Define what url should JVM offer in case of a crash report
9d47beb
# order may be important, epel may have rhel declared
9d47beb
%if 0%{?epel}
9d47beb
%global bugs  https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora%20EPEL&component=%{name}&version=epel%{epel}
9d47beb
%else
9d47beb
%if 0%{?fedora}
9d47beb
# Does not work for rawhide, keeps the version field empty
9d47beb
%global bugs  https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=%{name}&version=%{fedora}
9d47beb
%else
9d47beb
%if 0%{?rhel}
9d47beb
%global bugs  https://bugzilla.redhat.com/enter_bug.cgi?product=Red%20Hat%20Enterprise%20Linux%20%{rhel}&component=%{name}
9d47beb
%else
9d47beb
%global bugs  https://bugzilla.redhat.com/enter_bug.cgi
9d47beb
%endif
9d47beb
%endif
9d47beb
%endif
9d47beb
2ffe923
# parametrized macros are order-sensitive
Andrew John Hughes ca2c868
%global compatiblename  java-%{featurever}-%{origin}
2ffe923
%global fullversion     %{compatiblename}-%{version}-%{release}
4848b86
# images directories from upstream build
4848b86
%global jdkimage                jdk
4848b86
%global static_libs_image       static-libs
2ffe923
# output dir stub
Severin Gehwolf 7ba3ca3
%define buildoutputdir() %{expand:build/jdk%{featurever}.build%{?1}}
2ffe923
# we can copy the javadoc to not arched dir, or make it not noarch
2ffe923
%define uniquejavadocdir()    %{expand:%{fullversion}.%{_arch}%{?1}}
2ffe923
# main id and dir of this jdk
2ffe923
%define uniquesuffix()        %{expand:%{fullversion}.%{_arch}%{?1}}
2ffe923
ff16d76
#################################################################
2ffe923
# fix for https://bugzilla.redhat.com/show_bug.cgi?id=1111349
2ffe923
#         https://bugzilla.redhat.com/show_bug.cgi?id=1590796#c14
2ffe923
#         https://bugzilla.redhat.com/show_bug.cgi?id=1655938
Andrew John Hughes c5efa6b
%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.*|libzip[.]so.*
aee972a
%global _publiclibs libjawt[.]so.*|libjava[.]so.*|libjvm[.]so.*|libverify[.]so.*|libjsig[.]so.*
aee972a
%if %is_system_jdk
2ffe923
%global __provides_exclude ^(%{_privatelibs})$
2ffe923
%global __requires_exclude ^(%{_privatelibs})$
b17bd78
# Never generate lib-style provides/requires for any debug packages
2ffe923
%global __provides_exclude_from ^.*/%{uniquesuffix -- %{debug_suffix_unquoted}}/.*$
ff16d76
%global __requires_exclude_from ^.*/%{uniquesuffix -- %{debug_suffix_unquoted}}/.*$
b17bd78
%global __provides_exclude_from ^.*/%{uniquesuffix -- %{fastdebug_suffix_unquoted}}/.*$
b17bd78
%global __requires_exclude_from ^.*/%{uniquesuffix -- %{fastdebug_suffix_unquoted}}/.*$
2ffe923
%else
aee972a
# Don't generate provides/requires for JDK provided shared libraries at all.
aee972a
%global __provides_exclude ^(%{_privatelibs}|%{_publiclibs})$
aee972a
%global __requires_exclude ^(%{_privatelibs}|%{_publiclibs})$
2ffe923
%endif
2ffe923
2ffe923
2ffe923
%global etcjavasubdir     %{_sysconfdir}/java/java-%{javaver}-%{origin}
2ffe923
%define etcjavadir()      %{expand:%{etcjavasubdir}/%{uniquesuffix -- %{?1}}}
2ffe923
# Standard JPackage directories and symbolic links.
2ffe923
%define sdkdir()        %{expand:%{uniquesuffix -- %{?1}}}
2ffe923
%define jrelnk()        %{expand:jre-%{javaver}-%{origin}-%{version}-%{release}.%{_arch}%{?1}}
2ffe923
2ffe923
%define sdkbindir()     %{expand:%{_jvmdir}/%{sdkdir -- %{?1}}/bin}
2ffe923
%define jrebindir()     %{expand:%{_jvmdir}/%{sdkdir -- %{?1}}/bin}
2ffe923
b1f2c50
%global alt_java_name     alt-java
b1f2c50
2ffe923
%global rpm_state_dir %{_localstatedir}/lib/rpm-state/
2ffe923
Andrew John Hughes 7f93971
# For flatpack builds hard-code /usr/sbin/alternatives,
Andrew John Hughes 7f93971
# otherwise use %%{_sbindir} relative path.
Andrew John Hughes 7f93971
%if 0%{?flatpak}
Andrew John Hughes 7f93971
%global alternatives_requires /usr/sbin/alternatives
Andrew John Hughes 7f93971
%else
Andrew John Hughes 7f93971
%global alternatives_requires %{_sbindir}/alternatives
Andrew John Hughes 7f93971
%endif
Andrew John Hughes 7f93971
2ffe923
%if %{with_systemtap}
2ffe923
# Where to install systemtap tapset (links)
2ffe923
# We would like these to be in a package specific sub-dir,
2ffe923
# but currently systemtap doesn't support that, so we have to
2ffe923
# use the root tapset dir for now. To distinguish between 64
2ffe923
# and 32 bit architectures we place the tapsets under the arch
2ffe923
# specific dir (note that systemtap will only pickup the tapset
2ffe923
# for the primary arch for now). Systemtap uses the machine name
2ffe923
# aka build_cpu as architecture specific directory name.
2ffe923
%global tapsetroot /usr/share/systemtap
2ffe923
%global tapsetdirttapset %{tapsetroot}/tapset/
2ffe923
%global tapsetdir %{tapsetdirttapset}/%{_build_cpu}
2ffe923
%endif
2ffe923
2ffe923
# not-duplicated scriptlets for normal/debug packages
2ffe923
%global update_desktop_icons /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
2ffe923
2ffe923
2ffe923
%define post_script() %{expand:
2ffe923
update-desktop-database %{_datadir}/applications &> /dev/null || :
2ffe923
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
2ffe923
exit 0
2ffe923
}
2ffe923
2ffe923
2ffe923
%define post_headless() %{expand:
ff16d76
%ifarch %{share_arches}
2ffe923
%{jrebindir -- %{?1}}/java -Xshare:dump >/dev/null 2>/dev/null
2ffe923
%endif
2ffe923
2ffe923
PRIORITY=%{priority}
2ffe923
if [ "%{?1}" == %{debug_suffix} ]; then
2ffe923
  let PRIORITY=PRIORITY-1
2ffe923
fi
2ffe923
2ffe923
ext=.gz
2ffe923
alternatives \\
2ffe923
  --install %{_bindir}/java java %{jrebindir -- %{?1}}/java $PRIORITY  --family %{name}.%{_arch} \\
2ffe923
  --slave %{_jvmdir}/jre jre %{_jvmdir}/%{sdkdir -- %{?1}} \\
b1f2c50
  --slave %{_bindir}/%{alt_java_name} %{alt_java_name} %{jrebindir -- %{?1}}/%{alt_java_name} \\
2ffe923
  --slave %{_bindir}/keytool keytool %{jrebindir -- %{?1}}/keytool \\
2ffe923
  --slave %{_bindir}/rmiregistry rmiregistry %{jrebindir -- %{?1}}/rmiregistry \\
2ffe923
  --slave %{_mandir}/man1/java.1$ext java.1$ext \\
2ffe923
  %{_mandir}/man1/java-%{uniquesuffix -- %{?1}}.1$ext \\
b1f2c50
  --slave %{_mandir}/man1/%{alt_java_name}.1$ext %{alt_java_name}.1$ext \\
b1f2c50
  %{_mandir}/man1/%{alt_java_name}-%{uniquesuffix -- %{?1}}.1$ext \\
2ffe923
  --slave %{_mandir}/man1/keytool.1$ext keytool.1$ext \\
2ffe923
  %{_mandir}/man1/keytool-%{uniquesuffix -- %{?1}}.1$ext \\
2ffe923
  --slave %{_mandir}/man1/rmiregistry.1$ext rmiregistry.1$ext \\
e810d7e
  %{_mandir}/man1/rmiregistry-%{uniquesuffix -- %{?1}}.1$ext 
2ffe923
2ffe923
for X in %{origin} %{javaver} ; do
2ffe923
  alternatives --install %{_jvmdir}/jre-"$X" jre_"$X" %{_jvmdir}/%{sdkdir -- %{?1}} $PRIORITY --family %{name}.%{_arch}
2ffe923
done
2ffe923
2ffe923
update-alternatives --install %{_jvmdir}/jre-%{javaver}-%{origin} jre_%{javaver}_%{origin} %{_jvmdir}/%{jrelnk -- %{?1}} $PRIORITY  --family %{name}.%{_arch}
2ffe923
2ffe923
2ffe923
update-desktop-database %{_datadir}/applications &> /dev/null || :
2ffe923
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
2ffe923
2ffe923
# see pretrans where this file is declared
2ffe923
# also see that pretrans is only for non-debug
2ffe923
if [ ! "%{?1}" == %{debug_suffix} ]; then
2ffe923
  if [ -f %{_libexecdir}/copy_jdk_configs_fixFiles.sh ] ; then
2ffe923
    sh  %{_libexecdir}/copy_jdk_configs_fixFiles.sh %{rpm_state_dir}/%{name}.%{_arch}  %{_jvmdir}/%{sdkdir -- %{?1}}
2ffe923
  fi
2ffe923
fi
2ffe923
2ffe923
exit 0
2ffe923
}
2ffe923
2ffe923
%define postun_script() %{expand:
2ffe923
update-desktop-database %{_datadir}/applications &> /dev/null || :
2ffe923
if [ $1 -eq 0 ] ; then
2ffe923
    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
2ffe923
    %{update_desktop_icons}
2ffe923
fi
2ffe923
exit 0
2ffe923
}
2ffe923
2ffe923
2ffe923
%define postun_headless() %{expand:
2ffe923
  alternatives --remove java %{jrebindir -- %{?1}}/java
2ffe923
  alternatives --remove jre_%{origin} %{_jvmdir}/%{sdkdir -- %{?1}}
2ffe923
  alternatives --remove jre_%{javaver} %{_jvmdir}/%{sdkdir -- %{?1}}
2ffe923
  alternatives --remove jre_%{javaver}_%{origin} %{_jvmdir}/%{jrelnk -- %{?1}}
2ffe923
}
2ffe923
2ffe923
%define posttrans_script() %{expand:
2ffe923
%{update_desktop_icons}
2ffe923
}
2ffe923
2ffe923
%define post_devel() %{expand:
2ffe923
2ffe923
PRIORITY=%{priority}
2ffe923
if [ "%{?1}" == %{debug_suffix} ]; then
2ffe923
  let PRIORITY=PRIORITY-1
2ffe923
fi
2ffe923
2ffe923
ext=.gz
2ffe923
alternatives \\
2ffe923
  --install %{_bindir}/javac javac %{sdkbindir -- %{?1}}/javac $PRIORITY  --family %{name}.%{_arch} \\
2ffe923
  --slave %{_jvmdir}/java java_sdk %{_jvmdir}/%{sdkdir -- %{?1}} \\
2ffe923
  --slave %{_bindir}/jlink jlink %{sdkbindir -- %{?1}}/jlink \\
2ffe923
  --slave %{_bindir}/jmod jmod %{sdkbindir -- %{?1}}/jmod \\
ff16d76
%ifarch %{sa_arches}
2ffe923
  --slave %{_bindir}/jhsdb jhsdb %{sdkbindir -- %{?1}}/jhsdb \\
2ffe923
%endif
2ffe923
  --slave %{_bindir}/jar jar %{sdkbindir -- %{?1}}/jar \\
2ffe923
  --slave %{_bindir}/jarsigner jarsigner %{sdkbindir -- %{?1}}/jarsigner \\
2ffe923
  --slave %{_bindir}/javadoc javadoc %{sdkbindir -- %{?1}}/javadoc \\
2ffe923
  --slave %{_bindir}/javap javap %{sdkbindir -- %{?1}}/javap \\
2ffe923
  --slave %{_bindir}/jcmd jcmd %{sdkbindir -- %{?1}}/jcmd \\
2ffe923
  --slave %{_bindir}/jconsole jconsole %{sdkbindir -- %{?1}}/jconsole \\
2ffe923
  --slave %{_bindir}/jdb jdb %{sdkbindir -- %{?1}}/jdb \\
2ffe923
  --slave %{_bindir}/jdeps jdeps %{sdkbindir -- %{?1}}/jdeps \\
2ffe923
  --slave %{_bindir}/jdeprscan jdeprscan %{sdkbindir -- %{?1}}/jdeprscan \\
30796d5
  --slave %{_bindir}/jfr jfr %{sdkbindir -- %{?1}}/jfr \\
2ffe923
  --slave %{_bindir}/jimage jimage %{sdkbindir -- %{?1}}/jimage \\
2ffe923
  --slave %{_bindir}/jinfo jinfo %{sdkbindir -- %{?1}}/jinfo \\
2ffe923
  --slave %{_bindir}/jmap jmap %{sdkbindir -- %{?1}}/jmap \\
2ffe923
  --slave %{_bindir}/jps jps %{sdkbindir -- %{?1}}/jps \\
a773423
  --slave %{_bindir}/jpackage jpackage %{sdkbindir -- %{?1}}/jpackage \\
2ffe923
  --slave %{_bindir}/jrunscript jrunscript %{sdkbindir -- %{?1}}/jrunscript \\
2ffe923
  --slave %{_bindir}/jshell jshell %{sdkbindir -- %{?1}}/jshell \\
2ffe923
  --slave %{_bindir}/jstack jstack %{sdkbindir -- %{?1}}/jstack \\
2ffe923
  --slave %{_bindir}/jstat jstat %{sdkbindir -- %{?1}}/jstat \\
2ffe923
  --slave %{_bindir}/jstatd jstatd %{sdkbindir -- %{?1}}/jstatd \\
2ffe923
  --slave %{_bindir}/serialver serialver %{sdkbindir -- %{?1}}/serialver \\
2ffe923
  --slave %{_mandir}/man1/jar.1$ext jar.1$ext \\
2ffe923
  %{_mandir}/man1/jar-%{uniquesuffix -- %{?1}}.1$ext \\
2ffe923
  --slave %{_mandir}/man1/jarsigner.1$ext jarsigner.1$ext \\
2ffe923
  %{_mandir}/man1/jarsigner-%{uniquesuffix -- %{?1}}.1$ext \\
2ffe923
  --slave %{_mandir}/man1/javac.1$ext javac.1$ext \\
2ffe923
  %{_mandir}/man1/javac-%{uniquesuffix -- %{?1}}.1$ext \\
2ffe923
  --slave %{_mandir}/man1/javadoc.1$ext javadoc.1$ext \\
2ffe923
  %{_mandir}/man1/javadoc-%{uniquesuffix -- %{?1}}.1$ext \\
2ffe923
  --slave %{_mandir}/man1/javap.1$ext javap.1$ext \\
2ffe923
  %{_mandir}/man1/javap-%{uniquesuffix -- %{?1}}.1$ext \\
2ffe923
  --slave %{_mandir}/man1/jcmd.1$ext jcmd.1$ext \\
2ffe923
  %{_mandir}/man1/jcmd-%{uniquesuffix -- %{?1}}.1$ext \\
2ffe923
  --slave %{_mandir}/man1/jconsole.1$ext jconsole.1$ext \\
2ffe923
  %{_mandir}/man1/jconsole-%{uniquesuffix -- %{?1}}.1$ext \\
2ffe923
  --slave %{_mandir}/man1/jdb.1$ext jdb.1$ext \\
2ffe923
  %{_mandir}/man1/jdb-%{uniquesuffix -- %{?1}}.1$ext \\
2ffe923
  --slave %{_mandir}/man1/jdeps.1$ext jdeps.1$ext \\
2ffe923
  %{_mandir}/man1/jdeps-%{uniquesuffix -- %{?1}}.1$ext \\
2ffe923
  --slave %{_mandir}/man1/jinfo.1$ext jinfo.1$ext \\
2ffe923
  %{_mandir}/man1/jinfo-%{uniquesuffix -- %{?1}}.1$ext \\
2ffe923
  --slave %{_mandir}/man1/jmap.1$ext jmap.1$ext \\
2ffe923
  %{_mandir}/man1/jmap-%{uniquesuffix -- %{?1}}.1$ext \\
2ffe923
  --slave %{_mandir}/man1/jps.1$ext jps.1$ext \\
2ffe923
  %{_mandir}/man1/jps-%{uniquesuffix -- %{?1}}.1$ext \\
a773423
  --slave %{_mandir}/man1/jpackage.1$ext jpackage.1$ext \\
e810d7e
  %{_mandir}/man1/jpackage-%{uniquesuffix -- %{?1}}.1$ext \\
2ffe923
  --slave %{_mandir}/man1/jrunscript.1$ext jrunscript.1$ext \\
2ffe923
  %{_mandir}/man1/jrunscript-%{uniquesuffix -- %{?1}}.1$ext \\
2ffe923
  --slave %{_mandir}/man1/jstack.1$ext jstack.1$ext \\
2ffe923
  %{_mandir}/man1/jstack-%{uniquesuffix -- %{?1}}.1$ext \\
2ffe923
  --slave %{_mandir}/man1/jstat.1$ext jstat.1$ext \\
2ffe923
  %{_mandir}/man1/jstat-%{uniquesuffix -- %{?1}}.1$ext \\
2ffe923
  --slave %{_mandir}/man1/jstatd.1$ext jstatd.1$ext \\
2ffe923
  %{_mandir}/man1/jstatd-%{uniquesuffix -- %{?1}}.1$ext \\
2ffe923
  --slave %{_mandir}/man1/serialver.1$ext serialver.1$ext \\
ff16d76
  %{_mandir}/man1/serialver-%{uniquesuffix -- %{?1}}.1$ext
2ffe923
2ffe923
for X in %{origin} %{javaver} ; do
2ffe923
  alternatives \\
2ffe923
    --install %{_jvmdir}/java-"$X" java_sdk_"$X" %{_jvmdir}/%{sdkdir -- %{?1}} $PRIORITY  --family %{name}.%{_arch}
2ffe923
done
2ffe923
2ffe923
update-alternatives --install %{_jvmdir}/java-%{javaver}-%{origin} java_sdk_%{javaver}_%{origin} %{_jvmdir}/%{sdkdir -- %{?1}} $PRIORITY  --family %{name}.%{_arch}
2ffe923
2ffe923
update-desktop-database %{_datadir}/applications &> /dev/null || :
2ffe923
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
2ffe923
2ffe923
exit 0
2ffe923
}
2ffe923
2ffe923
%define postun_devel() %{expand:
2ffe923
  alternatives --remove javac %{sdkbindir -- %{?1}}/javac
2ffe923
  alternatives --remove java_sdk_%{origin} %{_jvmdir}/%{sdkdir -- %{?1}}
2ffe923
  alternatives --remove java_sdk_%{javaver} %{_jvmdir}/%{sdkdir -- %{?1}}
2ffe923
  alternatives --remove java_sdk_%{javaver}_%{origin} %{_jvmdir}/%{sdkdir -- %{?1}}
2ffe923
2ffe923
update-desktop-database %{_datadir}/applications &> /dev/null || :
2ffe923
2ffe923
if [ $1 -eq 0 ] ; then
2ffe923
    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
2ffe923
    %{update_desktop_icons}
2ffe923
fi
2ffe923
exit 0
2ffe923
}
2ffe923
2ffe923
%define posttrans_devel() %{expand:
2ffe923
%{update_desktop_icons}
2ffe923
}
2ffe923
2ffe923
%define post_javadoc() %{expand:
2ffe923
2ffe923
PRIORITY=%{priority}
2ffe923
if [ "%{?1}" == %{debug_suffix} ]; then
2ffe923
  let PRIORITY=PRIORITY-1
2ffe923
fi
2ffe923
2ffe923
alternatives \\
2ffe923
  --install %{_javadocdir}/java javadocdir %{_javadocdir}/%{uniquejavadocdir -- %{?1}}/api \\
2ffe923
  $PRIORITY  --family %{name}
2ffe923
exit 0
2ffe923
}
2ffe923
2ffe923
%define postun_javadoc() %{expand:
2ffe923
  alternatives --remove javadocdir %{_javadocdir}/%{uniquejavadocdir -- %{?1}}/api
2ffe923
exit 0
2ffe923
}
2ffe923
2ffe923
%define post_javadoc_zip() %{expand:
2ffe923
2ffe923
PRIORITY=%{priority}
2ffe923
if [ "%{?1}" == %{debug_suffix} ]; then
2ffe923
  let PRIORITY=PRIORITY-1
2ffe923
fi
2ffe923
2ffe923
alternatives \\
2ffe923
  --install %{_javadocdir}/java-zip javadoczip %{_javadocdir}/%{uniquejavadocdir -- %{?1}}.zip \\
2ffe923
  $PRIORITY  --family %{name}
2ffe923
exit 0
2ffe923
}
2ffe923
2ffe923
%define postun_javadoc_zip() %{expand:
2ffe923
  alternatives --remove javadoczip %{_javadocdir}/%{uniquejavadocdir -- %{?1}}.zip
2ffe923
exit 0
2ffe923
}
2ffe923
2ffe923
%define files_jre() %{expand:
2ffe923
%{_datadir}/icons/hicolor/*x*/apps/java-%{javaver}-%{origin}.png
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libsplashscreen.so
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libawt_xawt.so
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjawt.so
2ffe923
}
2ffe923
2ffe923
2ffe923
%define files_jre_headless() %{expand:
2ffe923
%license %{_jvmdir}/%{sdkdir -- %{?1}}/legal
Andrew John Hughes ca2c868
%doc %{_defaultdocdir}/%{uniquejavadocdir -- %{?1}}/NEWS
2ffe923
%dir %{_sysconfdir}/.java/.systemPrefs
2ffe923
%dir %{_sysconfdir}/.java
2ffe923
%dir %{_jvmdir}/%{sdkdir -- %{?1}}
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/release
2ffe923
%{_jvmdir}/%{jrelnk -- %{?1}}
2ffe923
%dir %{_jvmdir}/%{sdkdir -- %{?1}}/bin
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/java
b1f2c50
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/%{alt_java_name}
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/keytool
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/rmiregistry
2ffe923
%dir %{_jvmdir}/%{sdkdir -- %{?1}}/lib
2ffe923
%ifarch %{jit_arches}
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/classlist
2ffe923
%endif
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/jexec
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/jspawnhelper
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/jrt-fs.jar
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/modules
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/psfont.properties.ja
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/psfontj2d.properties
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/tzdb.dat
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjli.so
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/jvm.cfg
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libattach.so
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libawt.so
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libextnet.so
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjsig.so
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libawt_headless.so
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libdt_socket.so
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libfontmanager.so
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libinstrument.so
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libj2gss.so
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libj2pcsc.so
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libj2pkcs11.so
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjaas.so
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjava.so
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjavajpeg.so
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjdwp.so
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjimage.so
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libjsound.so
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/liblcms.so
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libmanagement.so
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libmanagement_agent.so
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libmanagement_ext.so
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libmlib_image.so
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libnet.so
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libnio.so
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libprefs.so
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/librmi.so
ff16d76
# Some architectures don't have the serviceability agent
ff16d76
%ifarch %{sa_arches}
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libsaproc.so
2ffe923
%endif
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libsctp.so
404b854
%ifarch %{svml_arches}
404b854
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libsvml.so
404b854
%endif
404b854
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libsyslookup.so
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libverify.so
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/libzip.so
2ffe923
%dir %{_jvmdir}/%{sdkdir -- %{?1}}/lib/jfr
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/jfr/default.jfc
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/jfr/profile.jfc
2ffe923
%{_mandir}/man1/java-%{uniquesuffix -- %{?1}}.1*
b1f2c50
%{_mandir}/man1/%{alt_java_name}-%{uniquesuffix -- %{?1}}.1*
2ffe923
%{_mandir}/man1/keytool-%{uniquesuffix -- %{?1}}.1*
2ffe923
%{_mandir}/man1/rmiregistry-%{uniquesuffix -- %{?1}}.1*
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/server/
ff16d76
%ifarch %{share_arches}
2ffe923
%attr(444, root, root) %ghost %{_jvmdir}/%{sdkdir -- %{?1}}/lib/server/classes.jsa
2ffe923
%endif
2ffe923
%dir %{etcjavasubdir}
2ffe923
%dir %{etcjavadir -- %{?1}}
2ffe923
%dir %{etcjavadir -- %{?1}}/lib
2ffe923
%dir %{etcjavadir -- %{?1}}/lib/security
2ffe923
%{etcjavadir -- %{?1}}/lib/security/cacerts
2ffe923
%dir %{etcjavadir -- %{?1}}/conf
2ffe923
%dir %{etcjavadir -- %{?1}}/conf/sdp
2ffe923
%dir %{etcjavadir -- %{?1}}/conf/management
2ffe923
%dir %{etcjavadir -- %{?1}}/conf/security
2ffe923
%dir %{etcjavadir -- %{?1}}/conf/security/policy
2ffe923
%dir %{etcjavadir -- %{?1}}/conf/security/policy/limited
2ffe923
%dir %{etcjavadir -- %{?1}}/conf/security/policy/unlimited
2ffe923
%config(noreplace) %{etcjavadir -- %{?1}}/lib/security/default.policy
404b854
%config(noreplace) %{etcjavadir -- %{?1}}/lib/security/blocked.certs
2ffe923
%config(noreplace) %{etcjavadir -- %{?1}}/lib/security/public_suffix_list.dat
2ffe923
%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/policy/limited/exempt_local.policy
2ffe923
%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/policy/limited/default_local.policy
2ffe923
%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/policy/limited/default_US_export.policy
2ffe923
%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/policy/unlimited/default_local.policy
2ffe923
%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/policy/unlimited/default_US_export.policy
2ffe923
 %{etcjavadir -- %{?1}}/conf/security/policy/README.txt
2ffe923
%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/java.policy
2ffe923
%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/java.security
2ffe923
%config(noreplace) %{etcjavadir -- %{?1}}/conf/logging.properties
2ffe923
%config(noreplace) %{etcjavadir -- %{?1}}/conf/security/nss.cfg
2ffe923
%config(noreplace) %{etcjavadir -- %{?1}}/conf/management/jmxremote.access
2ffe923
# these are config templates, thus not config-noreplace
2ffe923
%config  %{etcjavadir -- %{?1}}/conf/management/jmxremote.password.template
2ffe923
%config  %{etcjavadir -- %{?1}}/conf/sdp/sdp.conf.template
2ffe923
%config(noreplace) %{etcjavadir -- %{?1}}/conf/management/management.properties
2ffe923
%config(noreplace) %{etcjavadir -- %{?1}}/conf/net.properties
2ffe923
%config(noreplace) %{etcjavadir -- %{?1}}/conf/sound.properties
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/conf
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/security
2ffe923
%if %is_system_jdk
2ffe923
%if %{is_release_build -- %{?1}}
2ffe923
%ghost %{_bindir}/java
b1f2c50
%ghost %{_bindir}/%{alt_java_name}
2ffe923
%ghost %{_jvmdir}/jre
2ffe923
%ghost %{_bindir}/keytool
2ffe923
%ghost %{_bindir}/pack200
2ffe923
%ghost %{_bindir}/rmid
2ffe923
%ghost %{_bindir}/rmiregistry
2ffe923
%ghost %{_bindir}/unpack200
2ffe923
%ghost %{_jvmdir}/jre-%{origin}
2ffe923
%ghost %{_jvmdir}/jre-%{javaver}
2ffe923
%ghost %{_jvmdir}/jre-%{javaver}-%{origin}
2ffe923
%endif
2ffe923
%endif
2ffe923
}
2ffe923
2ffe923
%define files_devel() %{expand:
2ffe923
%dir %{_jvmdir}/%{sdkdir -- %{?1}}/bin
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jar
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jarsigner
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/javac
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/javadoc
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/javap
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jconsole
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jcmd
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jdb
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jdeps
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jdeprscan
ff16d76
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jfr
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jimage
ff16d76
# Some architectures don't have the serviceability agent
ff16d76
%ifarch %{sa_arches}
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jhsdb
1ea2178
%{_mandir}/man1/jhsdb-%{uniquesuffix -- %{?1}}.1.gz
2ffe923
%endif
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jinfo
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jlink
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jmap
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jmod
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jps
a773423
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jpackage
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jrunscript
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jshell
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jstack
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jstat
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/jstatd
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/bin/serialver
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/include
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/ct.sym
2ffe923
%if %{with_systemtap}
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/tapset
2ffe923
%endif
2ffe923
%{_datadir}/applications/*jconsole%{?1}.desktop
2ffe923
%{_mandir}/man1/jar-%{uniquesuffix -- %{?1}}.1*
2ffe923
%{_mandir}/man1/jarsigner-%{uniquesuffix -- %{?1}}.1*
2ffe923
%{_mandir}/man1/javac-%{uniquesuffix -- %{?1}}.1*
2ffe923
%{_mandir}/man1/javadoc-%{uniquesuffix -- %{?1}}.1*
2ffe923
%{_mandir}/man1/javap-%{uniquesuffix -- %{?1}}.1*
2ffe923
%{_mandir}/man1/jconsole-%{uniquesuffix -- %{?1}}.1*
2ffe923
%{_mandir}/man1/jcmd-%{uniquesuffix -- %{?1}}.1*
2ffe923
%{_mandir}/man1/jdb-%{uniquesuffix -- %{?1}}.1*
2ffe923
%{_mandir}/man1/jdeps-%{uniquesuffix -- %{?1}}.1*
2ffe923
%{_mandir}/man1/jinfo-%{uniquesuffix -- %{?1}}.1*
2ffe923
%{_mandir}/man1/jmap-%{uniquesuffix -- %{?1}}.1*
2ffe923
%{_mandir}/man1/jps-%{uniquesuffix -- %{?1}}.1*
a773423
%{_mandir}/man1/jpackage-%{uniquesuffix -- %{?1}}.1*
2ffe923
%{_mandir}/man1/jrunscript-%{uniquesuffix -- %{?1}}.1*
2ffe923
%{_mandir}/man1/jstack-%{uniquesuffix -- %{?1}}.1*
2ffe923
%{_mandir}/man1/jstat-%{uniquesuffix -- %{?1}}.1*
2ffe923
%{_mandir}/man1/jstatd-%{uniquesuffix -- %{?1}}.1*
2ffe923
%{_mandir}/man1/serialver-%{uniquesuffix -- %{?1}}.1*
110204e
%{_mandir}/man1/jdeprscan-%{uniquesuffix -- %{?1}}.1.gz
110204e
%{_mandir}/man1/jlink-%{uniquesuffix -- %{?1}}.1.gz
110204e
%{_mandir}/man1/jmod-%{uniquesuffix -- %{?1}}.1.gz
110204e
%{_mandir}/man1/jshell-%{uniquesuffix -- %{?1}}.1.gz
ff60a6a
%{_mandir}/man1/jfr-%{uniquesuffix -- %{?1}}.1.gz
110204e
2ffe923
%if %{with_systemtap}
2ffe923
%dir %{tapsetroot}
2ffe923
%dir %{tapsetdirttapset}
2ffe923
%dir %{tapsetdir}
2ffe923
%{tapsetdir}/*%{_arch}%{?1}.stp
2ffe923
%endif
2ffe923
%if %is_system_jdk
2ffe923
%if %{is_release_build -- %{?1}}
2ffe923
%ghost %{_bindir}/javac
2ffe923
%ghost %{_jvmdir}/java
b1f2c50
%ghost %{_jvmdir}/%{alt_java_name}
2ffe923
%ghost %{_bindir}/jlink
2ffe923
%ghost %{_bindir}/jmod
2ffe923
%ghost %{_bindir}/jhsdb
2ffe923
%ghost %{_bindir}/jar
2ffe923
%ghost %{_bindir}/jarsigner
2ffe923
%ghost %{_bindir}/javadoc
2ffe923
%ghost %{_bindir}/javap
2ffe923
%ghost %{_bindir}/jcmd
2ffe923
%ghost %{_bindir}/jconsole
2ffe923
%ghost %{_bindir}/jdb
2ffe923
%ghost %{_bindir}/jdeps
2ffe923
%ghost %{_bindir}/jdeprscan
2ffe923
%ghost %{_bindir}/jimage
2ffe923
%ghost %{_bindir}/jinfo
2ffe923
%ghost %{_bindir}/jmap
2ffe923
%ghost %{_bindir}/jps
2ffe923
%ghost %{_bindir}/jrunscript
2ffe923
%ghost %{_bindir}/jshell
2ffe923
%ghost %{_bindir}/jstack
2ffe923
%ghost %{_bindir}/jstat
2ffe923
%ghost %{_bindir}/jstatd
2ffe923
%ghost %{_bindir}/serialver
2ffe923
%ghost %{_jvmdir}/java-%{origin}
2ffe923
%ghost %{_jvmdir}/java-%{javaver}
2ffe923
%ghost %{_jvmdir}/java-%{javaver}-%{origin}
2ffe923
%endif
2ffe923
%endif
2ffe923
}
2ffe923
2ffe923
%define files_jmods() %{expand:
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/jmods
2ffe923
}
2ffe923
2ffe923
%define files_demo() %{expand:
2ffe923
%license %{_jvmdir}/%{sdkdir -- %{?1}}/legal
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/demo
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/sample
2ffe923
}
2ffe923
2ffe923
%define files_src() %{expand:
2ffe923
%license %{_jvmdir}/%{sdkdir -- %{?1}}/legal
2ffe923
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/src.zip
2ffe923
}
2ffe923
4848b86
%define files_static_libs() %{expand:
Severin Gehwolf 29d5d3d
%dir %{_jvmdir}/%{sdkdir -- %{?1}}/lib/static
Severin Gehwolf 29d5d3d
%dir %{_jvmdir}/%{sdkdir -- %{?1}}/lib/static/linux-%{archinstall}
Severin Gehwolf 29d5d3d
%dir %{_jvmdir}/%{sdkdir -- %{?1}}/lib/static/linux-%{archinstall}/glibc
4848b86
%{_jvmdir}/%{sdkdir -- %{?1}}/lib/static/linux-%{archinstall}/glibc/lib*.a
4848b86
}
4848b86
2ffe923
%define files_javadoc() %{expand:
2ffe923
%doc %{_javadocdir}/%{uniquejavadocdir -- %{?1}}
49dc59a
%license %{_jvmdir}/%{sdkdir -- %{?1}}/legal
2ffe923
%if %is_system_jdk
2ffe923
%if %{is_release_build -- %{?1}}
2ffe923
%ghost %{_javadocdir}/java
2ffe923
%endif
2ffe923
%endif
2ffe923
}
2ffe923
2ffe923
%define files_javadoc_zip() %{expand:
2ffe923
%doc %{_javadocdir}/%{uniquejavadocdir -- %{?1}}.zip
49dc59a
%license %{_jvmdir}/%{sdkdir -- %{?1}}/legal
2ffe923
%if %is_system_jdk
2ffe923
%if %{is_release_build -- %{?1}}
2ffe923
%ghost %{_javadocdir}/java-zip
2ffe923
%endif
2ffe923
%endif
2ffe923
}
2ffe923
2ffe923
# not-duplicated requires/provides/obsoletes for normal/debug packages
2ffe923
%define java_rpo() %{expand:
2ffe923
Requires: fontconfig%{?_isa}
2ffe923
Requires: xorg-x11-fonts-Type1
ff16d76
# Require libXcomposite explicitly since it's only dynamically loaded
ff16d76
# at runtime. Fixes screenshot issues. See JDK-8150954.
ff16d76
Requires: libXcomposite%{?_isa}
2ffe923
# Requires rest of java
2ffe923
Requires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release}
2ffe923
OrderWithRequires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release}
2ffe923
# for java-X-openjdk package's desktop binding
2ffe923
Recommends: gtk3%{?_isa}
2ffe923
2ffe923
Provides: java-%{javaver}-%{origin}%{?1} = %{epoch}:%{version}-%{release}
2ffe923
2ffe923
# Standard JPackage base provides
2ffe923
Provides: jre-%{javaver}%{?1} = %{epoch}:%{version}-%{release}
2ffe923
Provides: jre-%{javaver}-%{origin}%{?1} = %{epoch}:%{version}-%{release}
2ffe923
Provides: java-%{javaver}%{?1} = %{epoch}:%{version}-%{release}
2ffe923
%if %is_system_jdk
2ffe923
Provides: java-%{origin}%{?1} = %{epoch}:%{version}-%{release}
2ffe923
Provides: jre-%{origin}%{?1} = %{epoch}:%{version}-%{release}
2ffe923
Provides: java%{?1} = %{epoch}:%{version}-%{release}
2ffe923
Provides: jre%{?1} = %{epoch}:%{version}-%{release}
2ffe923
%endif
2ffe923
}
2ffe923
2ffe923
%define java_headless_rpo() %{expand:
2ffe923
# Require /etc/pki/java/cacerts
2ffe923
Requires: ca-certificates
2ffe923
# Require javapackages-filesystem for ownership of /usr/lib/jvm/ and macros
2ffe923
Requires: javapackages-filesystem
2ffe923
# Require zone-info data provided by tzdata-java sub-package
2ffe923
Requires: tzdata-java >= 2015d
ff16d76
# for support of kernel stream control
ff16d76
# libsctp.so.1 is being `dlopen`ed on demand
ff16d76
Requires: lksctp-tools%{?_isa}
51bd7e1
%if ! 0%{?flatpak}
2ffe923
# tool to copy jdk's configs - should be Recommends only, but then only dnf/yum enforce it,
2ffe923
# not rpm transaction and so no configs are persisted when pure rpm -u is run. It may be
2ffe923
# considered as regression
a1a350d
Requires: copy-jdk-configs >= 4.0
2ffe923
OrderWithRequires: copy-jdk-configs
51bd7e1
%endif
2ffe923
# for printing support
2ffe923
Requires: cups-libs
2ffe923
# Post requires alternatives to install tool alternatives
Andrew John Hughes 7f93971
Requires(post):   %{alternatives_requires}
2ffe923
# Postun requires alternatives to uninstall tool alternatives
Andrew John Hughes 7f93971
Requires(postun): %{alternatives_requires}
2ffe923
# for optional support of kernel stream control, card reader and printing bindings
fbb116c
Suggests: lksctp-tools%{?_isa}, pcsc-lite-libs%{?_isa}
2ffe923
2ffe923
# Standard JPackage base provides
2ffe923
Provides: jre-%{javaver}-%{origin}-headless%{?1} = %{epoch}:%{version}-%{release}
2ffe923
Provides: jre-%{javaver}-headless%{?1} = %{epoch}:%{version}-%{release}
2ffe923
Provides: java-%{javaver}-%{origin}-headless%{?1} = %{epoch}:%{version}-%{release}
2ffe923
Provides: java-%{javaver}-headless%{?1} = %{epoch}:%{version}-%{release}
2ffe923
%if %is_system_jdk
2ffe923
Provides: java-%{origin}-headless%{?1} = %{epoch}:%{version}-%{release}
2ffe923
Provides: jre-%{origin}-headless%{?1} = %{epoch}:%{version}-%{release}
2ffe923
Provides: jre-headless%{?1} = %{epoch}:%{version}-%{release}
2ffe923
Provides: java-headless%{?1} = %{epoch}:%{version}-%{release}
2ffe923
%endif
2ffe923
}
2ffe923
2ffe923
%define java_devel_rpo() %{expand:
2ffe923
# Requires base package
2ffe923
Requires:         %{name}%{?1}%{?_isa} = %{epoch}:%{version}-%{release}
2ffe923
OrderWithRequires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release}
2ffe923
# Post requires alternatives to install tool alternatives
Andrew John Hughes 7f93971
Requires(post):   %{alternatives_requires}
2ffe923
# Postun requires alternatives to uninstall tool alternatives
Andrew John Hughes 7f93971
Requires(postun): %{alternatives_requires}
2ffe923
2ffe923
# Standard JPackage devel provides
2ffe923
Provides: java-sdk-%{javaver}-%{origin}%{?1} = %{epoch}:%{version}-%{release}
2ffe923
Provides: java-sdk-%{javaver}%{?1} = %{epoch}:%{version}-%{release}
2ffe923
Provides: java-%{javaver}-devel%{?1} = %{epoch}:%{version}-%{release}
2ffe923
Provides: java-%{javaver}-%{origin}-devel%{?1} = %{epoch}:%{version}-%{release}
2ffe923
%if %is_system_jdk
2ffe923
Provides: java-sdk-%{origin}%{?1} = %{epoch}:%{version}-%{release}
2ffe923
Provides: java-devel%{?1} = %{epoch}:%{version}-%{release}
f8b9b4d
Provides: java-%{origin}-devel%{?1} = %{epoch}:%{version}-%{release}
2ffe923
Provides: java-sdk%{?1} = %{epoch}:%{version}-%{release}
2ffe923
%endif
2ffe923
}
2ffe923
4848b86
%define java_static_libs_rpo() %{expand:
4848b86
Requires:         %{name}-devel%{?1}%{?_isa} = %{epoch}:%{version}-%{release}
4848b86
OrderWithRequires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release}
4848b86
}
4848b86
2ffe923
%define java_jmods_rpo() %{expand:
2ffe923
# Requires devel package
2ffe923
# as jmods are bytecode, they should be OK without any _isa
2ffe923
Requires:         %{name}-devel%{?1} = %{epoch}:%{version}-%{release}
2ffe923
OrderWithRequires: %{name}-headless%{?1} = %{epoch}:%{version}-%{release}
2ffe923
2ffe923
Provides: java-%{javaver}-jmods%{?1} = %{epoch}:%{version}-%{release}
2ffe923
Provides: java-%{javaver}-%{origin}-jmods%{?1} = %{epoch}:%{version}-%{release}
2ffe923
%if %is_system_jdk
2ffe923
Provides: java-jmods%{?1} = %{epoch}:%{version}-%{release}
2ffe923
%endif
2ffe923
}
2ffe923
2ffe923
%define java_demo_rpo() %{expand:
2ffe923
Requires: %{name}%{?1}%{?_isa} = %{epoch}:%{version}-%{release}
2ffe923
OrderWithRequires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release}
2ffe923
2ffe923
Provides: java-%{javaver}-demo%{?1} = %{epoch}:%{version}-%{release}
2ffe923
Provides: java-%{javaver}-%{origin}-demo%{?1} = %{epoch}:%{version}-%{release}
2ffe923
%if %is_system_jdk
2ffe923
Provides: java-demo%{?1} = %{epoch}:%{version}-%{release}
f8b9b4d
Provides: java-%{origin}-demo%{?1} = %{epoch}:%{version}-%{release}
2ffe923
%endif
2ffe923
}
2ffe923
2ffe923
%define java_javadoc_rpo() %{expand:
2ffe923
OrderWithRequires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release}
2ffe923
# Post requires alternatives to install javadoc alternative
Andrew John Hughes 7f93971
Requires(post):   %{alternatives_requires}
2ffe923
# Postun requires alternatives to uninstall javadoc alternative
Andrew John Hughes 7f93971
Requires(postun): %{alternatives_requires}
2ffe923
2ffe923
# Standard JPackage javadoc provides
2ffe923
Provides: java-%{javaver}-javadoc%{?1} = %{epoch}:%{version}-%{release}
2ffe923
Provides: java-%{javaver}-%{origin}-javadoc%{?1} = %{epoch}:%{version}-%{release}
2ffe923
%if %is_system_jdk
2ffe923
Provides: java-javadoc%{?1} = %{epoch}:%{version}-%{release}
2ffe923
%endif
2ffe923
}
2ffe923
2ffe923
%define java_src_rpo() %{expand:
2ffe923
Requires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release}
2ffe923
2ffe923
# Standard JPackage sources provides
2ffe923
Provides: java-%{javaver}-src%{?1} = %{epoch}:%{version}-%{release}
2ffe923
Provides: java-%{javaver}-%{origin}-src%{?1} = %{epoch}:%{version}-%{release}
2ffe923
%if %is_system_jdk
2ffe923
Provides: java-src%{?1} = %{epoch}:%{version}-%{release}
f8b9b4d
Provides: java-%{origin}-src%{?1} = %{epoch}:%{version}-%{release}
2ffe923
%endif
2ffe923
}
2ffe923
2ffe923
# Prevent brp-java-repack-jars from being run
2ffe923
%global __jar_repack 0
2ffe923
2ffe923
Name:    java-latest-%{origin}
2ffe923
Version: %{newjavaver}.%{buildver}
2ffe923
# This package needs `.rolling` as part of Release so as to not conflict on install with
2ffe923
# java-X-openjdk. I.e. when latest rolling release is also an LTS release packaged as
2ffe923
# java-X-openjdk. See: https://bugzilla.redhat.com/show_bug.cgi?id=1647298
Andrew John Hughes 7f93971
Release: %{?eaprefix}%{rpmrelease}%{?extraver}.rolling%{?dist}
2ffe923
# java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons
2ffe923
# and this change was brought into RHEL-4. java-1.5.0-ibm packages
2ffe923
# also included the epoch in their virtual provides. This created a
2ffe923
# situation where in-the-wild java-1.5.0-ibm packages provided "java =
2ffe923
# 1:1.5.0". In RPM terms, "1.6.0 < 1:1.5.0" since 1.6.0 is
2ffe923
# interpreted as 0:1.6.0. So the "java >= 1.6.0" requirement would be
2ffe923
# satisfied by the 1:1.5.0 packages. Thus we need to set the epoch in
2ffe923
# JDK package >= 1.6.0 to 1, and packages referring to JDK virtual
2ffe923
# provides >= 1.6.0 must specify the epoch, "java >= 1:1.6.0".
2ffe923
2ffe923
Epoch:   1
Andrew John Hughes ca2c868
Summary: %{origin_nice} %{featurever} Runtime Environment
2ffe923
2ffe923
# HotSpot code is licensed under GPLv2
2ffe923
# JDK library code is licensed under GPLv2 with the Classpath exception
2ffe923
# The Apache license is used in code taken from Apache projects (primarily xalan & xerces)
2ffe923
# DOM levels 2 & 3 and the XML digital signature schemas are licensed under the W3C Software License
2ffe923
# The JSR166 concurrency code is in the public domain
2ffe923
# The BSD and MIT licenses are used for a number of third-party libraries (see ADDITIONAL_LICENSE_INFO)
2ffe923
# The OpenJDK source tree includes:
2ffe923
# - JPEG library (IJG), zlib & libpng (zlib), giflib (MIT), harfbuzz (ISC),
2ffe923
# - freetype (FTL), jline (BSD) and LCMS (MIT)
2ffe923
# - jquery (MIT), jdk.crypto.cryptoki PKCS 11 wrapper (RSA)
2ffe923
# - public_suffix_list.dat from publicsuffix.org (MPLv2.0)
2ffe923
# The test code includes copies of NSS under the Mozilla Public License v2.0
2ffe923
# The PCSClite headers are under a BSD with advertising license
2ffe923
# The elliptic curve cryptography (ECC) source code is licensed under the LGPLv2.1 or any later version
2ffe923
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
2ffe923
URL:      http://openjdk.java.net/
2ffe923
2ffe923
ff16d76
# to regenerate source0 (jdk) run update_package.sh
2ffe923
# update_package.sh contains hard-coded repos, revisions, tags, and projects to regenerate the source archives
404b854
Source0: openjdk-jdk%{featurever}-jdk-%{filever}+%{buildver}%{?tagsuffix:-%{tagsuffix}}.tar.xz
ed8c45a
#Source0: openjdk-jdk%{featurever}-jdk-%{filever}+%{buildver}.tar.xz
ff16d76
ff16d76
# Use 'icedtea_sync.sh' to update the following
ff16d76
# They are based on code contained in the IcedTea project (3.x).
ff16d76
# Systemtap tapsets. Zipped up to keep it small.
ff16d76
Source8: tapsets-icedtea-%{icedteaver}.tar.xz
2ffe923
2ffe923
# Desktop files. Adapted from IcedTea
2ffe923
Source9: jconsole.desktop.in
2ffe923
Andrew John Hughes ca2c868
# Release notes
Andrew John Hughes ca2c868
Source10: NEWS
Andrew John Hughes ca2c868
2ffe923
# nss configuration file
2ffe923
Source11: nss.cfg.in
2ffe923
2ffe923
# Removed libraries that we link instead
2ffe923
Source12: remove-intree-libraries.sh
2ffe923
2ffe923
# Ensure we aren't using the limited crypto policy
2ffe923
Source13: TestCryptoLevel.java
2ffe923
2ffe923
# Ensure ECDSA is working
2ffe923
Source14: TestECDSA.java
2ffe923
ff16d76
# Verify system crypto (policy) can be disabled via a property
ff16d76
Source15: TestSecurityProperties.java
ff16d76
2ffe923
############################################
2ffe923
#
2ffe923
# RPM/distribution specific patches
2ffe923
#
2ffe923
############################################
2ffe923
2ffe923
# NSS via SunPKCS11 Provider (disabled comment
2ffe923
# due to memory leak).
2ffe923
Patch1000: rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch
cf13269
# enable build of speculative store bypass hardened alt-java
1ed171d
Patch600: rh1750419-redhat_alt_java.patch
2ffe923
2ffe923
# Ignore AWTError when assistive technologies are loaded
2ffe923
Patch1:    rh1648242-accessible_toolkit_crash_do_not_break_jvm.patch
2ffe923
# Restrict access to java-atk-wrapper classes
2ffe923
Patch2:    rh1648644-java_access_bridge_privileged_security.patch
2ffe923
Patch3:    rh649512-remove_uses_of_far_in_jpeg_libjpeg_turbo_1_4_compat_for_jdk10_and_up.patch
2ffe923
# Follow system wide crypto policy RHBZ#1249083
2ffe923
Patch4:    pr3183-rh1340845-support_fedora_rhel_system_crypto_policy.patch
2ffe923
# Depend on pcs-lite-libs instead of pcs-lite-devel as this is only in optional repo
2ffe923
Patch6: rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-devel.patch
0f4f0ca
e0187b4
#############################################
e0187b4
#
e63e26c
# OpenJDK patches in need of upstreaming
e0187b4
#
e0187b4
#############################################
e63e26c
e0187b4
2ffe923
BuildRequires: autoconf
2ffe923
BuildRequires: automake
2ffe923
BuildRequires: alsa-lib-devel
2ffe923
BuildRequires: binutils
2ffe923
BuildRequires: cups-devel
2ffe923
BuildRequires: desktop-file-utils
2ffe923
# elfutils only are OK for build without AOT
2ffe923
BuildRequires: elfutils-devel
da8c46f
BuildRequires: fontconfig-devel
2ffe923
BuildRequires: freetype-devel
2ffe923
BuildRequires: giflib-devel
2ffe923
BuildRequires: gcc-c++
2ffe923
BuildRequires: gdb
Andrew John Hughes c5efa6b
BuildRequires: harfbuzz-devel
2ffe923
BuildRequires: lcms2-devel
2ffe923
BuildRequires: libjpeg-devel
2ffe923
BuildRequires: libpng-devel
2ffe923
BuildRequires: libxslt
2ffe923
BuildRequires: libX11-devel
2ffe923
BuildRequires: libXi-devel
2ffe923
BuildRequires: libXinerama-devel
da8c46f
BuildRequires: libXrandr-devel
da8c46f
BuildRequires: libXrender-devel
2ffe923
BuildRequires: libXt-devel
2ffe923
BuildRequires: libXtst-devel
2ffe923
# Requirements for setting up the nss.cfg
2ffe923
BuildRequires: nss-devel
2ffe923
BuildRequires: pkgconfig
2ffe923
BuildRequires: xorg-x11-proto-devel
2ffe923
BuildRequires: zip
2ffe923
BuildRequires: javapackages-filesystem
110204e
BuildRequires: java-latest-openjdk-devel
2ffe923
# Zero-assembler build requirement
2ffe923
%ifnarch %{jit_arches}
2ffe923
BuildRequires: libffi-devel
2ffe923
%endif
2ffe923
BuildRequires: tzdata-java >= 2015d
2ffe923
# Earlier versions have a bug in tree vectorization on PPC
2ffe923
BuildRequires: gcc >= 4.8.3-8
2ffe923
2ffe923
%if %{with_systemtap}
2ffe923
BuildRequires: systemtap-sdt-devel
2ffe923
%endif
31af2fd
BuildRequires: make
2ffe923
2ffe923
# this is always built, also during debug-only build
2ffe923
# when it is built in debug-only this package is just placeholder
2ffe923
%{java_rpo %{nil}}
2ffe923
2ffe923
%description
Andrew John Hughes ca2c868
The %{origin_nice} %{featurever} runtime environment.
2ffe923
2ffe923
%if %{include_debug_build}
2ffe923
%package slowdebug
Andrew John Hughes ca2c868
Summary: %{origin_nice} %{featurever} Runtime Environment %{debug_on}
2ffe923
2ffe923
%{java_rpo -- %{debug_suffix_unquoted}}
2ffe923
%description slowdebug
Andrew John Hughes ca2c868
The %{origin_nice} %{featurever} runtime environment.
2ffe923
%{debug_warning}
2ffe923
%endif
2ffe923
01a09a2
%if %{include_fastdebug_build}
01a09a2
%package fastdebug
Andrew John Hughes ca2c868
Summary: %{origin_nice} %{featurever} Runtime Environment %{fastdebug_on}
01a09a2
Group:   Development/Languages
01a09a2
01a09a2
%{java_rpo -- %{fastdebug_suffix_unquoted}}
01a09a2
%description fastdebug
Andrew John Hughes ca2c868
The %{origin_nice} %{featurever} runtime environment.
01a09a2
%{fastdebug_warning}
01a09a2
%endif
01a09a2
2ffe923
%if %{include_normal_build}
2ffe923
%package headless
Andrew John Hughes ca2c868
Summary: %{origin_nice} %{featurever} Headless Runtime Environment
2ffe923
2ffe923
%{java_headless_rpo %{nil}}
2ffe923
2ffe923
%description headless
Andrew John Hughes ca2c868
The %{origin_nice} %{featurever} runtime environment without audio and video support.
2ffe923
%endif
2ffe923
2ffe923
%if %{include_debug_build}
2ffe923
%package headless-slowdebug
Andrew John Hughes ca2c868
Summary: %{origin_nice} %{featurever} Runtime Environment %{debug_on}
2ffe923
2ffe923
%{java_headless_rpo -- %{debug_suffix_unquoted}}
2ffe923
2ffe923
%description headless-slowdebug
Andrew John Hughes ca2c868
The %{origin_nice} %{featurever} runtime environment without audio and video support.
2ffe923
%{debug_warning}
2ffe923
%endif
2ffe923
01a09a2
%if %{include_fastdebug_build}
01a09a2
%package headless-fastdebug
Andrew John Hughes ca2c868
Summary: %{origin_nice} %{featurever} Runtime Environment %{fastdebug_on}
01a09a2
Group:   Development/Languages
01a09a2
01a09a2
%{java_headless_rpo -- %{fastdebug_suffix_unquoted}}
01a09a2
01a09a2
%description headless-fastdebug
Andrew John Hughes ca2c868
The %{origin_nice} %{featurever} runtime environment without audio and video support.
01a09a2
%{fastdebug_warning}
01a09a2
%endif
01a09a2
2ffe923
%if %{include_normal_build}
2ffe923
%package devel
Andrew John Hughes ca2c868
Summary: %{origin_nice} %{featurever} Development Environment
2ffe923
2ffe923
%{java_devel_rpo %{nil}}
2ffe923
2ffe923
%description devel
Andrew John Hughes ca2c868
The %{origin_nice} %{featurever} development tools.
2ffe923
%endif
2ffe923
2ffe923
%if %{include_debug_build}
2ffe923
%package devel-slowdebug
Andrew John Hughes ca2c868
Summary: %{origin_nice} %{featurever} Development Environment %{debug_on}
2ffe923
2ffe923
%{java_devel_rpo -- %{debug_suffix_unquoted}}
2ffe923
2ffe923
%description devel-slowdebug
Andrew John Hughes ca2c868
The %{origin_nice} %{featurever} development tools.
2ffe923
%{debug_warning}
2ffe923
%endif
2ffe923
01a09a2
%if %{include_fastdebug_build}
01a09a2
%package devel-fastdebug
Andrew John Hughes ca2c868
Summary: %{origin_nice} %{featurever} Development Environment %{fastdebug_on}
01a09a2
Group:   Development/Tools
01a09a2
01a09a2
%{java_devel_rpo -- %{fastdebug_suffix_unquoted}}
01a09a2
01a09a2
%description devel-fastdebug
Andrew John Hughes ca2c868
The %{origin_nice} %{featurever} development tools              .
01a09a2
%{fastdebug_warning}
01a09a2
%endif
01a09a2
Severin Gehwolf 7ba3ca3
%if %{include_staticlibs}
Severin Gehwolf 7ba3ca3
2ffe923
%if %{include_normal_build}
4848b86
%package static-libs
Andrew John Hughes ca2c868
Summary: %{origin_nice} %{featurever} libraries for static linking
4848b86
4848b86
%{java_static_libs_rpo %{nil}}
4848b86
4848b86
%description static-libs
Andrew John Hughes ca2c868
The %{origin_nice} %{featurever} libraries for static linking.
4848b86
%endif
4848b86
4848b86
%if %{include_debug_build}
4848b86
%package static-libs-slowdebug
Andrew John Hughes ca2c868
Summary: %{origin_nice} %{featurever} libraries for static linking %{debug_on}
4848b86
4848b86
%{java_static_libs_rpo -- %{debug_suffix_unquoted}}
4848b86
4848b86
%description static-libs-slowdebug
Andrew John Hughes ca2c868
The %{origin_nice} %{featurever} libraries for static linking.
4848b86
%{debug_warning}
4848b86
%endif
4848b86
4848b86
%if %{include_fastdebug_build}
4848b86
%package static-libs-fastdebug
Andrew John Hughes ca2c868
Summary: %{origin_nice} %{featurever} libraries for static linking %{fastdebug_on}
4848b86
4848b86
%{java_static_libs_rpo -- %{fastdebug_suffix_unquoted}}
4848b86
4848b86
%description static-libs-fastdebug
Andrew John Hughes ca2c868
The %{origin_nice} %{featurever} libraries for static linking.
4848b86
%{fastdebug_warning}
4848b86
%endif
4848b86
Severin Gehwolf 7ba3ca3
# staticlibs
Severin Gehwolf 7ba3ca3
%endif
Severin Gehwolf 7ba3ca3
4848b86
%if %{include_normal_build}
2ffe923
%package jmods
Andrew John Hughes ca2c868
Summary: JMods for %{origin_nice} %{featurever}
2ffe923
2ffe923
%{java_jmods_rpo %{nil}}
2ffe923
2ffe923
%description jmods
Andrew John Hughes ca2c868
The JMods for %{origin_nice} %{featurever}.
2ffe923
%endif
2ffe923
2ffe923
%if %{include_debug_build}
2ffe923
%package jmods-slowdebug
Andrew John Hughes ca2c868
Summary: JMods for %{origin_nice} %{featurever} %{debug_on}
2ffe923
2ffe923
%{java_jmods_rpo -- %{debug_suffix_unquoted}}
2ffe923
2ffe923
%description jmods-slowdebug
Andrew John Hughes ca2c868
The JMods for %{origin_nice} %{featurever}.
2ffe923
%{debug_warning}
2ffe923
%endif
2ffe923
01a09a2
%if %{include_fastdebug_build}
01a09a2
%package jmods-fastdebug
Andrew John Hughes ca2c868
Summary: JMods for %{origin_nice} %{featurever} %{fastdebug_on}
01a09a2
Group:   Development/Tools
01a09a2
01a09a2
%{java_jmods_rpo -- %{fastdebug_suffix_unquoted}}
01a09a2
01a09a2
%description jmods-fastdebug
Andrew John Hughes ca2c868
The JMods for %{origin_nice} %{featurever}.
01a09a2
%{fastdebug_warning}
01a09a2
%endif
01a09a2
01a09a2
2ffe923
%if %{include_normal_build}
2ffe923
%package demo
Andrew John Hughes ca2c868
Summary: %{origin_nice} %{featurever} Demos
2ffe923
2ffe923
%{java_demo_rpo %{nil}}
2ffe923
2ffe923
%description demo
Andrew John Hughes ca2c868
The %{origin_nice} %{featurever} demos.
2ffe923
%endif
2ffe923
2ffe923
%if %{include_debug_build}
2ffe923
%package demo-slowdebug
Andrew John Hughes ca2c868
Summary: %{origin_nice} %{featurever} Demos %{debug_on}
2ffe923
2ffe923
%{java_demo_rpo -- %{debug_suffix_unquoted}}
2ffe923
2ffe923
%description demo-slowdebug
Andrew John Hughes ca2c868
The %{origin_nice} %{featurever} demos.
2ffe923
%{debug_warning}
2ffe923
%endif
2ffe923
01a09a2
%if %{include_fastdebug_build}
01a09a2
%package demo-fastdebug
Andrew John Hughes ca2c868
Summary: %{origin_nice} %{featurever} Demos %{fastdebug_on}
01a09a2
Group:   Development/Languages
01a09a2
01a09a2
%{java_demo_rpo -- %{fastdebug_suffix_unquoted}}
01a09a2
01a09a2
%description demo-fastdebug
Andrew John Hughes ca2c868
The %{origin_nice} %{featurever} demos.
01a09a2
%{fastdebug_warning}
01a09a2
%endif
01a09a2
2ffe923
%if %{include_normal_build}
2ffe923
%package src
Andrew John Hughes ca2c868
Summary: %{origin_nice} %{featurever} Source Bundle
2ffe923
2ffe923
%{java_src_rpo %{nil}}
2ffe923
2ffe923
%description src
Andrew John Hughes ca2c868
The %{compatiblename}-src sub-package contains the complete %{origin_nice} %{featurever}
2ffe923
class library source code for use by IDE indexers and debuggers.
2ffe923
%endif
2ffe923
2ffe923
%if %{include_debug_build}
2ffe923
%package src-slowdebug
Andrew John Hughes ca2c868
Summary: %{origin_nice} %{featurever} Source Bundle %{for_debug}
2ffe923
2ffe923
%{java_src_rpo -- %{debug_suffix_unquoted}}
2ffe923
2ffe923
%description src-slowdebug
Andrew John Hughes ca2c868
The %{compatiblename}-src-slowdebug sub-package contains the complete %{origin_nice} %{featurever}
Andrew John Hughes ca2c868
 class library source code for use by IDE indexers and debuggers, %{for_debug}.
2ffe923
%endif
2ffe923
01a09a2
%if %{include_fastdebug_build}
01a09a2
%package src-fastdebug
Andrew John Hughes ca2c868
Summary: %{origin_nice} %{featurever} Source Bundle %{for_fastdebug}
01a09a2
Group:   Development/Languages
01a09a2
01a09a2
%{java_src_rpo -- %{fastdebug_suffix_unquoted}}
01a09a2
01a09a2
%description src-fastdebug
Andrew John Hughes ca2c868
The %{compatiblename}-src-fastdebug sub-package contains the complete %{origin_nice} %{featurever}
Andrew John Hughes ca2c868
 class library source code for use by IDE indexers and debuggers, %{for_fastdebug}.
01a09a2
%endif
01a09a2
01a09a2
2ffe923
%if %{include_normal_build}
2ffe923
%package javadoc
Andrew John Hughes ca2c868
Summary: %{origin_nice} %{featurever} API documentation
2ffe923
Requires: javapackages-filesystem
d38ad11
Obsoletes: javadoc-slowdebug < 1:13.0.0.33-1.rolling
2ffe923
2ffe923
%{java_javadoc_rpo %{nil}}
2ffe923
2ffe923
%description javadoc
Andrew John Hughes ca2c868
The %{origin_nice} %{featurever} API documentation.
ff16d76
%endif
2ffe923
ff16d76
%if %{include_normal_build}
2ffe923
%package javadoc-zip
Andrew John Hughes ca2c868
Summary: %{origin_nice} %{featurever} API documentation compressed in a single archive
2ffe923
Requires: javapackages-filesystem
d38ad11
Obsoletes: javadoc-zip-slowdebug < 1:13.0.0.33-1.rolling
2ffe923
2ffe923
%{java_javadoc_rpo %{nil}}
2ffe923
2ffe923
%description javadoc-zip
Andrew John Hughes ca2c868
The %{origin_nice} %{featurever} API documentation compressed in a single archive.
2ffe923
%endif
2ffe923
2ffe923
%prep
2ffe923
if [ %{include_normal_build} -eq 0 -o  %{include_normal_build} -eq 1 ] ; then
2ffe923
  echo "include_normal_build is %{include_normal_build}"
2ffe923
else
01a09a2
  echo "include_normal_build is %{include_normal_build}, that is invalid. Use 1 for yes or 0 for no"
2ffe923
  exit 11
2ffe923
fi
2ffe923
if [ %{include_debug_build} -eq 0 -o  %{include_debug_build} -eq 1 ] ; then
2ffe923
  echo "include_debug_build is %{include_debug_build}"
2ffe923
else
01a09a2
  echo "include_debug_build is %{include_debug_build}, that is invalid. Use 1 for yes or 0 for no"
2ffe923
  exit 12
2ffe923
fi
01a09a2
if [ %{include_fastdebug_build} -eq 0 -o  %{include_fastdebug_build} -eq 1 ] ; then
01a09a2
  echo "include_fastdebug_build is %{include_fastdebug_build}"
01a09a2
else
01a09a2
  echo "include_fastdebug_build is %{include_fastdebug_build}, that is invalid. Use 1 for yes or 0 for no"
2ffe923
  exit 13
2ffe923
fi
01a09a2
if [ %{include_debug_build} -eq 0 -a  %{include_normal_build} -eq 0 -a  %{include_fastdebug_build} -eq 0 ] ; then
01a09a2
  echo "You have disabled all builds (normal,fastdebug,slowdebug). That is a no go."
01a09a2
  exit 14
01a09a2
fi
01a09a2
if [ %{include_normal_build} -eq 0 ] ; then
01a09a2
  echo "You have disabled the normal build, but this is required to provide docs for the debug build."
01a09a2
  exit 15
01a09a2
fi
2ffe923
%setup -q -c -n %{uniquesuffix ""} -T -a 0
2ffe923
# https://bugzilla.redhat.com/show_bug.cgi?id=1189084
2ffe923
prioritylength=`expr length %{priority}`
2ffe923
if [ $prioritylength -ne 8 ] ; then
2ffe923
 echo "priority must be 8 digits in total, violated"
2ffe923
 exit 14
2ffe923
fi
2ffe923
2ffe923
# OpenJDK patches
Severin Gehwolf 7ba3ca3
# Remove libraries that are linked by both static and dynamic builds
Severin Gehwolf 7ba3ca3
sh %{SOURCE12} %{top_level_dir_name}
2ffe923
Severin Gehwolf 7ba3ca3
# Patch the JDK
2ffe923
pushd %{top_level_dir_name}
2ffe923
%patch1 -p1
2ffe923
%patch2 -p1
2ffe923
%patch3 -p1
2ffe923
%patch4 -p1
2ffe923
%patch6 -p1
2ffe923
popd # openjdk
2ffe923
2ffe923
%patch1000
1ed171d
%patch600
2ffe923
2ffe923
# Extract systemtap tapsets
2ffe923
%if %{with_systemtap}
2ffe923
tar --strip-components=1 -x -I xz -f %{SOURCE8}
2ffe923
%if %{include_debug_build}
2ffe923
cp -r tapset tapset%{debug_suffix}
2ffe923
%endif
01a09a2
%if %{include_fastdebug_build}
01a09a2
cp -r tapset tapset%{fastdebug_suffix}
01a09a2
%endif
2ffe923
2ffe923
2ffe923
for suffix in %{build_loop} ; do
2ffe923
  for file in "tapset"$suffix/*.in; do
2ffe923
    OUTPUT_FILE=`echo $file | sed -e "s:\.stp\.in$:%{version}-%{release}.%{_arch}.stp:g"`
2ffe923
    sed -e "s:@ABS_SERVER_LIBJVM_SO@:%{_jvmdir}/%{sdkdir -- $suffix}/lib/server/libjvm.so:g" $file > $file.1
2ffe923
# TODO find out which architectures other than i686 have a client vm
2ffe923
%ifarch %{ix86}
2ffe923
    sed -e "s:@ABS_CLIENT_LIBJVM_SO@:%{_jvmdir}/%{sdkdir -- $suffix}/lib/client/libjvm.so:g" $file.1 > $OUTPUT_FILE
2ffe923
%else
2ffe923
    sed -e "/@ABS_CLIENT_LIBJVM_SO@/d" $file.1 > $OUTPUT_FILE
2ffe923
%endif
2ffe923
    sed -i -e "s:@ABS_JAVA_HOME_DIR@:%{_jvmdir}/%{sdkdir -- $suffix}:g" $OUTPUT_FILE
2ffe923
    sed -i -e "s:@INSTALL_ARCH_DIR@:%{archinstall}:g" $OUTPUT_FILE
2ffe923
    sed -i -e "s:@prefix@:%{_jvmdir}/%{sdkdir -- $suffix}/:g" $OUTPUT_FILE
2ffe923
  done
2ffe923
done
2ffe923
# systemtap tapsets ends
2ffe923
%endif
2ffe923
2ffe923
# Prepare desktop files
2ffe923
for suffix in %{build_loop} ; do
2ffe923
for file in %{SOURCE9}; do
2ffe923
    FILE=`basename $file | sed -e s:\.in$::g`
2ffe923
    EXT="${FILE##*.}"
2ffe923
    NAME="${FILE%.*}"
2ffe923
    OUTPUT_FILE=$NAME$suffix.$EXT
2ffe923
    sed    -e  "s:@JAVA_HOME@:%{sdkbindir -- $suffix}:g" $file > $OUTPUT_FILE
2ffe923
    sed -i -e  "s:@JRE_HOME@:%{jrebindir -- $suffix}:g" $OUTPUT_FILE
2ffe923
    sed -i -e  "s:@ARCH@:%{version}-%{release}.%{_arch}$suffix:g" $OUTPUT_FILE
Andrew John Hughes ca2c868
    sed -i -e  "s:@JAVA_MAJOR_VERSION@:%{featurever}:g" $OUTPUT_FILE
2ffe923
    sed -i -e  "s:@JAVA_VENDOR@:%{origin}:g" $OUTPUT_FILE
2ffe923
done
2ffe923
done
2ffe923
2ffe923
# Setup nss.cfg
2ffe923
sed -e "s:@NSS_LIBDIR@:%{NSS_LIBDIR}:g" %{SOURCE11} > nss.cfg
2ffe923
2ffe923
2ffe923
%build
2ffe923
# How many CPU's do we have?
2ffe923
export NUM_PROC=%(/usr/bin/getconf _NPROCESSORS_ONLN 2> /dev/null || :)
2ffe923
export NUM_PROC=${NUM_PROC:-1}
2ffe923
%if 0%{?_smp_ncpus_max}
2ffe923
# Honor %%_smp_ncpus_max
2ffe923
[ ${NUM_PROC} -gt %{?_smp_ncpus_max} ] && export NUM_PROC=%{?_smp_ncpus_max}
2ffe923
%endif
2ffe923
2ffe923
%ifarch s390x sparc64 alpha %{power64} %{aarch64}
2ffe923
export ARCH_DATA_MODEL=64
2ffe923
%endif
2ffe923
%ifarch alpha
2ffe923
export CFLAGS="$CFLAGS -mieee"
2ffe923
%endif
2ffe923
2ffe923
# We use ourcppflags because the OpenJDK build seems to
2ffe923
# pass EXTRA_CFLAGS to the HotSpot C++ compiler...
2ffe923
# Explicitly set the C++ standard as the default has changed on GCC >= 6
Andrew John Hughes c5efa6b
EXTRA_CFLAGS="%ourcppflags"
Andrew John Hughes c5efa6b
EXTRA_CPP_FLAGS="%ourcppflags"
0f4f0ca
2ffe923
%ifarch %{power64} ppc
2ffe923
# fix rpmlint warnings
2ffe923
EXTRA_CFLAGS="$EXTRA_CFLAGS -fno-strict-aliasing"
2ffe923
%endif
2ffe923
export EXTRA_CFLAGS
2ffe923
2ffe923
for suffix in %{build_loop} ; do
2ffe923
if [ "x$suffix" = "x" ] ; then
2ffe923
  debugbuild=release
2ffe923
else
2ffe923
  # change --something to something
2ffe923
  debugbuild=`echo $suffix  | sed "s/-//g"`
2ffe923
fi
2ffe923
Severin Gehwolf 7ba3ca3
for loop in %{main_suffix} %{staticlibs_loop} ; do
Severin Gehwolf 7ba3ca3
Severin Gehwolf 7ba3ca3
if test "x${loop}" = "x%{main_suffix}" ; then
Severin Gehwolf 7ba3ca3
    # Copy the source tree so we can remove all in-tree libraries
Severin Gehwolf 7ba3ca3
    cp -a %{top_level_dir_name} %{top_level_dir_name_backup}
Severin Gehwolf 7ba3ca3
    # Remove all libraries that are linked
Severin Gehwolf 7ba3ca3
    sh %{SOURCE12} %{top_level_dir_name} full
Severin Gehwolf 7ba3ca3
    # Variable used by configure and hs_err hook on build failures
Severin Gehwolf 7ba3ca3
    link_opt="system"
Severin Gehwolf 7ba3ca3
    # Debug builds don't need same targets as release for
Severin Gehwolf 7ba3ca3
    # build speed-up
Severin Gehwolf 7ba3ca3
    maketargets="%{release_targets}"
Severin Gehwolf 7ba3ca3
    if echo $debugbuild | grep -q "debug" ; then
Severin Gehwolf 7ba3ca3
	maketargets="%{debug_targets}"
Severin Gehwolf 7ba3ca3
    fi
Severin Gehwolf 7ba3ca3
else
Severin Gehwolf 7ba3ca3
    # Variable used by configure and hs_err hook on build failures
Severin Gehwolf 7ba3ca3
    link_opt="bundled"
Severin Gehwolf 7ba3ca3
    # Static library cycle only builds the static libraries
Severin Gehwolf 7ba3ca3
    maketargets="%{static_libs_target}"
Severin Gehwolf 7ba3ca3
fi
2ffe923
Severin Gehwolf 7ba3ca3
top_dir_abs_src_path=$(pwd)/%{top_level_dir_name}
Severin Gehwolf 7ba3ca3
top_dir_abs_build_path=$(pwd)/%{buildoutputdir -- ${suffix}${loop}}
Andrew John Hughes c5efa6b
# The OpenJDK version file includes the current
Andrew John Hughes c5efa6b
# upstream version information. For some reason,
Andrew John Hughes c5efa6b
# configure does not automatically use the
Andrew John Hughes c5efa6b
# default pre-version supplied there (despite
Andrew John Hughes c5efa6b
# what the file claims), so we pass it manually
Andrew John Hughes c5efa6b
# to configure
404b854
VERSION_FILE=${top_dir_abs_src_path}/make/conf/version-numbers.conf
Andrew John Hughes c5efa6b
if [ -f ${VERSION_FILE} ] ; then
Andrew John Hughes c5efa6b
    EA_DESIGNATOR=$(grep '^DEFAULT_PROMOTED_VERSION_PRE' ${VERSION_FILE} | cut -d '=' -f 2)
Andrew John Hughes c5efa6b
else
Andrew John Hughes c5efa6b
    echo "Could not find OpenJDK version file.";
Andrew John Hughes c5efa6b
    exit 16
Andrew John Hughes c5efa6b
fi
Andrew John Hughes c5efa6b
if [ "x${EA_DESIGNATOR}" != "x%{expected_ea_designator}" ] ; then
Andrew John Hughes c5efa6b
    echo "Spec file is configured for a %{build_type} build, but upstream version-pre setting is ${EA_DESIGNATOR}";
Andrew John Hughes c5efa6b
    exit 17
Andrew John Hughes c5efa6b
fi
Andrew John Hughes c5efa6b
Severin Gehwolf 7ba3ca3
mkdir -p ${top_dir_abs_build_path}
Severin Gehwolf 7ba3ca3
pushd ${top_dir_abs_build_path}
2ffe923
Severin Gehwolf 7ba3ca3
bash ${top_dir_abs_src_path}/configure \
2ffe923
%ifnarch %{jit_arches}
2ffe923
    --with-jvm-variants=zero \
2ffe923
%endif
2ffe923
%ifarch %{ppc64le}
2ffe923
    --with-jobs=1 \
2ffe923
%endif
2ffe923
    --with-version-build=%{buildver} \
Andrew John Hughes c5efa6b
    --with-version-pre="${EA_DESIGNATOR}" \
2ffe923
    --with-version-opt=%{lts_designator} \
2ffe923
    --with-vendor-version-string="%{vendor_version_string}" \
e0187b4
    --with-vendor-name="Red Hat, Inc." \
9d47beb
    --with-vendor-url="https://www.redhat.com/" \
9d47beb
    --with-vendor-bug-url="%{bugs}" \
9d47beb
    --with-vendor-vm-bug-url="%{bugs}" \
2ffe923
    --with-boot-jdk=/usr/lib/jvm/java-%{buildjdkver}-openjdk \
2ffe923
    --with-debug-level=$debugbuild \
2ffe923
    --with-native-debug-symbols=internal \
2ffe923
    --enable-unlimited-crypto \
2ffe923
    --with-zlib=system \
Severin Gehwolf 7ba3ca3
    --with-libjpeg=${link_opt} \
Severin Gehwolf 7ba3ca3
    --with-giflib=${link_opt} \
Severin Gehwolf 7ba3ca3
    --with-libpng=${link_opt} \
Severin Gehwolf 7ba3ca3
    --with-lcms=${link_opt} \
Severin Gehwolf 7ba3ca3
    --with-harfbuzz=${link_opt} \
2ffe923
    --with-stdc++lib=dynamic \
2ffe923
    --with-extra-cxxflags="$EXTRA_CPP_FLAGS" \
2ffe923
    --with-extra-cflags="$EXTRA_CFLAGS" \
2ffe923
    --with-extra-ldflags="%{ourldflags}" \
2ffe923
    --with-num-cores="$NUM_PROC" \
Andrew John Hughes c5efa6b
    --with-source-date="${SOURCE_DATE_EPOCH}" \
2ffe923
    --disable-javac-server \
ff16d76
%ifarch %{zgc_arches}
2ffe923
    --with-jvm-features=zgc \
2ffe923
%endif
2ffe923
    --disable-warnings-as-errors
2ffe923
Severin Gehwolf 9e49564
make \
2ffe923
    LOG=trace \
2ffe923
    WARNINGS_ARE_ERRORS="-Wno-error" \
2ffe923
    CFLAGS_WARNINGS_ARE_ERRORS="-Wno-error" \
Severin Gehwolf 7ba3ca3
    $maketargets || ( pwd; find ${top_dir_abs_src_path} ${top_dir_abs_build_path} -name "hs_err_pid*.log" | xargs cat && false )
Severin Gehwolf 7ba3ca3
Severin Gehwolf 7ba3ca3
popd >& /dev/null
Severin Gehwolf 7ba3ca3
Severin Gehwolf 7ba3ca3
# Restore original source tree if we modified it by removing full in-tree sources
Severin Gehwolf 7ba3ca3
if [ -d %{top_level_dir_name_backup} ] ; then
Severin Gehwolf 7ba3ca3
    rm -rf %{top_level_dir_name}
Severin Gehwolf 7ba3ca3
    mv %{top_level_dir_name_backup} %{top_level_dir_name}
Severin Gehwolf 7ba3ca3
fi
Severin Gehwolf 7ba3ca3
Severin Gehwolf 7ba3ca3
done # end of main / staticlibs loop
Severin Gehwolf 7ba3ca3
Severin Gehwolf 7ba3ca3
top_dir_abs_main_build_path=$(pwd)/%{buildoutputdir -- ${suffix}%{main_suffix}}
2ffe923
2ffe923
# the build (erroneously) removes read permissions from some jars
2ffe923
# this is a regression in OpenJDK 7 (our compiler):
2ffe923
# http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1437
Severin Gehwolf 7ba3ca3
find ${top_dir_abs_main_build_path}/images/%{jdkimage} -iname '*.jar' -exec chmod ugo+r {} \;
2ffe923
2ffe923
# Build screws up permissions on binaries
2ffe923
# https://bugs.openjdk.java.net/browse/JDK-8173610
Severin Gehwolf 7ba3ca3
find ${top_dir_abs_main_build_path}/images/%{jdkimage} -iname '*.so' -exec chmod +x {} \;
Severin Gehwolf 7ba3ca3
find ${top_dir_abs_main_build_path}/images/%{jdkimage}/bin/ -exec chmod +x {} \;
2ffe923
2ffe923
# Install nss.cfg right away as we will be using the JRE above
Severin Gehwolf 7ba3ca3
export JAVA_HOME=${top_dir_abs_main_build_path}/images/%{jdkimage}
2ffe923
2ffe923
# Install nss.cfg right away as we will be using the JRE above
2ffe923
install -m 644 nss.cfg $JAVA_HOME/conf/security/
2ffe923
2ffe923
# Use system-wide tzdata
2ffe923
rm $JAVA_HOME/lib/tzdb.dat
2ffe923
ln -s %{_datadir}/javazi-1.8/tzdb.dat $JAVA_HOME/lib/tzdb.dat
2ffe923
b1f2c50
# Create fake alt-java as a placeholder for future alt-java
b1f2c50
pushd ${JAVA_HOME}
b1f2c50
# add alt-java man page
b1f2c50
echo "Hardened java binary recommended for launching untrusted code from the Web e.g. javaws" > man/man1/%{alt_java_name}.1
b1f2c50
cat man/man1/java.1 >> man/man1/%{alt_java_name}.1
b1f2c50
popd
b1f2c50
2ffe923
# build cycles
Severin Gehwolf 7ba3ca3
done # end of release / debug cycle loop
2ffe923
2ffe923
%check
2ffe923
2ffe923
# We test debug first as it will give better diagnostics on a crash
2ffe923
for suffix in %{rev_build_loop} ; do
2ffe923
Severin Gehwolf 7ba3ca3
top_dir_abs_main_build_path=$(pwd)/%{buildoutputdir -- ${suffix}%{main_suffix}}
Severin Gehwolf 7ba3ca3
%if %{include_staticlibs}
Severin Gehwolf 7ba3ca3
top_dir_abs_staticlibs_build_path=$(pwd)/%{buildoutputdir -- ${suffix}%{staticlibs_loop}}
Severin Gehwolf 7ba3ca3
%endif
Severin Gehwolf 7ba3ca3
Severin Gehwolf 7ba3ca3
export JAVA_HOME=${top_dir_abs_main_build_path}/images/%{jdkimage}
2ffe923
ff16d76
#check Shenandoah is enabled
2ffe923
%if %{use_shenandoah_hotspot}
2ffe923
$JAVA_HOME//bin/java -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -version
2ffe923
%endif
2ffe923
2ffe923
# Check unlimited policy has been used
2ffe923
$JAVA_HOME/bin/javac -d . %{SOURCE13}
2ffe923
$JAVA_HOME/bin/java --add-opens java.base/javax.crypto=ALL-UNNAMED TestCryptoLevel
2ffe923
2ffe923
# Check ECC is working
2ffe923
$JAVA_HOME/bin/javac -d . %{SOURCE14}
2ffe923
$JAVA_HOME/bin/java $(echo $(basename %{SOURCE14})|sed "s|\.java||")
2ffe923
ff16d76
# Check system crypto (policy) can be disabled
ff16d76
$JAVA_HOME/bin/javac -d . %{SOURCE15}
ff16d76
$JAVA_HOME/bin/java -Djava.security.disableSystemPropertiesFile=true $(echo $(basename %{SOURCE15})|sed "s|\.java||") ||  echo "crypto policy are now not honored i jdk15"
ff16d76
2949517
# Check java launcher has no SSB mitigation
2949517
if ! nm $JAVA_HOME/bin/java | grep set_speculation ; then true ; else false; fi
2949517
2949517
# Check alt-java launcher has SSB mitigation on supported architectures
2949517
%ifarch %{ssbd_arches}
2949517
nm $JAVA_HOME/bin/%{alt_java_name} | grep set_speculation
2949517
%else
2949517
if ! nm $JAVA_HOME/bin/%{alt_java_name} | grep set_speculation ; then true ; else false; fi
2949517
%endif
2949517
Severin Gehwolf 7ba3ca3
%if %{include_staticlibs}
4848b86
# Check debug symbols in static libraries (smoke test)
Severin Gehwolf 7ba3ca3
export STATIC_LIBS_HOME=${top_dir_abs_staticlibs_build_path}/images/%{static_libs_image}
4848b86
readelf --debug-dump $STATIC_LIBS_HOME/lib/libfdlibm.a | grep w_remainder.c
4848b86
readelf --debug-dump $STATIC_LIBS_HOME/lib/libfdlibm.a | grep e_remainder.c
Severin Gehwolf 7ba3ca3
%endif
4848b86
2ffe923
# Check debug symbols are present and can identify code
2ffe923
find "$JAVA_HOME" -iname '*.so' -print0 | while read -d $'\0' lib
2ffe923
do
2ffe923
  if [ -f "$lib" ] ; then
2ffe923
    echo "Testing $lib for debug symbols"
2ffe923
    # All these tests rely on RPM failing the build if the exit code of any set
2ffe923
    # of piped commands is non-zero.
2ffe923
404b854
    # If this is the empty library, libsyslookup.so, of the foreign function and memory
404b854
    # API incubation module (JEP 412), skip the debuginfo check as this seems unreliable
404b854
    # on s390x. It's not very useful for other arches either, so skip unconditionally.
404b854
    if [ "`basename $lib`" = "libsyslookup.so" ]; then
404b854
       echo "Skipping debuginfo check for empty library 'libsyslookup.so'"
404b854
       continue
404b854
    fi
404b854
2ffe923
    # Test for .debug_* sections in the shared object. This is the main test
2ffe923
    # Stripped objects will not contain these
2ffe923
    eu-readelf -S "$lib" | grep "] .debug_"
2ffe923
    test $(eu-readelf -S "$lib" | grep -E "\]\ .debug_(info|abbrev)" | wc --lines) == 2
2ffe923
2ffe923
    # Test FILE symbols. These will most likely be removed by anything that
2ffe923
    # manipulates symbol tables because it's generally useless. So a nice test
2ffe923
    # that nothing has messed with symbols
2ffe923
    old_IFS="$IFS"
2ffe923
    IFS=$'\n'
2ffe923
    for line in $(eu-readelf -s "$lib" | grep "00000000      0 FILE    LOCAL  DEFAULT")
2ffe923
    do
2ffe923
     # We expect to see .cpp files, except for architectures like aarch64 and
2ffe923
     # s390 where we expect .o and .oS files
2ffe923
      echo "$line" | grep -E "ABS ((.*/)?[-_a-zA-Z0-9]+\.(c|cc|cpp|cxx|o|oS))?$"
2ffe923
    done
2ffe923
    IFS="$old_IFS"
2ffe923
2ffe923
    # If this is the JVM, look for javaCalls.(cpp|o) in FILEs, for extra sanity checking
2ffe923
    if [ "`basename $lib`" = "libjvm.so" ]; then
2ffe923
      eu-readelf -s "$lib" | \
2ffe923
        grep -E "00000000      0 FILE    LOCAL  DEFAULT      ABS javaCalls.(cpp|o)$"
2ffe923
    fi
2ffe923
2ffe923
    # Test that there are no .gnu_debuglink sections pointing to another
2ffe923
    # debuginfo file. There shouldn't be any debuginfo files, so the link makes
2ffe923
    # no sense either
2ffe923
    eu-readelf -S "$lib" | grep 'gnu'
2ffe923
    if eu-readelf -S "$lib" | grep '] .gnu_debuglink' | grep PROGBITS; then
2ffe923
      echo "bad .gnu_debuglink section."
2ffe923
      eu-readelf -x .gnu_debuglink "$lib"
2ffe923
      false
2ffe923
    fi
2ffe923
  fi
2ffe923
done
2ffe923
2ffe923
# Make sure gdb can do a backtrace based on line numbers on libjvm.so
2ffe923
# javaCalls.cpp:58 should map to:
2ffe923
# http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/file/ff3b27e6bcc2/src/share/vm/runtime/javaCalls.cpp#l58 
2ffe923
# Using line number 1 might cause build problems. See:
2ffe923
# https://bugzilla.redhat.com/show_bug.cgi?id=1539664
2ffe923
# https://bugzilla.redhat.com/show_bug.cgi?id=1538767
2ffe923
gdb -q "$JAVA_HOME/bin/java" <
2ffe923
handle SIGSEGV pass nostop noprint
2ffe923
handle SIGILL pass nostop noprint
2ffe923
set breakpoint pending on
2ffe923
break javaCalls.cpp:1
2ffe923
commands 1
2ffe923
backtrace
2ffe923
quit
2ffe923
end
2ffe923
run -version
2ffe923
EOF
0f4f0ca
ff16d76
# This fails on s390x for some reason. Disable for now. See:
0f4f0ca
# https://koji.fedoraproject.org/koji/taskinfo?taskID=41499227
ff16d76
%ifnarch s390x
2ffe923
grep 'JavaCallWrapper::JavaCallWrapper' gdb.out
0f4f0ca
%endif
2ffe923
2ffe923
# Check src.zip has all sources. See RHBZ#1130490
2ffe923
jar -tf $JAVA_HOME/lib/src.zip | grep 'sun.misc.Unsafe'
2ffe923
2ffe923
# Check class files include useful debugging information
2ffe923
$JAVA_HOME/bin/javap -l java.lang.Object | grep "Compiled from"
2ffe923
$JAVA_HOME/bin/javap -l java.lang.Object | grep LineNumberTable
2ffe923
$JAVA_HOME/bin/javap -l java.lang.Object | grep LocalVariableTable
2ffe923
2ffe923
# Check generated class files include useful debugging information
2ffe923
$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep "Compiled from"
2ffe923
$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep LineNumberTable
2ffe923
$JAVA_HOME/bin/javap -l java.nio.ByteBuffer | grep LocalVariableTable
2ffe923
2ffe923
# build cycles check
2ffe923
done
2ffe923
2ffe923
%install
2ffe923
STRIP_KEEP_SYMTAB=libjvm*
2ffe923
2ffe923
for suffix in %{build_loop} ; do
2ffe923
Severin Gehwolf 7ba3ca3
top_dir_abs_main_build_path=$(pwd)/%{buildoutputdir -- ${suffix}%{main_suffix}}
Severin Gehwolf 7ba3ca3
%if %{include_staticlibs}
Severin Gehwolf 7ba3ca3
top_dir_abs_staticlibs_build_path=$(pwd)/%{buildoutputdir -- ${suffix}%{staticlibs_loop}}
Severin Gehwolf 7ba3ca3
%endif
Severin Gehwolf 7ba3ca3
jdk_image=${top_dir_abs_main_build_path}/images/%{jdkimage}
Severin Gehwolf 7ba3ca3
2ffe923
# Install the jdk
2ffe923
mkdir -p $RPM_BUILD_ROOT%{_jvmdir}
Severin Gehwolf 7ba3ca3
cp -a ${jdk_image} $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}
2ffe923
Severin Gehwolf 7ba3ca3
pushd ${jdk_image}
2ffe923
2ffe923
%if %{with_systemtap}
2ffe923
  # Install systemtap support files
2ffe923
  install -dm 755 $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/tapset
2ffe923
  # note, that uniquesuffix  is in BUILD dir in this case
2ffe923
  cp -a $RPM_BUILD_DIR/%{uniquesuffix ""}/tapset$suffix/*.stp $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/tapset/
2ffe923
  pushd  $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/tapset/
2ffe923
   tapsetFiles=`ls *.stp`
2ffe923
  popd
2ffe923
  install -d -m 755 $RPM_BUILD_ROOT%{tapsetdir}
2ffe923
  for name in $tapsetFiles ; do
2ffe923
    targetName=`echo $name | sed "s/.stp/$suffix.stp/"`
2ffe923
    ln -sf %{_jvmdir}/%{sdkdir -- $suffix}/tapset/$name $RPM_BUILD_ROOT%{tapsetdir}/$targetName
2ffe923
  done
2ffe923
%endif
2ffe923
2ffe923
  # Remove empty cacerts database
2ffe923
  rm -f $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/lib/security/cacerts
2ffe923
  # Install cacerts symlink needed by some apps which hard-code the path
2ffe923
  pushd $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/lib/security
2ffe923
      ln -sf /etc/pki/java/cacerts .
2ffe923
  popd
2ffe923
2ffe923
  # Install version-ed symlinks
2ffe923
  pushd $RPM_BUILD_ROOT%{_jvmdir}
2ffe923
    ln -sf %{sdkdir -- $suffix} %{jrelnk -- $suffix}
2ffe923
  popd
2ffe923
2ffe923
  # Install man pages
2ffe923
  install -d -m 755 $RPM_BUILD_ROOT%{_mandir}/man1
2ffe923
  for manpage in man/man1/*
2ffe923
  do
2ffe923
    # Convert man pages to UTF8 encoding
2ffe923
    iconv -f ISO_8859-1 -t UTF8 $manpage -o $manpage.tmp
2ffe923
    mv -f $manpage.tmp $manpage
2ffe923
    install -m 644 -p $manpage $RPM_BUILD_ROOT%{_mandir}/man1/$(basename \
2ffe923
      $manpage .1)-%{uniquesuffix -- $suffix}.1
2ffe923
  done
2ffe923
  # Remove man pages from jdk image
2ffe923
  rm -rf $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/man
2ffe923
2ffe923
popd
4848b86
# Install static libs artefacts
Severin Gehwolf 7ba3ca3
%if %{include_staticlibs}
4848b86
mkdir -p $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/lib/static/linux-%{archinstall}/glibc
Severin Gehwolf 7ba3ca3
cp -a ${top_dir_abs_staticlibs_build_path}/images/%{static_libs_image}/lib/*.a \
4848b86
  $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/lib/static/linux-%{archinstall}/glibc
Severin Gehwolf 7ba3ca3
%endif
2ffe923
Severin Gehwolf 9e49564
if ! echo $suffix | grep -q "debug" ; then
Severin Gehwolf 9e49564
  # Install Javadoc documentation
Severin Gehwolf 9e49564
  install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}
Severin Gehwolf 7ba3ca3
  cp -a ${top_dir_abs_main_build_path}/images/docs $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir -- $suffix}
Andrew John Hughes ca2c868
  built_doc_archive=jdk-%{filever}%{ea_designator_zip}+%{buildver}%{lts_designator_zip}-docs.zip
Severin Gehwolf 7ba3ca3
  cp -a ${top_dir_abs_main_build_path}/bundles/${built_doc_archive} \
Severin Gehwolf 7ba3ca3
     $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir -- $suffix}.zip || ls -l ${top_dir_abs_main_build_path}/bundles/
Severin Gehwolf 9e49564
fi
2ffe923
Andrew John Hughes ca2c868
# Install release notes
Andrew John Hughes ca2c868
commondocdir=${RPM_BUILD_ROOT}%{_defaultdocdir}/%{uniquejavadocdir -- $suffix}
Andrew John Hughes ca2c868
install -d -m 755 ${commondocdir}
Andrew John Hughes ca2c868
cp -a %{SOURCE10} ${commondocdir}
Andrew John Hughes ca2c868
2ffe923
# Install icons and menu entries
2ffe923
for s in 16 24 32 48 ; do
2ffe923
  install -D -p -m 644 \
2ffe923
    %{top_level_dir_name}/src/java.desktop/unix/classes/sun/awt/X11/java-icon${s}.png \
2ffe923
    $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${s}x${s}/apps/java-%{javaver}-%{origin}.png
2ffe923
done
2ffe923
2ffe923
# Install desktop files
2ffe923
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/{applications,pixmaps}
2ffe923
for e in jconsole$suffix ; do
2ffe923
    desktop-file-install --vendor=%{uniquesuffix -- $suffix} --mode=644 \
2ffe923
        --dir=$RPM_BUILD_ROOT%{_datadir}/applications $e.desktop
2ffe923
done
2ffe923
2ffe923
# Install /etc/.java/.systemPrefs/ directory
2ffe923
# See https://bugzilla.redhat.com/show_bug.cgi?id=741821
2ffe923
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/.java/.systemPrefs
2ffe923
2ffe923
# copy samples next to demos; samples are mostly js files
2ffe923
cp -r %{top_level_dir_name}/src/sample  $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/
2ffe923
2ffe923
2ffe923
# moving config files to /etc
2ffe923
mkdir -p $RPM_BUILD_ROOT/%{etcjavadir -- $suffix}
2ffe923
mkdir -p $RPM_BUILD_ROOT/%{etcjavadir -- $suffix}/lib
2ffe923
mv $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/conf/  $RPM_BUILD_ROOT/%{etcjavadir -- $suffix}
2ffe923
mv $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/lib/security  $RPM_BUILD_ROOT/%{etcjavadir -- $suffix}/lib
2ffe923
pushd $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}
2ffe923
  ln -s %{etcjavadir -- $suffix}/conf  ./conf
2ffe923
popd
2ffe923
pushd $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/lib
2ffe923
  ln -s %{etcjavadir -- $suffix}/lib/security  ./security
2ffe923
popd
2ffe923
# end moving files to /etc
2ffe923
2ffe923
# stabilize permissions
2ffe923
find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/ -name "*.so" -exec chmod 755 {} \; ; 
2ffe923
find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/ -type d -exec chmod 755 {} \; ; 
2ffe923
find $RPM_BUILD_ROOT/%{_jvmdir}/%{sdkdir -- $suffix}/legal -type f -exec chmod 644 {} \; ; 
2ffe923
2ffe923
# end, dual install
2ffe923
done
2ffe923
2ffe923
%if %{include_normal_build}
2ffe923
# intentionally only for non-debug
2ffe923
%pretrans headless -p <lua>
2ffe923
-- see https://bugzilla.redhat.com/show_bug.cgi?id=1038092 for whole issue
2ffe923
-- see https://bugzilla.redhat.com/show_bug.cgi?id=1290388 for pretrans over pre
2ffe923
-- if copy-jdk-configs is in transaction, it installs in pretrans to temp
2ffe923
-- if copy_jdk_configs is in temp, then it means that copy-jdk-configs is in transaction  and so is
2ffe923
-- preferred over one in %%{_libexecdir}. If it is not in transaction, then depends
2ffe923
-- whether copy-jdk-configs is installed or not. If so, then configs are copied
2ffe923
-- (copy_jdk_configs from %%{_libexecdir} used) or not copied at all
2ffe923
local posix = require "posix"
3d30d08
3d30d08
if (os.getenv("debug") == "true") then
3d30d08
  debug = true;
3d30d08
  print("cjc: in spec debug is on")
3d30d08
else 
3d30d08
  debug = false;
3d30d08
end
2ffe923
2ffe923
SOURCE1 = "%{rpm_state_dir}/copy_jdk_configs.lua"
2ffe923
SOURCE2 = "%{_libexecdir}/copy_jdk_configs.lua"
2ffe923
2ffe923
local stat1 = posix.stat(SOURCE1, "type");
2ffe923
local stat2 = posix.stat(SOURCE2, "type");
2ffe923
2ffe923
  if (stat1 ~= nil) then
2ffe923
  if (debug) then
2ffe923
    print(SOURCE1 .." exists - copy-jdk-configs in transaction, using this one.")
2ffe923
  end;
2ffe923
  package.path = package.path .. ";" .. SOURCE1
2ffe923
else
2ffe923
  if (stat2 ~= nil) then
2ffe923
  if (debug) then
2ffe923
    print(SOURCE2 .." exists - copy-jdk-configs already installed and NOT in transaction. Using.")
2ffe923
  end;
2ffe923
  package.path = package.path .. ";" .. SOURCE2
2ffe923
  else
2ffe923
    if (debug) then
2ffe923
      print(SOURCE1 .." does NOT exists")
2ffe923
      print(SOURCE2 .." does NOT exists")
2ffe923
      print("No config files will be copied")
2ffe923
    end
2ffe923
  return
2ffe923
  end
2ffe923
end
a1a350d
arg = nil ;  -- it is better to null the arg up, no meter if they exists or not, and use cjc as module in unified way, instead of relaying on "main" method during require "copy_jdk_configs.lua"
3d30d08
cjc = require "copy_jdk_configs.lua"
a1a350d
args = {"--currentjvm", "%{uniquesuffix %{nil}}", "--jvmdir", "%{_jvmdir %{nil}}", "--origname", "%{name}", "--origjavaver", "%{javaver}", "--arch", "%{_arch}", "--temp", "%{rpm_state_dir}/%{name}.%{_arch}"}
a1a350d
cjc.mainProgram(args)
2ffe923
2ffe923
%post
2ffe923
%{post_script %{nil}}
2ffe923
2ffe923
%post headless
2ffe923
%{post_headless %{nil}}
2ffe923
2ffe923
%postun
2ffe923
%{postun_script %{nil}}
2ffe923
2ffe923
%postun headless
2ffe923
%{postun_headless %{nil}}
2ffe923
2ffe923
%posttrans
2ffe923
%{posttrans_script %{nil}}
2ffe923
2ffe923
%post devel
2ffe923
%{post_devel %{nil}}
2ffe923
2ffe923
%postun devel
2ffe923
%{postun_devel %{nil}}
2ffe923
2ffe923
%posttrans  devel
2ffe923
%{posttrans_devel %{nil}}
2ffe923
2ffe923
%post javadoc
2ffe923
%{post_javadoc %{nil}}
2ffe923
2ffe923
%postun javadoc
2ffe923
%{postun_javadoc %{nil}}
2ffe923
2ffe923
%post javadoc-zip
2ffe923
%{post_javadoc_zip %{nil}}
2ffe923
2ffe923
%postun javadoc-zip
2ffe923
%{postun_javadoc_zip %{nil}}
2ffe923
%endif
2ffe923