Browse Source

java-1.7.0-openjdk-1.7.0.91-2.6.2.1

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@9817 ec354946-7b23-47d6-9f5a-488ba84defc7
tomop 8 years ago
parent
commit
c08c531ed6
1 changed files with 162 additions and 59 deletions
  1. 162 59
      j/java-1.7.0-openjdk/java-1.7.0-openjdk-vl.spec

+ 162 - 59
j/java-1.7.0-openjdk/java-1.7.0-openjdk-vl.spec

@@ -1,5 +1,5 @@
 
-%define release_number 3
+%define release_number 1
 
 # If debug is 1, OpenJDK is built with all debug info present.
 %global debug 0
@@ -8,14 +8,17 @@
 # conflicting) files in the -debuginfo package
 %undefine _missing_build_ids_terminate_build
 
-%global icedtea_version 2.4.7
+%global icedtea_version 2.6.2
 %global hg_tag icedtea-{icedtea_version}
 
 %global aarch64			aarch64 arm64 armv8
-%global multilib_arches %{power64} sparc64 x86_64 %{aarch64}
-%global jit_arches		%{ix86} x86_64 sparcv9 sparc64
+#sometimes we need to distinguish big and little endian PPC64
+%global ppc64le			ppc64le
+%global ppc64be			ppc64 ppc64p7
+%global multilib_arches %{power64} sparc64 x86_64 
+%global jit_arches		%{ix86} x86_64 sparcv9 sparc64 %{ppc64be} %{ppc64le} %{aarch64}
 
-# With diabled nss is NSS deactivated, so in NSS_LIBDIR can be wrong path
+# With disabled nss is NSS deactivated, so in NSS_LIBDIR can be wrong path
 # the initialisation must be here. LAter the pkg-connfig have bugy behaviour
 #looks liekopenjdk RPM specific bug
 # Always set this so the nss.cfg file is not broken
@@ -30,11 +33,16 @@
 %global archinstall ppc
 %global archdef PPC
 %endif
-%ifarch %{power64}
+%ifarch %{ppc64be}
 %global archbuild ppc64
 %global archinstall ppc64
 %global archdef PPC
 %endif
+%ifarch %{ppc64le}
+%global archbuild ppc64le
+%global archinstall ppc64le
+%global archdef PPC64
+%endif
 %ifarch %{ix86}
 %global archbuild i586
 %global archinstall i386
@@ -84,7 +92,15 @@
 %global debugbuild %{nil}
 %endif
 
+# If hsbootstrap is 1, build HotSpot alone first and use that in the bootstrap JDK
+# You can turn this on to avoid issues where HotSpot is broken in the bootstrap JDK
+%global hsbootstrap 0
+
+%if %{debug}
+%global buildoutputdir openjdk/build/linux-%{archbuild}-debug
+%else
 %global buildoutputdir openjdk/build/linux-%{archbuild}
+%endif
 
 %global with_pulseaudio 1
 
@@ -113,11 +129,10 @@
 
 # Standard JPackage naming and versioning defines.
 %global origin          openjdk
-%global updatever       55
-#Fedora have an bogus 60 instead of updatever. Fix when updatever>=60 in version:
-%global buildver        13
-# Keep priority on 6digits in case updatever>9
-%global priority        1700%{updatever}
+%global updatever       91
+%global buildver        00
+# Keep priority on 7digits in case updatever>9
+%global priority        17000%{updatever}
 %global javaver         1.7.0
 
 %global sdkdir          %{uniquesuffix}
@@ -177,7 +192,7 @@ URL:      http://openjdk.java.net/
 #head
 #REPO=http://icedtea.classpath.org/hg/icedtea7-forest
 #current release
-#REPO=http://icedtea.classpath.org/hg/release/icedtea7-forest-2.4
+#REPO=http://icedtea.classpath.org/hg/release/icedtea7-forest-2.5
 # hg clone $REPO/ openjdk -r %{hg_tag}
 # hg clone $REPO/corba/ openjdk/corba -r %{hg_tag}
 # hg clone $REPO/hotspot/ openjdk/hotspot -r %{hg_tag}
@@ -186,7 +201,7 @@ URL:      http://openjdk.java.net/
 # hg clone $REPO/jdk/ openjdk/jdk -r %{hg_tag}
 # hg clone $REPO/langtools/ openjdk/langtools -r %{hg_tag}
 # find openjdk -name ".hg" -exec rm -rf '{}' \;
