Merged update from upstream sources
This is an automated DistroBaker update from upstream sources. If you do not know what this is about or would like to opt out, contact the OSCI team. Source: https://src.fedoraproject.org/rpms/java-11-openjdk.git#3fa84eff002dc9568888a16c24d7436bc8135b80
This commit is contained in:
parent
d69a8df074
commit
dd091e228c
57
CheckVendor.java
Normal file
57
CheckVendor.java
Normal file
@ -0,0 +1,57 @@
|
||||
/* CheckVendor -- Check the vendor properties match specified values.
|
||||
Copyright (C) 2020 Red Hat, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public class CheckVendor {
|
||||
|
||||
public static void main(String[] args) {
|
||||
if (args.length < 3) {
|
||||
System.err.println("CheckVendor <VENDOR> <VENDOR-URL> <VENDOR-BUG-URL>");
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
String vendor = System.getProperty("java.vendor");
|
||||
String expectedVendor = args[0];
|
||||
String vendorURL = System.getProperty("java.vendor.url");
|
||||
String expectedVendorURL = args[1];
|
||||
String vendorBugURL = System.getProperty("java.vendor.url.bug");
|
||||
String expectedVendorBugURL = args[2];
|
||||
|
||||
if (!expectedVendor.equals(vendor)) {
|
||||
System.err.printf("Invalid vendor %s, expected %s\n",
|
||||
vendor, expectedVendor);
|
||||
System.exit(2);
|
||||
}
|
||||
|
||||
if (!expectedVendorURL.equals(vendorURL)) {
|
||||
System.err.printf("Invalid vendor URL %s, expected %s\n",
|
||||
vendorURL, expectedVendorURL);
|
||||
System.exit(3);
|
||||
}
|
||||
|
||||
if (!expectedVendorBugURL.equals(vendorBugURL)) {
|
||||
System.err.printf("Invalid vendor bug URL%s, expected %s\n",
|
||||
vendorBugURL, expectedVendorBugURL);
|
||||
System.exit(4);
|
||||
}
|
||||
|
||||
System.err.printf("Vendor information verified as %s, %s, %s\n",
|
||||
vendor, vendorURL, vendorBugURL);
|
||||
}
|
||||
}
|
@ -5,10 +5,10 @@
|
||||
# Examples:
|
||||
#
|
||||
# Produce release, fastdebug *and* slowdebug builds on x86_64 (default):
|
||||
# $ rpmbuild -ba java-1.8.0-openjdk.spec
|
||||
# $ rpmbuild -ba java-11-openjdk.spec
|
||||
#
|
||||
# Produce only release builds (no slowdebug builds) on x86_64:
|
||||
# $ rpmbuild -ba java-1.8.0-openjdk.spec --without slowdebug --without fastdebug
|
||||
# $ rpmbuild -ba java-11-openjdk.spec --without slowdebug --without fastdebug
|
||||
#
|
||||
# Only produce a release build on x86_64:
|
||||
# $ fedpkg mockbuild --without slowdebug --without fastdebug
|
||||
@ -111,7 +111,7 @@
|
||||
# Set of architectures for which alt-java has SSB mitigation
|
||||
%global ssbd_arches x86_64
|
||||
|
||||
# By default, we build a debug build during main build on JIT architectures
|
||||
# By default, we build a slowdebug build during main build on JIT architectures
|
||||
%if %{with slowdebug}
|
||||
%ifarch %{debug_arches}
|
||||
%global include_debug_build 1
|
||||
@ -290,6 +290,26 @@
|
||||
%global lts_designator_zip ""
|
||||
%endif
|
||||
|
||||
# Define vendor information used by OpenJDK
|
||||
%global oj_vendor Red Hat, Inc.
|
||||
%global oj_vendor_url "https://www.redhat.com/"
|
||||
# Define what url should JVM offer in case of a crash report
|
||||
# order may be important, epel may have rhel declared
|
||||
%if 0%{?epel}
|
||||
%global oj_vendor_bug_url https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora%20EPEL&component=%{name}&version=epel%{epel}
|
||||
%else
|
||||
%if 0%{?fedora}
|
||||
# Does not work for rawhide, keeps the version field empty
|
||||
%global oj_vendor_bug_url https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=%{name}&version=%{fedora}
|
||||
%else
|
||||
%if 0%{?rhel}
|
||||
%global oj_vendor_bug_url https://bugzilla.redhat.com/enter_bug.cgi?product=Red%20Hat%20Enterprise%20Linux%20%{rhel}&component=%{name}
|
||||
%else
|
||||
%global oj_vendor_bug_url https://bugzilla.redhat.com/enter_bug.cgi
|
||||
%endif
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# Define IcedTea version used for SystemTap tapsets and desktop file
|
||||
%global icedteaver 3.15.0
|
||||
|
||||
@ -298,7 +318,7 @@
|
||||
%global origin_nice OpenJDK
|
||||
%global top_level_dir_name %{origin}
|
||||
%global buildver 8
|
||||
%global rpmrelease 3
|
||||
%global rpmrelease 4
|
||||
#%%global tagsuffix ""
|
||||
# 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
|
||||
%if %is_system_jdk
|
||||
@ -340,23 +360,6 @@
|
||||
%global eaprefix 0.
|
||||
%endif
|
||||
|
||||
# Define what url should JVM offer in case of a crash report
|
||||
# order may be important, epel may have rhel declared
|
||||
%if 0%{?epel}
|
||||
%global bugs https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora%20EPEL&component=%{name}&version=epel%{epel}
|
||||
%else
|
||||
%if 0%{?fedora}
|
||||
# Does not work for rawhide, keeps the version field empty
|
||||
%global bugs https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=%{name}&version=%{fedora}
|
||||
%else
|
||||
%if 0%{?rhel}
|
||||
%global bugs https://bugzilla.redhat.com/enter_bug.cgi?product=Red%20Hat%20Enterprise%20Linux%20%{rhel}&component=%{name}
|
||||
%else
|
||||
%global bugs https://bugzilla.redhat.com/enter_bug.cgi
|
||||
%endif
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# parametrized macros are order-sensitive
|
||||
%global compatiblename java-%{featurever}-%{origin}
|
||||
%global fullversion %{compatiblename}-%{version}-%{release}
|
||||
@ -1146,6 +1149,9 @@ Source14: TestECDSA.java
|
||||
# Verify system crypto (policy) can be disabled via a property
|
||||
Source15: TestSecurityProperties.java
|
||||
|
||||
# Ensure vendor settings are correct
|
||||
Source16: CheckVendor.java
|
||||
|
||||
############################################
|
||||
#
|
||||
# RPM/distribution specific patches
|
||||
@ -1483,9 +1489,7 @@ Obsoletes: javadoc-slowdebug < 1:11.0.3.7-4
|
||||
|
||||
%description javadoc
|
||||
The %{origin_nice} %{featurever} API documentation.
|
||||
%endif
|
||||
|
||||
%if %{include_normal_build}
|
||||
%package javadoc-zip
|
||||
Summary: %{origin_nice} %{featurever} API documentation compressed in a single archive
|
||||
Requires: javapackages-filesystem
|
||||
@ -1662,10 +1666,10 @@ bash ../configure \
|
||||
--with-version-pre="%{ea_designator}" \
|
||||
--with-version-opt=%{lts_designator} \
|
||||
--with-vendor-version-string="%{vendor_version_string}" \
|
||||
--with-vendor-name="Red Hat, Inc." \
|
||||
--with-vendor-url="https://www.redhat.com/" \
|
||||
--with-vendor-bug-url="%{bugs}" \
|
||||
--with-vendor-vm-bug-url="%{bugs}" \
|
||||
--with-vendor-name="%{oj_vendor}" \
|
||||
--with-vendor-url="%{oj_vendor_url}" \
|
||||
--with-vendor-bug-url="%{oj_vendor_bug_url}" \
|
||||
--with-vendor-vm-bug-url="%{oj_vendor_bug_url}" \
|
||||
--with-boot-jdk=/usr/lib/jvm/java-%{buildjdkver}-openjdk \
|
||||
--with-debug-level=$debugbuild \
|
||||
--with-native-debug-symbols=internal \
|
||||
@ -1765,6 +1769,10 @@ nm $JAVA_HOME/bin/%{alt_java_name} | grep set_speculation
|
||||
if ! nm $JAVA_HOME/bin/%{alt_java_name} | grep set_speculation ; then true ; else false; fi
|
||||
%endif
|
||||
|
||||
# Check correct vendor values have been set
|
||||
$JAVA_HOME/bin/javac -d . %{SOURCE16}
|
||||
$JAVA_HOME/bin/java $(echo $(basename %{SOURCE16})|sed "s|\.java||") "%{oj_vendor}" %{oj_vendor_url} %{oj_vendor_bug_url}
|
||||
|
||||
# Check debug symbols in static libraries (smoke test)
|
||||
export STATIC_LIBS_HOME=$(pwd)/%{buildoutputdir -- $suffix}/images/%{static_libs_image}
|
||||
readelf --debug-dump $STATIC_LIBS_HOME/lib/libfdlibm.a | grep w_remainder.c
|
||||
@ -2191,6 +2199,13 @@ require "copy_jdk_configs.lua"
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Sun Jan 24 2021 Andrew Hughes <gnu.andrew@redhat.com> - 1:11.0.10.0.8-0.4.ea
|
||||
- Include a test in the RPM to check the build has the correct vendor information.
|
||||
|
||||
* Sun Jan 24 2021 Andrew Hughes <gnu.andrew@redhat.com> - 1:11.0.10.0.8-0.4.ea
|
||||
- Update build documentation to reflect this is java-11-openjdk, not java-1.8.0-openjdk
|
||||
- Remove redundant closure and immediate reopening of include_normal_build block.
|
||||
|
||||
* Sun Jan 24 2021 Andrew Hughes <gnu.andrew@redhat.com> - 1:11.0.10.0.8-0.3.ea
|
||||
- Use RSA as default for keytool, as DSA is disabled in all crypto policies except LEGACY
|
||||
- Adjust RH1842572 patch due to context change from JDK-8213400
|
||||
|
Loading…
Reference in New Issue
Block a user