From 3c90febd1fe87f7919235ed6f598ba2a1ed6c251f438d769e3e8b6b2c7bddb6d Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Wed, 29 Jan 2020 12:30:05 +0000 Subject: [PATCH] Accepting request 768300 from Java:packages OBS-URL: https://build.opensuse.org/request/show/768300 OBS-URL: https://build.opensuse.org/package/show/Java:Factory/java-1_8_0-openj9?expand=0&rev=15 --- alternative-path-to-tzdb_dat.patch | 63 ++++++++++++++++++++++++++++++ freemarker-2.3.29-sources.jar | 3 ++ java-1_8_0-openj9.spec | 31 ++++++++------- 3 files changed, 82 insertions(+), 15 deletions(-) create mode 100644 alternative-path-to-tzdb_dat.patch create mode 100644 freemarker-2.3.29-sources.jar diff --git a/alternative-path-to-tzdb_dat.patch b/alternative-path-to-tzdb_dat.patch new file mode 100644 index 0000000..935fdc9 --- /dev/null +++ b/alternative-path-to-tzdb_dat.patch @@ -0,0 +1,63 @@ +--- a/jdk/src/share/classes/sun/util/calendar/ZoneInfoFile.java 2020-01-22 11:12:33.000000000 +0100 ++++ b/jdk/src/share/classes/sun/util/calendar/ZoneInfoFile.java 2020-01-29 09:40:23.558260593 +0100 +@@ -31,6 +31,7 @@ + import java.io.DataInputStream; + import java.io.File; + import java.io.FileInputStream; ++import java.io.InputStream; + import java.io.IOException; + import java.io.StreamCorruptedException; + import java.security.AccessController; +@@ -47,6 +48,7 @@ + import java.util.Map; + import java.util.Map.Entry; + import java.util.Objects; ++import java.util.Properties; + import java.util.Set; + import java.util.SimpleTimeZone; + import java.util.concurrent.ConcurrentHashMap; +@@ -251,7 +253,15 @@ + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + try { +- String libDir = System.getProperty("java.home") + File.separator + "lib"; ++ final String homeDir = System.getProperty("java.home"); ++ if (homeDir == null) { ++ throw new Error("java.home is not set"); ++ } ++ String libDir = homeDir + File.separator + "lib"; ++ String otherDir = getZoneInfoDir(libDir); ++ if (otherDir != null) ++ libDir = otherDir; ++ + try (DataInputStream dis = new DataInputStream( + new BufferedInputStream(new FileInputStream( + new File(libDir, "tzdb.dat"))))) { +@@ -264,6 +274,27 @@ + } + }); + } ++ ++ private static String getZoneInfoDir(final String libDir) { ++ return AccessController.doPrivileged (new PrivilegedAction() { ++ public String run() { ++ File f = new File(libDir + File.separator + "tz.properties"); ++ try (BufferedInputStream bin = new BufferedInputStream(new FileInputStream(f))) { ++ Properties props = new Properties(); ++ props.load(bin); ++ String dir = props.getProperty("sun.zoneinfo.dir"); ++ if (dir == null) ++ return null; ++ File tzdbdat = new File(dir, "tzdb.dat"); ++ if (tzdbdat.exists()) ++ return dir; ++ return null; ++ } catch (Exception x) { ++ return null; ++ } ++ } ++ }); ++ } + + private static void addOldMapping() { + for (String[] alias : oldMappings) { diff --git a/freemarker-2.3.29-sources.jar b/freemarker-2.3.29-sources.jar new file mode 100644 index 0000000..2cb9b2e --- /dev/null +++ b/freemarker-2.3.29-sources.jar @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9be4c63f2d68d915daffbef9c8a9b63394a41a846871978be0421c962b51b603 +size 1254826 diff --git a/java-1_8_0-openj9.spec b/java-1_8_0-openj9.spec index 8c18a76..746d9d3 100644 --- a/java-1_8_0-openj9.spec +++ b/java-1_8_0-openj9.spec @@ -86,7 +86,6 @@ %global imagestarget images %endif %global bits 64 -%bcond_without bootstrap Name: java-1_8_0-openj9 Version: %{javaver}.%{updatever} Release: 0 @@ -99,7 +98,11 @@ Source0: %{root_repository}/%{root_revision}.zip Source1: %{omr_repository}/%{omr_revision}.zip Source2: %{openj9_repository}/%{openj9_revision}.zip # Pulseaudio plugin -Source9: http://icedtea.classpath.org/download/source/icedtea-sound-%{icedtea_sound_version}.tar.xz +Source3: http://icedtea.classpath.org/download/source/icedtea-sound-%{icedtea_sound_version}.tar.xz +# Use the freemarker jar from maven central +Source9: https://repo1.maven.org/maven2/org/freemarker/freemarker/%{freemarker_version}/freemarker-%{freemarker_version}.jar +# Package also the sources +Source10: https://repo1.maven.org/maven2/org/freemarker/freemarker/%{freemarker_version}/freemarker-%{freemarker_version}-sources.jar # Desktop files. Adapated from IcedTea. Source11: jconsole.desktop.in Source12: policytool.desktop.in @@ -122,9 +125,11 @@ Patch201: system-libjpeg.patch Patch202: system-libpng.patch Patch203: system-lcms.patch Patch205: link-with-as-needed.patch + +Patch300: alternative-path-to-tzdb_dat.patch BuildRequires: alsa-lib-devel BuildRequires: autoconf -BuildRequires: automake +BuildRequires: automake openssl-devel BuildRequires: binutils BuildRequires: cups-devel BuildRequires: desktop-file-utils @@ -195,12 +200,6 @@ Provides: jre1.6.x Provides: jre1.7.x Provides: jre1.8.x ExclusiveArch: x86_64 ppc64le s390x -%if %{with bootstrap} -# When bootstrapping, use the freemarker jar from maven central -Source10: https://repo1.maven.org/maven2/org/freemarker/freemarker/%{freemarker_version}/freemarker-%{freemarker_version}.jar -%else -BuildRequires: freemarker -%endif %if %{bootcycle} BuildRequires: java-devel >= 1.7 BuildConflicts: java >= 9 @@ -337,7 +336,7 @@ this package unless you really need to. %prep %setup -q -n openj9-openjdk-jdk8-%{root_revision} -a 1 -a 2 %if %{with_pulseaudio} -%setup -q -D -n openj9-openjdk-jdk8-%{root_revision} -T -a 9 +%setup -q -D -n openj9-openjdk-jdk8-%{root_revision} -T -a 3 %endif # Set up the build tree using the subrepository tarballs @@ -369,6 +368,8 @@ rm -rvf jdk/src/share/native/sun/java2d/cmm/lcms/lcms2* %patch3 -p1 %patch4 -p1 +%patch300 -p1 + cat %{SOURCE100} \ | sed "s/@OPENJ9_SHA@/%{openj9_revision}/g" \ | sed "s/@OPENJ9_BRANCH@/%{openj9_branch}/g" \ @@ -404,14 +405,11 @@ bash configure \ --with-giflib=system \ --with-libpng=system \ --with-lcms=system \ + --with-openssl=system \ --with-stdc++lib=dynamic \ --with-native-debug-symbols=internal \ --with-boot-jdk=%{_sysconfdir}/alternatives/java_sdk \ -%if %{with bootstrap} - --with-freemarker-jar=%{SOURCE10} -%else - --with-freemarker-jar=%{_javadir}/freemarker.jar -%endif + --with-freemarker-jar=%{SOURCE9} # The combination of FULL_DEBUG_SYMBOLS=0 and ALT_OBJCOPY=/does_not_exist # disables FDS for all build configs and reverts to pre-FDS make logic. @@ -435,6 +433,9 @@ find %{imagesdir}/j2sdk-image -iname '*.debuginfo' -exec rm {} \; export JAVA_HOME=$(pwd)/%{imagesdir}/j2sdk-image +# Copy tz.properties +echo "sun.zoneinfo.dir=%{_datadir}/javazi" >> $JAVA_HOME/jre/lib/tz.properties + # cacerts are generated in runtime in openSUSE if [ -f %{imagesdir}/j2sdk-image/jre/lib/security/cacerts ]; then rm %{imagesdir}/j2sdk-image/jre/lib/security/cacerts