-# sh /git/java-1.7.0-openjdk/rhel-7.0/fsg.sh
+# sh /git/java-1.7.0-openjdk/rhel-7.1/fsg.sh
 # tar cJf openjdk-icedtea-%{icedtea_version}.tar.xz openjdk
 Source0:  openjdk-icedtea-%{icedtea_version}.tar.xz
 
@@ -202,7 +217,7 @@ Source5: class-rewriter.tar.gz
 
 # Systemtap tapsets. Zipped up to keep it small.
 # last update from http://icedtea.classpath.org/hg/icedtea7/file/8599fdfc398d/tapset
-Source6: systemtap-tapset-2013-10-02.tar.gz
+Source6: systemtap-tapset-2014-03-19.tar.xz
 
 # .desktop files. 
 Source7:  policytool.desktop
@@ -267,9 +282,11 @@ Patch200: abrt_friendly_hs_log_jdk7.patch
 # mixer
 Patch300: pulse-soundproperties.patch
 
+# Make the curves reported by Java's SSL implementation match those of NSS
+Patch400: rh1022017.patch
+
 # Temporary patches
-#Workaround RH902004
-Patch403: PStack-808293.patch
+Patch500: 8072932or8074489.patch
 # End of tmp patches
 
 BuildRequires: autoconf
@@ -304,6 +321,16 @@ BuildRequires: at-spi-devel
 BuildRequires: gawk
 BuildRequires: pkgconfig >= 0.9.0
 BuildRequires: xorg-x11-utils
+# Requirements for setting up the nss.cfg
+BuildRequires: nss-devel
+# Required for NIO2
+BuildRequires: libattr-devel
+# Required for smartcard support
+BuildRequires: pcsc-lite-devel
+# Required for SCTP support
+BuildRequires: lksctp-tools-devel
+# Required for fallback native proxy support
+BuildRequires: GConf2-devel
 # PulseAudio build requirements.
 %if %{with_pulseaudio}
 BuildRequires: pulseaudio-libs-devel >= 0.9.11
@@ -312,14 +339,12 @@ BuildRequires: pulseaudio-libs-devel >= 0.9.11
 %ifnarch %{jit_arches}
 BuildRequires: libffi-devel >= 3.0.10
 %endif
-# Requirements for setting up the nss.cfg
-BuildRequires: nss-devel
 
 # cacerts build requirement.
 BuildRequires: openssl
 # execstack build requirement.
 # no prelink on ARM yet
-%ifnarch %{arm} %{aarch64}
+%ifnarch %{arm} %{aarch64} %{ppc64le}
 BuildRequires: prelink
 %endif
 %ifarch %{jit_arches}
@@ -476,6 +501,12 @@ Although working pretty fine, there are known issues with accessibility on, so d
 
 %prep
 %setup -q -c -n %{uniquesuffix} -T -a 0
+# https://bugzilla.redhat.com/show_bug.cgi?id=1189084
+prioritylength=`expr length %{priority}`
+if [ $prioritylength -ne 7 ] ; then
+ echo "priority must be 7 digits in total, violated"
+ exit 14
+fi
 cp %{SOURCE2} .
 
 # OpenJDK patches
@@ -486,23 +517,25 @@ cp %{SOURCE2} .
 %patch300
 %endif
 
+# ECC fix
+%patch400
+
 # Add systemtap patches if enabled
 %if %{with_systemtap}
 %endif
 
+%patch500
+
 # Remove libraries that are linked
 sh %{SOURCE10}
 
-# Copy jaxp, jaf and jaxws drops
-mkdir drops/
-
 # Extract the rewriter (to rewrite rhino classes)
 tar xzf %{SOURCE5}
 
 # Extract systemtap tapsets
 %if %{with_systemtap}
 
