/[packages]/backports/8/java-latest-openjdk/current/SPECS/java-latest-openjdk.spec
ViewVC logotype

Diff of /backports/8/java-latest-openjdk/current/SPECS/java-latest-openjdk.spec

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1760751 by neoclust, Wed Mar 3 20:46:04 2021 UTC revision 1760752 by neoclust, Sat Dec 4 23:35:46 2021 UTC
# Line 1  Line 1 
1  # synced up to c5efa6bf325647c5f5011e31462fb72a3d42e797  # synced up to 2891e38fa239f7fe4404264ae0a58670db64f7bb
2  %define _disable_ld_no_undefined 1  %define _disable_ld_no_undefined 1
3    
4  # RPM conditionals so as to be able to dynamically produce  # RPM conditionals so as to be able to dynamically produce
# Line 25  Line 25 
25  %bcond_without slowdebug  %bcond_without slowdebug
26  # Enable release builds by default on relevant arches.  # Enable release builds by default on relevant arches.
27  %bcond_without release  %bcond_without release
28    # Enable static library builds by default.
29    %bcond_without staticlibs
30    
31  # Workaround for stripping of debug symbols from static libraries  # Workaround for stripping of debug symbols from static libraries
32    %if %{with staticlibs}
33  %define __brp_strip_static_archive %{nil}  %define __brp_strip_static_archive %{nil}
34    %global include_staticlibs 1
35    %else
36    %global include_staticlibs 0
37    %endif
38    
39  # The -g flag says to use strip -g instead of full strip on DSOs or EXEs.  # The -g flag says to use strip -g instead of full strip on DSOs or EXEs.
40  # This fixes detailed NMT and other tools which need minimal debug info.  # This fixes detailed NMT and other tools which need minimal debug info.
# Line 45  Line 52 
52  # (initiated in https://bugzilla.redhat.com/show_bug.cgi?id=1482192)  # (initiated in https://bugzilla.redhat.com/show_bug.cgi?id=1482192)
53  %global debug_suffix_unquoted -slowdebug  %global debug_suffix_unquoted -slowdebug
54  %global fastdebug_suffix_unquoted -fastdebug  %global fastdebug_suffix_unquoted -fastdebug
55    %global main_suffix_unquoted -main
56    %global staticlibs_suffix_unquoted -staticlibs
57  # quoted one for shell operations  # quoted one for shell operations
58  %global debug_suffix "%{debug_suffix_unquoted}"  %global debug_suffix "%{debug_suffix_unquoted}"
59  %global fastdebug_suffix "%{fastdebug_suffix_unquoted}"  %global fastdebug_suffix "%{fastdebug_suffix_unquoted}"
60  %global normal_suffix ""  %global normal_suffix ""
61    %global main_suffix "%{main_suffix_unquoted}"
62    %global staticlibs_suffix "%{staticlibs_suffix_unquoted}"
63    
64  %global debug_warning This package is unoptimised with full debugging. Install only as needed and remove ASAP.  %global debug_warning This package is unoptimised with full debugging. Install only as needed and remove ASAP.
65  %global debug_on with full debugging on  %global debug_on with full debugging on
66  %global fastdebug_on with minimal debugging on  %global fastdebug_on with minimal debugging on
67  %global fastdebug_warning This package is optimised with full debugging. Install only as needed and remove ASAP.  %global fastdebug_warning This package is optimised with full debugging. Install only as needed and remove ASAP.
68  %global for_fastdebug for packages with minimal debugging on  %global for_fastdebug_on for packages with minimal debugging on
69  %global for_debug for packages with debugging on  %global for_debug for packages with debugging on
70    
71  %if %{with release}  %if %{with release}
# Line 165  Line 176 
176  # Test slowdebug first as it provides the best diagnostics  # Test slowdebug first as it provides the best diagnostics
177  %global rev_build_loop  %{slowdebug_build} %{fastdebug_build} %{normal_build}  %global rev_build_loop  %{slowdebug_build} %{fastdebug_build} %{normal_build}
178    
179    %if %{include_staticlibs}
180    %global staticlibs_loop %{staticlibs_suffix}
181    %else
182    %global staticlibs_loop %{nil}
183    %endif
184    
185  %ifarch %{bootstrap_arches}  %ifarch %{bootstrap_arches}
186  %global bootstrap_build 1  %global bootstrap_build 1
187  %else  %else
# Line 172  Line 189 
189  %endif  %endif
190    
191  %if %{bootstrap_build}  %if %{bootstrap_build}
192  %global release_targets bootcycle-images static-libs-image docs-zip  %global release_targets bootcycle-images docs-zip
193  %else  %else
194  %global release_targets images docs-zip static-libs-image  %global release_targets images docs-zip
195  %endif  %endif
196  # No docs nor bootcycle for debug builds  # No docs nor bootcycle for debug builds
197  %global debug_targets images static-libs-image  %global debug_targets images
198    
199    %if %{include_staticlibs}
200    # Extra target for producing the static-libraries. Separate from
201    # other targets since this target is configured to use in-tree
202    # AWT dependencies: lcms, libjpeg, libpng, libharfbuzz, giflib
203    # and possibly others
204    %global static_libs_target static-libs-image
205    %endif
206    
207    
208  # Filter out flags from the optflags macro that cause problems with the OpenJDK build  # Filter out flags from the optflags macro that cause problems with the OpenJDK build
# Line 252  Line 277 
277  # New Version-String scheme-style defines  # New Version-String scheme-style defines
278  %global featurever 16  %global featurever 16
279  %global interimver 0  %global interimver 0
280  %global updatever 0  %global updatever 2
281  %global patchver 0  %global patchver 0
282  # If you bump featurever, you must bump also vendor_version_string  # If you bump featurever, you must bump also vendor_version_string
283  # Used via new version scheme. JDK 16 was  # Used via new version scheme. JDK 16 was
# Line 261  Line 286 
286  # buildjdkver is usually same as %%{featurever},  # buildjdkver is usually same as %%{featurever},
287  # but in time of bootstrap of next jdk, it is featurever-1,  # but in time of bootstrap of next jdk, it is featurever-1,
288  # and this it is better to change it here, on single place  # and this it is better to change it here, on single place
289  %global buildjdkver 15  %global buildjdkver 16
290  # We don't add any LTS designator for STS packages (this package).  # We don't add any LTS designator for STS packages (this package).
291  # Neither for Fedora nor EPEL which would have %%{rhel} macro defined.  # Neither for Fedora nor EPEL which would have %%{rhel} macro defined.
292   %global lts_designator ""   %global lts_designator ""
# Line 274  Line 299 
299  %global origin          openjdk  %global origin          openjdk
300  %global origin_nice     OpenJDK  %global origin_nice     OpenJDK
301  %global top_level_dir_name   %{origin}  %global top_level_dir_name   %{origin}
302  %global buildver        36  %global top_level_dir_name_backup %{top_level_dir_name}-backup
303  %global rpmrelease      0  %global buildver        7
304    %global rpmrelease      1
305  # Priority must be 8 digits in total; up to openjdk 1.8, we were using 18..... so when we moved to 11, we had to add another digit  # Priority must be 8 digits in total; up to openjdk 1.8, we were using 18..... so when we moved to 11, we had to add another digit
306  %if %is_system_jdk  %if %is_system_jdk
307  # Using 10 digits may overflow the int used for priority, so we combine the patch and build versions  # Using 10 digits may overflow the int used for priority, so we combine the patch and build versions
# Line 324  Line 350 
350  %global jdkimage                jdk  %global jdkimage                jdk
351  %global static_libs_image       static-libs  %global static_libs_image       static-libs
352  # output dir stub  # output dir stub
353  %define buildoutputdir() %{expand:openjdk/build%{?1}}  %define buildoutputdir() %{expand:build/jdk%{featurever}.build%{?1}}
354  # we can copy the javadoc to not arched dir, or make it not noarch  # we can copy the javadoc to not arched dir, or make it not noarch
355  %define uniquejavadocdir()    %{expand:%{fullversion}.%{_arch}%{?1}}  %define uniquejavadocdir()    %{expand:%{fullversion}.%{_arch}%{?1}}
356  # main id and dir of this jdk  # main id and dir of this jdk
# Line 719  exit 0 Line 745  exit 0
745  %config(noreplace) %{etcjavadir -- %{?1}}/conf/logging.properties  %config(noreplace) %{etcjavadir -- %{?1}}/conf/logging.properties
746  %config(noreplace) %{etcjavadir -- %{?1}}/conf/security/nss.cfg  %config(noreplace) %{etcjavadir -- %{?1}}/conf/security/nss.cfg
747  %config(noreplace) %{etcjavadir -- %{?1}}/conf/management/jmxremote.access  %config(noreplace) %{etcjavadir -- %{?1}}/conf/management/jmxremote.access
748  # these are config templates, thus not config-noreplace  # this is conifg template, thus not config-noreplace
749  %config  %{etcjavadir -- %{?1}}/conf/management/jmxremote.password.template  %config  %{etcjavadir -- %{?1}}/conf/management/jmxremote.password.template
750  %config  %{etcjavadir -- %{?1}}/conf/sdp/sdp.conf.template  %config  %{etcjavadir -- %{?1}}/conf/sdp/sdp.conf.template
751  %config(noreplace) %{etcjavadir -- %{?1}}/conf/management/management.properties  %config(noreplace) %{etcjavadir -- %{?1}}/conf/management/management.properties
# Line 930  Requires: tzdata-java >= 2015d Line 956  Requires: tzdata-java >= 2015d
956  # for support of kernel stream control  # for support of kernel stream control
957  # libsctp.so.1 is being `dlopen`ed on demand  # libsctp.so.1 is being `dlopen`ed on demand
958  Requires: lksctp-tools%{?_isa}  Requires: lksctp-tools%{?_isa}
959    %if ! 0%{?flatpak}
960  # tool to copy jdk's configs - should be Recommends only, but then only dnf/yum enforce it,  # tool to copy jdk's configs - should be Recommends only, but then only dnf/yum enforce it,
961  # not rpm transaction and so no configs are persisted when pure rpm -u is run. It may be  # not rpm transaction and so no configs are persisted when pure rpm -u is run. It may be
962  # considered as regression  # considered as regression
963  Requires: copy-jdk-configs >= 3.3  Requires: copy-jdk-configs >= 4.0
964  #OrderWithRequires: copy-jdk-configs  %endif
965  # for printing support  # for printing support
966  #Requires: cups-libs  # Requires: cups-libs
967    # for FIPS PKCS11 provider
968    Requires: nss
969  # Post requires alternatives to install tool alternatives  # Post requires alternatives to install tool alternatives
970  Requires(post):   %{alternatives_requires}  Requires(post):   %{alternatives_requires}
971  # Postun requires alternatives to uninstall tool alternatives  # Postun requires alternatives to uninstall tool alternatives
# Line 960  Provides: java-headless%{?1} = %{epoch}: Line 989  Provides: java-headless%{?1} = %{epoch}:
989  %define java_devel_rpo() %{expand:  %define java_devel_rpo() %{expand:
990  # Requires base package  # Requires base package
991  Requires:         %{name}%{?1}%{?_isa} = %{epoch}:%{version}-%{release}  Requires:         %{name}%{?1}%{?_isa} = %{epoch}:%{version}-%{release}
 #OrderWithRequires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release}  
992  # Post requires alternatives to install tool alternatives  # Post requires alternatives to install tool alternatives
993  Requires(post):   %{alternatives_requires}  Requires(post):   %{alternatives_requires}
994  # Postun requires alternatives to uninstall tool alternatives  # Postun requires alternatives to uninstall tool alternatives
# Line 981  Provides: java-sdk%{?1} = %{epoch}:%{ver Line 1009  Provides: java-sdk%{?1} = %{epoch}:%{ver
1009    
1010  %define java_static_libs_rpo() %{expand:  %define java_static_libs_rpo() %{expand:
1011  Requires:         %{name}-devel%{?1}%{?_isa} = %{epoch}:%{version}-%{release}  Requires:         %{name}-devel%{?1}%{?_isa} = %{epoch}:%{version}-%{release}
 #OrderWithRequires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release}  
1012  }  }
1013    
1014  %define java_jmods_rpo() %{expand:  %define java_jmods_rpo() %{expand:
1015  # Requires devel package  # Requires devel package
1016  # as jmods are bytecode, they should be OK without any _isa  # as jmods are bytecode, they should be OK without any _isa
1017  Requires:         %{name}-devel%{?1} = %{epoch}:%{version}-%{release}  Requires:         %{name}-devel%{?1} = %{epoch}:%{version}-%{release}
 #OrderWithRequires: %{name}-headless%{?1} = %{epoch}:%{version}-%{release}  
1018    
1019  Provides: java-%{javaver}-jmods%{?1} = %{epoch}:%{version}-%{release}  Provides: java-%{javaver}-jmods%{?1} = %{epoch}:%{version}-%{release}
1020  Provides: java-%{javaver}-%{origin}-jmods%{?1} = %{epoch}:%{version}-%{release}  Provides: java-%{javaver}-%{origin}-jmods%{?1} = %{epoch}:%{version}-%{release}
# Line 999  Provides: java-jmods%{?1} = %{epoch}:%{v Line 1025  Provides: java-jmods%{?1} = %{epoch}:%{v
1025    
1026  %define java_demo_rpo() %{expand:  %define java_demo_rpo() %{expand:
1027  Requires: %{name}%{?1}%{?_isa} = %{epoch}:%{version}-%{release}  Requires: %{name}%{?1}%{?_isa} = %{epoch}:%{version}-%{release}
 #OrderWithRequires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release}  
1028    
1029  Provides: java-%{javaver}-demo%{?1} = %{epoch}:%{version}-%{release}  Provides: java-%{javaver}-demo%{?1} = %{epoch}:%{version}-%{release}
1030  Provides: java-%{javaver}-%{origin}-demo%{?1} = %{epoch}:%{version}-%{release}  Provides: java-%{javaver}-%{origin}-demo%{?1} = %{epoch}:%{version}-%{release}
# Line 1010  Provides: java-%{origin}-demo%{?1} = %{e Line 1035  Provides: java-%{origin}-demo%{?1} = %{e
1035  }  }
1036    
1037  %define java_javadoc_rpo() %{expand:  %define java_javadoc_rpo() %{expand:
 #OrderWithRequires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release}  
1038  # Post requires alternatives to install javadoc alternative  # Post requires alternatives to install javadoc alternative
1039  Requires(post):   %{alternatives_requires}  Requires(post):   %{alternatives_requires}
1040  # Postun requires alternatives to uninstall javadoc alternative  # Postun requires alternatives to uninstall javadoc alternative
# Line 1045  Version: %{newjavaver}.%{buildver} Line 1069  Version: %{newjavaver}.%{buildver}
1069  # java-X-openjdk. I.e. when latest rolling release is also an LTS release packaged as  # java-X-openjdk. I.e. when latest rolling release is also an LTS release packaged as
1070  # java-X-openjdk. See: https://bugzilla.redhat.com/show_bug.cgi?id=1647298  # java-X-openjdk. See: https://bugzilla.redhat.com/show_bug.cgi?id=1647298
1071  Release: %mkrel %{?eaprefix}%{rpmrelease}%{?extraver}.rolling.1  Release: %mkrel %{?eaprefix}%{rpmrelease}%{?extraver}.rolling.1
 Group:   Development/Java  
1072  # java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons  # java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons
1073  # and this change was brought into RHEL-4. java-1.5.0-ibm packages  # and this change was brought into RHEL-4. java-1.5.0-ibm packages
1074  # also included the epoch in their virtual provides. This created a  # also included the epoch in their virtual provides. This created a
# Line 1055  Group:   Development/Java Line 1078  Group:   Development/Java
1078  # satisfied by the 1:1.5.0 packages. Thus we need to set the epoch in  # satisfied by the 1:1.5.0 packages. Thus we need to set the epoch in
1079  # JDK package >= 1.6.0 to 1, and packages referring to JDK virtual  # JDK package >= 1.6.0 to 1, and packages referring to JDK virtual
1080  # provides >= 1.6.0 must specify the epoch, "java >= 1:1.6.0".  # provides >= 1.6.0 must specify the epoch, "java >= 1:1.6.0".
1081    Group:   Development/Java
1082  Epoch:   1  Epoch:   1
1083  Summary: %{origin_nice} %{featurever} Runtime Environment  Summary: %{origin_nice} %{featurever} Runtime Environment
1084    
# Line 1079  URL:      http://openjdk.java.net/ Line 1102  URL:      http://openjdk.java.net/
1102    
1103  # to regenerate source0 (jdk) run update_package.sh  # to regenerate source0 (jdk) run update_package.sh
1104  # update_package.sh contains hard-coded repos, revisions, tags, and projects to regenerate the source archives  # update_package.sh contains hard-coded repos, revisions, tags, and projects to regenerate the source archives
1105  #Source0: openjdk-jdk%{featurever}u-jdk-%{filever}+%{buildver}%{?tagsuffix:-%{tagsuffix}}.tar.xz  Source0: openjdk-jdk%{featurever}u-jdk-%{filever}+%{buildver}%{?tagsuffix:-%{tagsuffix}}.tar.xz
1106  Source0: openjdk-jdk%{featurever}-jdk-%{filever}+%{buildver}.tar.xz  #Source0: openjdk-jdk%{featurever}-jdk-%{filever}+%{buildver}.tar.xz
1107    
1108  # Use 'icedtea_sync.sh' to update the following  # Use 'icedtea_sync.sh' to update the following
1109  # They are based on code contained in the IcedTea project (3.x).  # They are based on code contained in the IcedTea project (3.x).
# Line 1105  Source13: TestCryptoLevel.java Line 1128  Source13: TestCryptoLevel.java
1128  # Ensure ECDSA is working  # Ensure ECDSA is working
1129  Source14: TestECDSA.java  Source14: TestECDSA.java
1130    
1131    # nss fips configuration file
1132    Source15: nss.fips.cfg.in
1133    
1134  # Verify system crypto (policy) can be disabled via a property  # Verify system crypto (policy) can be disabled via a property
1135  Source15: TestSecurityProperties.java  Source17: TestSecurityProperties.java
1136    
1137  ############################################  ############################################
1138  #  #
# Line 1114  Source15: TestSecurityProperties.java Line 1140  Source15: TestSecurityProperties.java
1140  #  #
1141  ############################################  ############################################
1142    
 # NSS via SunPKCS11 Provider (disabled comment  
 # due to memory leak).  
 Patch1000: rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch  
 # enable build of speculative store bypass hardened alt-java  
 Patch600: rh1750419-redhat_alt_java.patch  
   
1143  # Ignore AWTError when assistive technologies are loaded  # Ignore AWTError when assistive technologies are loaded
1144  Patch1:    rh1648242-accessible_toolkit_crash_do_not_break_jvm.patch  Patch1:    rh1648242-accessible_toolkit_crash_do_not_break_jvm.patch
1145  # Restrict access to java-atk-wrapper classes  # Restrict access to java-atk-wrapper classes
1146  Patch2:    rh1648644-java_access_bridge_privileged_security.patch  Patch2:    rh1648644-java_access_bridge_privileged_security.patch
1147    # NSS via SunPKCS11 Provider (disabled due to memory leak).
1148    Patch1000: rh1648249-add_commented_out_nss_cfg_provider_to_java_security.patch
1149    # enable build of speculative store bypass hardened alt-java
1150    Patch600: rh1750419-redhat_alt_java.patch
1151  Patch3:    rh649512-remove_uses_of_far_in_jpeg_libjpeg_turbo_1_4_compat_for_jdk10_and_up.patch  Patch3:    rh649512-remove_uses_of_far_in_jpeg_libjpeg_turbo_1_4_compat_for_jdk10_and_up.patch
1152  # Follow system wide crypto policy RHBZ#1249083  # Follow system wide crypto policy RHBZ#1249083
1153  Patch4:    pr3183-rh1340845-support_fedora_rhel_system_crypto_policy.patch  Patch4:    pr3183-rh1340845-support_fedora_rhel_system_crypto_policy.patch
1154  # Depend on pcs-lite-libs instead of pcs-lite-devel as this is only in optional repo  # Depend on pcs-lite-libs instead of pcs-lite-devel as this is only in optional repo
1155  Patch6: rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-devel.patch  Patch6: rh1684077-openjdk_should_depend_on_pcsc-lite-libs_instead_of_pcsc-lite-devel.patch
1156  # JDK-8259949: Use i686 instead of i586 on x86 when -fcf-protection is passed to the compiler, as CMOV is needed  Patch7: pr3695-toggle_system_crypto_policy.patch
1157  Patch8: jdk8259949-allow_cf-protection_on_x86.patch  
1158    # FIPS support patches
1159    # RH1655466: Support RHEL FIPS mode using SunPKCS11 provider
1160    Patch1001: rh1655466-global_crypto_and_fips.patch
1161    # RH1818909: No ciphersuites availale for SSLSocket in FIPS mode
1162    Patch1002: rh1818909-fips_default_keystore_type.patch
1163    # RH1860986: Disable TLSv1.3 with the NSS-FIPS provider until PKCS#11 v3.0 support is available
1164    Patch1004: rh1860986-disable_tlsv1.3_in_fips_mode.patch
1165    # RH1915071: Always initialise JavaSecuritySystemConfiguratorAccess
1166    Patch1007: rh1915071-always_initialise_configurator_access.patch
1167    
1168  #############################################  #############################################
1169  #  #
# Line 1278  The %{origin_nice} %{featurever} develop Line 1311  The %{origin_nice} %{featurever} develop
1311  %{fastdebug_warning}  %{fastdebug_warning}
1312  %endif  %endif
1313    
1314    %if %{include_staticlibs}
1315    
1316  %if %{include_normal_build}  %if %{include_normal_build}
1317  %package static-libs  %package static-libs
1318  Summary: %{origin_nice} %{featurever} libraries for static linking  Summary: %{origin_nice} %{featurever} libraries for static linking
# Line 1310  The %{origin_nice} %{featurever} librari Line 1345  The %{origin_nice} %{featurever} librari
1345  %{fastdebug_warning}  %{fastdebug_warning}
1346  %endif  %endif
1347    
1348    # staticlibs
1349    %endif
1350    
1351  %if %{include_normal_build}  %if %{include_normal_build}
1352  %package jmods  %package jmods
1353  Summary: JMods for %{origin_nice} %{featurever}  Summary: JMods for %{origin_nice} %{featurever}
# Line 1472  if [ $prioritylength -ne 8 ] ; then Line 1510  if [ $prioritylength -ne 8 ] ; then
1510  fi  fi
1511    
1512  # OpenJDK patches  # OpenJDK patches
1513    # Remove libraries that are linked by both static and dynamic builds
1514    sh %{SOURCE12} %{top_level_dir_name}
1515    
1516  # Remove libraries that are linked  # Patch the JDK
 sh %{SOURCE12}  
1517  pushd %{top_level_dir_name}  pushd %{top_level_dir_name}
1518  %patch1 -p1  %patch1 -p1
1519  %patch2 -p1  %patch2 -p1
1520  %patch3 -p1  %patch3 -p1
1521  %patch4 -p1  %patch4 -p1
1522  %patch6 -p1  %patch6 -p1
1523  %patch8 -p1  %patch7 -p1
1524  popd # openjdk  popd # openjdk
1525    
1526  %patch1000  %patch1000
1527  %patch600  %patch600
1528    %patch1001
1529    %patch1002
1530    %patch1004
1531    %patch1007
1532    
1533  # Extract systemtap tapsets  # Extract systemtap tapsets
1534  %if %{with_systemtap}  %if %{with_systemtap}
# Line 1534  done Line 1577  done
1577  # Setup nss.cfg  # Setup nss.cfg
1578  sed -e "s:@NSS_LIBDIR@:%{NSS_LIBDIR}:g" %{SOURCE11} > nss.cfg  sed -e "s:@NSS_LIBDIR@:%{NSS_LIBDIR}:g" %{SOURCE11} > nss.cfg
1579    
1580    # Setup nss.fips.cfg
1581    sed -e "s:@NSS_LIBDIR@:%{NSS_LIBDIR}:g" %{SOURCE15} > nss.fips.cfg
1582    sed -i -e "s:@NSS_SECMOD@:/etc/pki/nssdb:g" nss.fips.cfg
1583    
1584  %build  %build
1585  # How many CPU's do we have?  # How many CPU's do we have?
# Line 1571  else Line 1617  else
1617    debugbuild=`echo $suffix  | sed "s/-//g"`    debugbuild=`echo $suffix  | sed "s/-//g"`
1618  fi  fi
1619    
1620  # Variable used in hs_err hook on build failures  for loop in %{main_suffix} %{staticlibs_loop} ; do
 top_dir_abs_path=$(pwd)/%{top_level_dir_name}  
1621    
1622    if test "x${loop}" = "x%{main_suffix}" ; then
1623        # Copy the source tree so we can remove all in-tree libraries
1624        cp -a %{top_level_dir_name} %{top_level_dir_name_backup}
1625        # Remove all libraries that are linked
1626        sh %{SOURCE12} %{top_level_dir_name} full
1627        # Variable used by configure and hs_err hook on build failures
1628        link_opt="system"
1629        # Debug builds don't need same targets as release for
1630        # build speed-up
1631        maketargets="%{release_targets}"
1632        if echo $debugbuild | grep -q "debug" ; then
1633            maketargets="%{debug_targets}"
1634        fi
1635    else
1636        # Variable used by configure and hs_err hook on build failures
1637        link_opt="bundled"
1638        # Static library cycle only builds the static libraries
1639        maketargets="%{static_libs_target}"
1640    fi
1641    
1642    top_dir_abs_src_path=$(pwd)/%{top_level_dir_name}
1643    top_dir_abs_build_path=$(pwd)/%{buildoutputdir -- ${suffix}${loop}}
1644  # The OpenJDK version file includes the current  # The OpenJDK version file includes the current
1645  # upstream version information. For some reason,  # upstream version information. For some reason,
1646  # configure does not automatically use the  # configure does not automatically use the
1647  # default pre-version supplied there (despite  # default pre-version supplied there (despite
1648  # what the file claims), so we pass it manually  # what the file claims), so we pass it manually
1649  # to configure  # to configure
1650  VERSION_FILE=${top_dir_abs_path}/make/autoconf/version-numbers  VERSION_FILE=${top_dir_abs_src_path}/make/autoconf/version-numbers
1651  if [ -f ${VERSION_FILE} ] ; then  if [ -f ${VERSION_FILE} ] ; then
1652      EA_DESIGNATOR=$(grep '^DEFAULT_PROMOTED_VERSION_PRE' ${VERSION_FILE} | cut -d '=' -f 2)      EA_DESIGNATOR=$(grep '^DEFAULT_PROMOTED_VERSION_PRE' ${VERSION_FILE} | cut -d '=' -f 2)
1653  else  else
# Line 1592  if [ "x${EA_DESIGNATOR}" != "x%{expected Line 1659  if [ "x${EA_DESIGNATOR}" != "x%{expected
1659      exit 17      exit 17
1660  fi  fi
1661    
1662  mkdir -p %{buildoutputdir -- $suffix}  mkdir -p ${top_dir_abs_build_path}
1663  pushd %{buildoutputdir -- $suffix}  pushd ${top_dir_abs_build_path}
1664    
1665  bash ../configure \  bash ${top_dir_abs_src_path}/configure \
1666  %ifnarch %{jit_arches}  %ifnarch %{jit_arches}
1667      --with-jvm-variants=zero \      --with-jvm-variants=zero \
1668  %endif  %endif
# Line 1615  bash ../configure \ Line 1682  bash ../configure \
1682      --with-native-debug-symbols=internal \      --with-native-debug-symbols=internal \
1683      --enable-unlimited-crypto \      --enable-unlimited-crypto \
1684      --with-zlib=system \      --with-zlib=system \
1685      --with-libjpeg=system \      --with-libjpeg=${link_opt} \
1686      --with-giflib=system \      --with-giflib=${link_opt} \
1687      --with-libpng=system \      --with-libpng=${link_opt} \
1688      --with-lcms=system \      --with-lcms=${link_opt} \
1689      --with-harfbuzz=system \      --with-harfbuzz=${link_opt} \
1690      --with-stdc++lib=dynamic \      --with-stdc++lib=dynamic \
1691      --with-extra-cxxflags="$EXTRA_CPP_FLAGS" \      --with-extra-cxxflags="$EXTRA_CPP_FLAGS" \
1692      --with-extra-cflags="$EXTRA_CFLAGS" \      --with-extra-cflags="$EXTRA_CFLAGS" \
# Line 1632  bash ../configure \ Line 1699  bash ../configure \
1699  %endif  %endif
1700      --disable-warnings-as-errors      --disable-warnings-as-errors
1701    
 # Debug builds don't need same targets as release for  
 # build speed-up  
 maketargets="%{release_targets}"  
 if echo $debugbuild | grep -q "debug" ; then  
   maketargets="%{debug_targets}"  
 fi  
1702  make \  make \
1703      JAVAC_FLAGS=-g \      JAVAC_FLAGS=-g \
1704      LOG=trace \      LOG=trace \
1705      WARNINGS_ARE_ERRORS="-Wno-error" \      WARNINGS_ARE_ERRORS="-Wno-error" \
1706      CFLAGS_WARNINGS_ARE_ERRORS="-Wno-error" \      CFLAGS_WARNINGS_ARE_ERRORS="-Wno-error" \
1707      $maketargets || ( pwd; find $top_dir_abs_path -name "hs_err_pid*.log" | xargs cat && false )      $maketargets || ( pwd; find ${top_dir_abs_src_path} ${top_dir_abs_build_path} -name "hs_err_pid*.log" | xargs cat && false )
1708    
1709    popd >& /dev/null
1710    
1711    # Restore original source tree if we modified it by removing full in-tree sources
1712    if [ -d %{top_level_dir_name_backup} ] ; then
1713        rm -rf %{top_level_dir_name}
1714        mv %{top_level_dir_name_backup} %{top_level_dir_name}
1715    fi
1716    
1717    done # end of main / staticlibs loop
1718    
1719    top_dir_abs_main_build_path=$(pwd)/%{buildoutputdir -- ${suffix}%{main_suffix}}
1720    
1721  # the build (erroneously) removes read permissions from some jars  # the build (erroneously) removes read permissions from some jars
1722  # this is a regression in OpenJDK 7 (our compiler):  # this is a regression in OpenJDK 7 (our compiler):
1723  # http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1437  # http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1437
1724  find images/%{jdkimage} -iname '*.jar' -exec chmod ugo+r {} \;  find ${top_dir_abs_main_build_path}/images/%{jdkimage} -iname '*.jar' -exec chmod ugo+r {} \;
1725    
1726  # Build screws up permissions on binaries  # Build screws up permissions on binaries
1727  # https://bugs.openjdk.java.net/browse/JDK-8173610  # https://bugs.openjdk.java.net/browse/JDK-8173610
1728  find images/%{jdkimage} -iname '*.so' -exec chmod +x {} \;  find ${top_dir_abs_main_build_path}/images/%{jdkimage} -iname '*.so' -exec chmod +x {} \;
1729  find images/%{jdkimage}/bin/ -exec chmod +x {} \;  find ${top_dir_abs_main_build_path}/images/%{jdkimage}/bin/ -exec chmod +x {} \;
   
 popd >& /dev/null  
1730    
1731  # Install nss.cfg right away as we will be using the JRE above  # Install nss.cfg right away as we will be using the JRE above
1732  export JAVA_HOME=$(pwd)/%{buildoutputdir -- $suffix}/images/%{jdkimage}  export JAVA_HOME=${top_dir_abs_main_build_path}/images/%{jdkimage}
1733    
1734  # Install nss.cfg right away as we will be using the JRE above  # Install nss.cfg right away as we will be using the JRE above
1735  install -m 644 nss.cfg $JAVA_HOME/conf/security/  install -m 644 nss.cfg $JAVA_HOME/conf/security/
1736    
1737    # Install nss.fips.cfg: NSS configuration for global FIPS mode (crypto-policies)
1738    ##install -m 644 nss.fips.cfg $JAVA_HOME/conf/security/
1739    
1740  # Use system-wide tzdata  # Use system-wide tzdata
1741  rm $JAVA_HOME/lib/tzdb.dat  rm $JAVA_HOME/lib/tzdb.dat
1742  ln -s %{_datadir}/javazi-1.8/tzdb.dat $JAVA_HOME/lib/tzdb.dat  ln -s %{_datadir}/javazi-1.8/tzdb.dat $JAVA_HOME/lib/tzdb.dat
# Line 1675  cat man/man1/java.1 >> man/man1/%{alt_ja Line 1749  cat man/man1/java.1 >> man/man1/%{alt_ja
1749  popd  popd
1750    
1751  # build cycles  # build cycles
1752  done  done # end of release / debug cycle loop
1753    
1754  %check  %check
1755    
1756  # We test debug first as it will give better diagnostics on a crash  # We test debug first as it will give better diagnostics on a crash
1757  for suffix in %{rev_build_loop} ; do  for suffix in %{rev_build_loop} ; do
1758    
1759  export JAVA_HOME=$(pwd)/%{buildoutputdir -- $suffix}/images/%{jdkimage}  top_dir_abs_main_build_path=$(pwd)/%{buildoutputdir -- ${suffix}%{main_suffix}}
1760    %if %{include_staticlibs}
1761    top_dir_abs_staticlibs_build_path=$(pwd)/%{buildoutputdir -- ${suffix}%{staticlibs_loop}}
1762    %endif
1763    
1764    export JAVA_HOME=${top_dir_abs_main_build_path}/images/%{jdkimage}
1765    
1766  #check Shenandoah is enabled  #check Shenandoah is enabled
1767  %if %{use_shenandoah_hotspot}  %if %{use_shenandoah_hotspot}
# Line 1698  $JAVA_HOME/bin/javac -d . %{SOURCE14} Line 1777  $JAVA_HOME/bin/javac -d . %{SOURCE14}
1777  $JAVA_HOME/bin/java $(echo $(basename %{SOURCE14})|sed "s|\.java||")  $JAVA_HOME/bin/java $(echo $(basename %{SOURCE14})|sed "s|\.java||")
1778    
1779  # Check system crypto (policy) can be disabled  # Check system crypto (policy) can be disabled
1780  $JAVA_HOME/bin/javac -d . %{SOURCE15}  $JAVA_HOME/bin/javac -d . %{SOURCE17}
1781  $JAVA_HOME/bin/java -Djava.security.disableSystemPropertiesFile=true $(echo $(basename %{SOURCE15})|sed "s|\.java||") ||  echo "crypto policy are now not honored i jdk15"  $JAVA_HOME/bin/java -Djava.security.disableSystemPropertiesFile=true $(echo $(basename %{SOURCE17})|sed "s|\.java||") ||  echo "crypto policy are now not honored i jdk15"
1782    
1783  # Check java launcher has no SSB mitigation  # Check java launcher has no SSB mitigation
1784  if ! nm $JAVA_HOME/bin/java | grep set_speculation ; then true ; else false; fi  if ! nm $JAVA_HOME/bin/java | grep set_speculation ; then true ; else false; fi
# Line 1711  nm $JAVA_HOME/bin/%{alt_java_name} | gre Line 1790  nm $JAVA_HOME/bin/%{alt_java_name} | gre
1790  if ! nm $JAVA_HOME/bin/%{alt_java_name} | grep set_speculation ; then true ; else false; fi  if ! nm $JAVA_HOME/bin/%{alt_java_name} | grep set_speculation ; then true ; else false; fi
1791  %endif  %endif
1792    
1793    %if %{include_staticlibs}
1794  # Check debug symbols in static libraries (smoke test)  # Check debug symbols in static libraries (smoke test)
1795  export STATIC_LIBS_HOME=$(pwd)/%{buildoutputdir -- $suffix}/images/%{static_libs_image}  export STATIC_LIBS_HOME=${top_dir_abs_staticlibs_build_path}/images/%{static_libs_image}
1796  readelf --debug-dump $STATIC_LIBS_HOME/lib/libfdlibm.a | grep w_remainder.c  readelf --debug-dump $STATIC_LIBS_HOME/lib/libfdlibm.a | grep w_remainder.c
1797  readelf --debug-dump $STATIC_LIBS_HOME/lib/libfdlibm.a | grep e_remainder.c  readelf --debug-dump $STATIC_LIBS_HOME/lib/libfdlibm.a | grep e_remainder.c
1798    %endif
1799    
1800  # Check debug symbols are present and can identify code  # Check debug symbols are present and can identify code
1801  find "$JAVA_HOME" -iname '*.so' -print0 | while read -d $'\0' lib  find "$JAVA_HOME" -iname '*.so' -print0 | while read -d $'\0' lib
# Line 1805  STRIP_KEEP_SYMTAB=libjvm* Line 1886  STRIP_KEEP_SYMTAB=libjvm*
1886    
1887  for suffix in %{build_loop} ; do  for suffix in %{build_loop} ; do
1888    
1889    top_dir_abs_main_build_path=$(pwd)/%{buildoutputdir -- ${suffix}%{main_suffix}}
1890    %if %{include_staticlibs}
1891    top_dir_abs_staticlibs_build_path=$(pwd)/%{buildoutputdir -- ${suffix}%{staticlibs_loop}}
1892    %endif
1893    jdk_image=${top_dir_abs_main_build_path}/images/%{jdkimage}
1894    
1895  # Install the jdk  # Install the jdk
1896  mkdir -p $RPM_BUILD_ROOT%{_jvmdir}  mkdir -p $RPM_BUILD_ROOT%{_jvmdir}
1897  cp -a %{buildoutputdir -- $suffix}/images/%{jdkimage} \  cp -a ${jdk_image} $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}
   $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}  
1898    
1899  pushd %{buildoutputdir $suffix}/images/%{jdkimage}  pushd ${jdk_image}
1900    
1901  %if %{with_systemtap}  %if %{with_systemtap}
1902    # Install systemtap support files    # Install systemtap support files
# Line 1854  pushd %{buildoutputdir $suffix}/images/% Line 1940  pushd %{buildoutputdir $suffix}/images/%
1940    
1941  popd  popd
1942  # Install static libs artefacts  # Install static libs artefacts
1943    %if %{include_staticlibs}
1944  mkdir -p $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/lib/static/linux-%{archinstall}/glibc  mkdir -p $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/lib/static/linux-%{archinstall}/glibc
1945  cp -a %{buildoutputdir -- $suffix}/images/%{static_libs_image}/lib/*.a \  cp -a ${top_dir_abs_staticlibs_build_path}/images/%{static_libs_image}/lib/*.a \
1946    $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/lib/static/linux-%{archinstall}/glibc    $RPM_BUILD_ROOT%{_jvmdir}/%{sdkdir -- $suffix}/lib/static/linux-%{archinstall}/glibc
1947    %endif
1948    
1949  if ! echo $suffix | grep -q "debug" ; then  if ! echo $suffix | grep -q "debug" ; then
1950    # Install Javadoc documentation    # Install Javadoc documentation
1951    install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}    install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}
1952    cp -a %{buildoutputdir -- $suffix}/images/docs $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir -- $suffix}    cp -a ${top_dir_abs_main_build_path}/images/docs $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir -- $suffix}
1953    built_doc_archive=jdk-%{filever}%{ea_designator_zip}+%{buildver}%{lts_designator_zip}-docs.zip    built_doc_archive=jdk-%{filever}%{ea_designator_zip}+%{buildver}%{lts_designator_zip}-docs.zip
1954    cp -a %{buildoutputdir -- $suffix}/bundles/${built_doc_archive} \    cp -a ${top_dir_abs_main_build_path}/bundles/${built_doc_archive} \
1955       $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir -- $suffix}.zip || ls -l %{buildoutputdir -- $suffix}/bundles/       $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir -- $suffix}.zip || ls -l ${top_dir_abs_main_build_path}/bundles/
1956  fi  fi
1957    
1958  # Install release notes  # Install release notes
# Line 1926  done Line 2014  done
2014  -- whether copy-jdk-configs is installed or not. If so, then configs are copied  -- whether copy-jdk-configs is installed or not. If so, then configs are copied
2015  -- (copy_jdk_configs from %%{_libexecdir} used) or not copied at all  -- (copy_jdk_configs from %%{_libexecdir} used) or not copied at all
2016  local posix = require "posix"  local posix = require "posix"
2017  local debug = false  
2018    if (os.getenv("debug") == "true") then
2019      debug = true;
2020      print("cjc: in spec debug is on")
2021    else
2022      debug = false;
2023    end
2024    
2025  SOURCE1 = "%{rpm_state_dir}/copy_jdk_configs.lua"  SOURCE1 = "%{rpm_state_dir}/copy_jdk_configs.lua"
2026  SOURCE2 = "%{_libexecdir}/copy_jdk_configs.lua"  SOURCE2 = "%{_libexecdir}/copy_jdk_configs.lua"
# Line 1954  else Line 2048  else
2048    return    return
2049    end    end
2050  end  end
2051  -- run content of included file with fake args  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"
2052  arg = {"--currentjvm", "%{uniquesuffix %{nil}}", "--jvmdir", "%{_jvmdir %{nil}}", "--origname", "%{name}", "--origjavaver", "%{javaver}", "--arch", "%{_arch}", "--temp", "%{rpm_state_dir}/%{name}.%{_arch}"}  cjc = require "copy_jdk_configs.lua"
2053  require "copy_jdk_configs.lua"  args = {"--currentjvm", "%{uniquesuffix %{nil}}", "--jvmdir", "%{_jvmdir %{nil}}", "--origname", "%{name}", "--origjavaver", "%{javaver}", "--arch", "%{_arch}", "--temp", "%{rpm_state_dir}/%{name}.%{_arch}"}
2054    cjc.mainProgram(args)
2055    
2056  %post  %post
2057  %{post_script %{nil}}  %{post_script %{nil}}
# Line 2067  require "copy_jdk_configs.lua" Line 2162  require "copy_jdk_configs.lua"
2162  %files devel  %files devel
2163  %{files_devel %{nil}}  %{files_devel %{nil}}
2164    
2165    %if %{include_staticlibs}
2166  %files static-libs  %files static-libs
2167  %{files_static_libs %{nil}}  %{files_static_libs %{nil}}
2168    %endif
2169    
2170  %files jmods  %files jmods
2171  %{files_jmods %{nil}}  %{files_jmods %{nil}}
# Line 2099  require "copy_jdk_configs.lua" Line 2196  require "copy_jdk_configs.lua"
2196  %files devel-slowdebug  %files devel-slowdebug
2197  %{files_devel -- %{debug_suffix_unquoted}}  %{files_devel -- %{debug_suffix_unquoted}}
2198    
2199    %if %{include_staticlibs}
2200  %files static-libs-slowdebug  %files static-libs-slowdebug
2201  %{files_static_libs -- %{debug_suffix_unquoted}}  %{files_static_libs -- %{debug_suffix_unquoted}}
2202    %endif
2203    
2204  %files jmods-slowdebug  %files jmods-slowdebug
2205  %{files_jmods -- %{debug_suffix_unquoted}}  %{files_jmods -- %{debug_suffix_unquoted}}
# Line 2122  require "copy_jdk_configs.lua" Line 2221  require "copy_jdk_configs.lua"
2221  %files devel-fastdebug  %files devel-fastdebug
2222  %{files_devel -- %{fastdebug_suffix_unquoted}}  %{files_devel -- %{fastdebug_suffix_unquoted}}
2223    
2224    %if %{include_staticlibs}
2225  %files static-libs-fastdebug  %files static-libs-fastdebug
2226  %{files_static_libs -- %{fastdebug_suffix_unquoted}}  %{files_static_libs -- %{fastdebug_suffix_unquoted}}
2227    %endif
2228    
2229  %files jmods-fastdebug  %files jmods-fastdebug
2230  %{files_jmods -- %{fastdebug_suffix_unquoted}}  %{files_jmods -- %{fastdebug_suffix_unquoted}}

Legend:
Removed from v.1760751  
changed lines
  Added in v.1760752

  ViewVC Help
Powered by ViewVC 1.1.30