-tar xzf %{SOURCE6}
+tar xf %{SOURCE6}
 
 for file in tapset/*.in; do
 
@@ -538,19 +571,10 @@ tar xzf %{SOURCE9}
 %patch106
 %patch200
 
-%patch403
-
-
-
 %build
 # How many cpu's do we have?
-%ifarch aarch64
-# temporary until real hardware lands
-export NUM_PROC=1
-%else
 export NUM_PROC=`/usr/bin/getconf _NPROCESSORS_ONLN 2> /dev/null || :`
 export NUM_PROC=${NUM_PROC:-1}
-%endif
 
 # Build IcedTea and OpenJDK.
 %ifarch s390x sparc64 alpha %{power64} %{aarch64}
@@ -560,7 +584,9 @@ export ARCH_DATA_MODEL=64
 export CFLAGS="$CFLAGS -mieee"
 %endif
 
-export CFLAGS="$CFLAGS -fstack-protector"
+#CFLAGS="$CFLAGS -fstack-protector-strong"
+CFLAGS="$CFLAGS -fstack-protector"
+export CFLAGS
 
 # Build the re-written rhino jar
 mkdir -p rhino/{old,new}
@@ -594,13 +620,13 @@ java -cp rewriter com.redhat.rewriter.ClassRewriter \
    jar cfm ../rhino.jar META-INF/MANIFEST.MF sun
 )
 
-export JDK_TO_BUILD_WITH=/usr/lib/jvm/java-openjdk
+export SYSTEM_JDK_DIR=/usr/lib/jvm/java-1.7.0-openjdk
 
+export JDK_TO_BUILD_WITH=${SYSTEM_JDK_DIR}
 
 
 pushd openjdk >& /dev/null
 
-export ALT_DROPS_DIR=$PWD/../drops
 export ALT_BOOTDIR="$JDK_TO_BUILD_WITH"
 
 # Save old umask as jdk_generic_profile overwrites it
@@ -610,17 +636,24 @@ oldumask=`umask`
 %ifnarch %{jit_arches}
 export ZERO_BUILD=true
 %endif
+
+export PKGVERSION="vine-%{release}-%{_arch} u%{updatever}-b%{buildver}"
+
 source jdk/make/jdk_generic_profile.sh
 
 # Restore old umask
 umask $oldumask
 
+%if %{hsbootstrap}
+
+mkdir bootstrap
+
 make \
   DISABLE_INTREE_EC=true \
   UNLIMITED_CRYPTO=true \
   ANT="/usr/bin/ant" \
   DISTRO_NAME="Vine Linux" \
-  DISTRO_PACKAGE_VERSION="vine-%{release}-%{_arch}" \
+  DISTRO_PACKAGE_VERSION="${PKGVERSION}" \
   JDK_UPDATE_VERSION=`printf "%02d" %{updatever}` \
   JDK_BUILD_NUMBER=b`printf "%02d" %{buildver}` \
   JRE_RELEASE_VERSION=%{javaver}_`printf "%02d" %{updatever}`-b`printf "%02d" %{buildver}` \
@@ -635,33 +668,63 @@ make \
   DEBUG_CLASSFILES="true" \
   DEBUG_BINARIES="true" \
   STRIP_POLICY="no_strip" \
-%ifnarch %{jit_arches}
-  LIBFFI_CFLAGS="`pkg-config --cflags libffi` " \
-  LIBFFI_LIBS="-lffi " \
-  ZERO_BUILD="true" \
-  ZERO_LIBARCH="%{archbuild}" \
-  ZERO_ARCHDEF="%{archdef}" \
-%ifarch ppc %{power64} s390 s390x
-  ZERO_ENDIANNESS="big" \
-%else
-  ZERO_ENDIANNESS="little" \
-  ZERO_ARCHFLAG="-D_LITTLE_ENDIAN" \
-%endif
+  JAVAC_WARNINGS_FATAL="false" \
+  INSTALL_LOCATION=%{_jvmdir}/%{sdkdir} \
+  SYSTEM_GSETTINGS="true" \
+  BUILD_JAXP=false BUILD_JAXWS=false BUILD_LANGTOOLS=false BUILD_JDK=false BUILD_CORBA=false \
+  ALT_JDK_IMPORT_PATH=${JDK_TO_BUILD_WITH} ALT_OUTPUTDIR=${PWD}/bootstrap \
+  %{debugbuild}
+
+export VM_DIR=bootstrap-vm/jre/lib/%{archinstall}/server
+cp -dR ${SYSTEM_JDK_DIR}-* bootstrap-vm
+rm -vf ${VM_DIR}/libjvm.so
+if [ ! -e ${VM_DIR} ] ; then mkdir -p ${VM_DIR}; fi
+cp -av bootstrap/hotspot/import/jre/lib/%{archinstall}/server/libjvm.so ${VM_DIR}
+
+export ALT_BOOTDIR=${PWD}/bootstrap-vm
+  
 %endif
+
+# ENABLE_FULL_DEBUG_SYMBOLS=0 is the internal HotSpot option
+# to turn off the stripping of debuginfo. FULL_DEBUG_SYMBOLS
+# does the same for product builds, but is ignored on non-product builds.
+make \
+  DISABLE_INTREE_EC=true \
+  UNLIMITED_CRYPTO=true \
+  ANT="/usr/bin/ant" \
+  DISTRO_NAME="Vine Linux" \
+  DISTRO_PACKAGE_VERSION="${PKGVERSION}" \
+  JDK_UPDATE_VERSION=`printf "%02d" %{updatever}` \
+  JDK_BUILD_NUMBER=b`printf "%02d" %{buildver}` \
+  JRE_RELEASE_VERSION=%{javaver}_`printf "%02d" %{updatever}`-b`printf "%02d" %{buildver}` \
+  MILESTONE="fcs" \
+  ALT_PARALLEL_COMPILE_JOBS="$NUM_PROC" \
+  HOTSPOT_BUILD_JOBS="$NUM_PROC" \
+  STATIC_CXX="false" \
+  RHINO_JAR="$PWD/../rhino/rhino.jar" \
+  GENSRCDIR="$PWD/generated.build" \
+  FT2_CFLAGS="`pkg-config --cflags freetype2` " \
+  FT2_LIBS="`pkg-config --libs freetype2` " \
+  DEBUG_CLASSFILES="true" \
+  DEBUG_BINARIES="true" \
+  STRIP_POLICY="no_strip" \
+  JAVAC_WARNINGS_FATAL="false" \
+  INSTALL_LOCATION=%{_jvmdir}/%{sdkdir} \
+  SYSTEM_GSETTINGS="true" \
   %{debugbuild}
 
 popd >& /dev/null
 
-%ifarch %{jit_arches}
-chmod 644 $(pwd)/%{buildoutputdir}/j2sdk-image/lib/sa-jdi.jar
-%endif
+if [ -e $(pwd)/%{buildoutputdir}/j2sdk-image/lib/sa-jdi.jar ]; then 
+  chmod 644 $(pwd)/%{buildoutputdir}/j2sdk-image/lib/sa-jdi.jar;
+fi
 
 export JAVA_HOME=$(pwd)/%{buildoutputdir}/j2sdk-image
 
 # Install java-abrt-luncher
 mkdir  $JAVA_HOME/jre-abrt
 mkdir  $JAVA_HOME/jre-abrt/bin
-mv  $JAVA_HOME/jre/bin/java $JAVA_HOME/jre-abrt/bin/java
+mv $JAVA_HOME/jre/bin/java $JAVA_HOME/jre-abrt/bin/java
 ln -s %{_jvmdir}/%{sdkdir}/jre/lib $JAVA_HOME/jre-abrt/lib
 cat %{SOURCE13} | sed -e s:@JAVA_PATH@:%{_jvmdir}/%{sdkdir}/jre-abrt/bin/java:g -e s:@LIB_DIR@:%{LIBDIR}/libabrt-java-connector.so:g >  $JAVA_HOME/jre/bin/java
 chmod 755 $JAVA_HOME/jre/bin/java
@@ -700,11 +763,9 @@ sh %{SOURCE11} ${JAVA_HOME}
 rm -rf $RPM_BUILD_ROOT
 STRIP_KEEP_SYMTAB=libjvm*
 
-# Install symlink to default soundfont
-install -d -m 755 $RPM_BUILD_ROOT%{_jvmdir}/%{jredir}/lib/audio
-pushd $RPM_BUILD_ROOT%{_jvmdir}/%{jredir}/lib/audio
-ln -s %{_datadir}/soundfonts/default.sf2
-popd
+# there used to be and link to soundfont
+# will be replaced by fix of http://mail.openjdk.java.net/pipermail/sound-dev/2015-October/000352.html
+# once done, and have to go to fedora first. Removed from rhel7 for now
 
 pushd %{buildoutputdir}/j2sdk-image
 
@@ -969,6 +1030,12 @@ for i,p in pairs(foundJvms) do
     if (debug) then
       print("matched:  "..p)
     end;
+    if (currentjvm ==  p) then
+      if (debug) then
+        print("this jdk is already installed. exiting lua script")
+      end;
+      return
+    end ;
     table.insert(jvms, p)
   else
     if (debug) then
@@ -1075,10 +1142,30 @@ exit 0
 # FIXME: identical binaries are copied, not linked. This needs to be
 # fixed upstream.
 %post headless
+# The pretrans lua scriptlet prevents an unmodified java.security
+# from being replaced via an update. It gets created as
+# java.security.rpmnew instead. This invalidates the patch of
+# JDK-8061210 of the January 2015 CPU or JDK-8043201 of the
+# July 2015 CPU. We fix this via a post scriptlet which runs on updates.
+if [ "$1" -gt 1 ]; then
+  javasecurity="%{_jvmdir}/%{uniquesuffix}/jre/lib/security/java.security"
+  sum=$(md5sum "${javasecurity}" | cut -d' ' -f1)
+  # This is the md5sum of an unmodified java.security file
+  if [ "${sum}" = '567d9244d9ef1ac0e557d05eb0892413' -o \
+       "${sum}" = '034a9bfa527cbdf58f021ce0e47e22db' ]; then
+    if [ -f "${javasecurity}.rpmnew" ]; then
+      mv -f "${javasecurity}.rpmnew" "${javasecurity}"
+    fi
+  fi
+fi
+
 %ifarch %{jit_arches}
+# MetaspaceShared::generate_vtable_methods not implemented for PPC JIT
+%ifnarch %{power64}
 #see https://bugzilla.redhat.com/show_bug.cgi?id=513605
 %{jrebindir}/java -Xshare:dump >/dev/null 2>/dev/null
 %endif
+%endif
 
 ext=.gz
 alternatives \
@@ -1123,6 +1210,10 @@ done
 update-alternatives --install %{_jvmdir}/jre-%{javaver}-%{origin} jre_%{javaver}_%{origin} %{_jvmdir}/%{jrelnk} %{priority} \
 --slave %{_jvmjardir}/jre-%{javaver}       jre_%{javaver}_%{origin}_exports      %{jvmjardir}
 
+update-desktop-database %{_datadir}/applications &> /dev/null || :
+
+/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
+
 exit 0
 
 %postun
@@ -1297,13 +1388,19 @@ exit 0
 %files -f %{name}.files
 %{_datadir}/icons/hicolor/*x*/apps/java-%{javaver}.png
 
-
+# important note, see https://bugzilla.redhat.com/show_bug.cgi?id=1038092 for whole issue 
+# all config/norepalce files (and more) have to be declared in pretrans. See pretrans
 %files headless  -f %{name}.files-headless
 %defattr(-,root,root,-)
 %doc %{_jvmdir}/%{sdkdir}/ASSEMBLY_EXCEPTION
 %doc %{_jvmdir}/%{sdkdir}/LICENSE
 %doc %{_jvmdir}/%{sdkdir}/THIRD_PARTY_README
 %dir %{_jvmdir}/%{sdkdir}
+%dir %{_jvmdir}/%{sdkdir}/jre/lib/
+%dir %{_jvmdir}/%{sdkdir}/jre/lib/%{archinstall}
+%ifarch x86_64
+%dir %{_jvmdir}/%{sdkdir}/jre/lib/%{archinstall}/xawt
+%endif
 %{_jvmdir}/%{jrelnk}
 %{_jvmjardir}/%{jrelnk}
 %{_jvmprivdir}/*
@@ -1325,7 +1422,8 @@ exit 0
 %{_mandir}/man1/tnameserv-%{uniquesuffix}.1*
 %{_mandir}/man1/unpack200-%{uniquesuffix}.1*
 %config(noreplace) %{_jvmdir}/%{jredir}/lib/security/nss.cfg
-%{_jvmdir}/%{jredir}/lib/audio/
+# removed %%{_jvmdir}/%%{jredir}/lib/audio/
+# see soundfont in %%install
 %ifarch %{jit_arches}
 %attr(664, root, root) %ghost %{_jvmdir}/%{jredir}/lib/%{archinstall}/server/classes.jsa
 %attr(664, root, root) %ghost %{_jvmdir}/%{jredir}/lib/%{archinstall}/client/classes.jsa
@@ -1333,6 +1431,7 @@ exit 0
 %{_jvmdir}/%{jredir}/lib/%{archinstall}/server/
 %{_jvmdir}/%{jredir}/lib/%{archinstall}/client/
 %{_sysconfdir}/.java/
+%{_sysconfdir}/.java/.systemPrefs
 %{_jvmdir}/%{sdkdir}/jre-abrt
 
 
@@ -1410,6 +1509,10 @@ exit 0
 %{_jvmdir}/%{jredir}/lib/accessibility.properties
 
 %changelog
+* Tue Nov 17 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.7.0.91-2.6.2.1
+- new upstream release.
+- import changes from CentOS7.
+
 * Mon Jul 14 2014 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.7.0.55-2.4.7.3
 - replaced most of stuff with specfile of RHEL7.