diff --git a/java-1.8.0-openjdk.spec b/java-1.8.0-openjdk.spec index 10a9edc..af3eb09 100644 --- a/java-1.8.0-openjdk.spec +++ b/java-1.8.0-openjdk.spec @@ -475,6 +475,24 @@ exit 0 exit 0 } +%global post_javadoc_zip() %{expand: + +PRIORITY=%{priority} +if [ "%1" == %{debug_suffix} ]; then + let PRIORITY=PRIORITY-1 +fi + +alternatives \\ + --install %{_javadocdir}/java-zip javadoczip %{_javadocdir}/%{uniquejavadocdir %%1}.zip \\ + $PRIORITY --family %{name} +exit 0 +} + +%global postun_javadoc_zip() %{expand: + alternatives --remove javadoczip %{_javadocdir}/%{uniquejavadocdir %%1}.zip +exit 0 +} + %global files_jre() %{expand: %{_datadir}/icons/hicolor/*x*/apps/java-%{javaver}.png %{_datadir}/applications/*policytool%1.desktop @@ -589,6 +607,12 @@ exit 0 %doc %{buildoutputdir %%1}/images/%{j2sdkimage}/jre/LICENSE } +%global files_javadoc_zip() %{expand: +%defattr(-,root,root,-) +%doc %{_javadocdir}/%{uniquejavadocdir %%1}.zip +%doc %{buildoutputdir %%1}/images/%{j2sdkimage}/jre/LICENSE +} + %global files_accessibility() %{expand: %{_jvmdir}/%{jredir %%1}/lib/%{archinstall}/libatk-wrapper.so %{_jvmdir}/%{jredir %%1}/lib/ext/java-atk-wrapper.jar @@ -737,7 +761,7 @@ Obsoletes: java-1.7.0-openjdk-accessibility%1 Name: java-%{javaver}-%{origin} Version: %{javaver}.%{updatever} -Release: 1.%{buildver}%{?dist} +Release: 2.%{buildver}%{?dist} # java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons, # and this change was brought into RHEL-4. java-1.5.0-ibm packages # also included the epoch in their virtual provides. This created a @@ -865,6 +889,8 @@ Patch505: 8143855.patch Patch201: system-libjpeg.patch # Local fixes +# see http://mail.openjdk.java.net/pipermail/build-dev/2016-March/016852.html thread +Patch400: jdk8-archivedJavadoc.patch # Non-OpenJDK fixes Patch300: jstack-pr1845.patch @@ -1033,6 +1059,19 @@ BuildArch: noarch The OpenJDK API documentation. %endif +%if %{include_normal_build} +%package javadoc-zip +Summary: OpenJDK API Documentation compressed in single archive +Group: Documentation +Requires: javapackages-tools +BuildArch: noarch + +%{java_javadoc_rpo %{nil}} + +%description javadoc-zip +The OpenJDK API documentation compressed in single archive. +%endif + %if %{include_debug_build} %package javadoc-debug Summary: OpenJDK API Documentation %{for_debug} @@ -1046,6 +1085,20 @@ BuildArch: noarch The OpenJDK API documentation %{for_debug}. %endif +%if %{include_debug_build} +%package javadoc-zip-debug +Summary: OpenJDK API Documentation compressed in single archive %{for_debug} +Group: Documentation +Requires: javapackages-tools +BuildArch: noarch + +%{java_javadoc_rpo %{debug_suffix_unquoted}} + +%description javadoc-zip-debug +The OpenJDK API documentation compressed in single archive %{for_debug}. +%endif + + %if %{include_normal_build} %package accessibility Summary: OpenJDK accessibility connector @@ -1161,6 +1214,7 @@ tar xzf %{SOURCE8} cp -r tapset tapset%{debug_suffix} %endif +%patch400 for suffix in %{build_loop} ; do for file in "tapset"$suffix/*.in; do @@ -1276,6 +1330,8 @@ make \ SCTP_WERROR= \ %{targets} +make zip-docs + # the build (erroneously) removes read permissions from some jars # this is a regression in OpenJDK 7 (our compiler): # http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1437 @@ -1449,6 +1505,7 @@ popd # Install Javadoc documentation. install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir} cp -a %{buildoutputdir $suffix}/docs $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir $suffix} +cp -a %{buildoutputdir $suffix}/bundles/jdk-%{javaver}_%{updatever}$suffix-%{buildver}-docs.zip $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir $suffix}.zip # Install icons and menu entries. for s in 16 24 32 48 ; do @@ -1625,6 +1682,12 @@ require "copy_jdk_configs.lua" %postun javadoc %{postun_javadoc %{nil}} + +%post javadoc-zip +%{post_javadoc_zip %{nil}} + +%postun javadoc-zip +%{postun_javadoc_zip %{nil}} %endif %if %{include_debug_build} @@ -1657,6 +1720,12 @@ require "copy_jdk_configs.lua" %postun javadoc-debug %{postun_javadoc %{debug_suffix_unquoted}} + +%post javadoc-zip-debug +%{post_javadoc_zip %{debug_suffix_unquoted}} + +%postun javadoc-zip-debug +%{postun_javadoc_zip %{debug_suffix_unquoted}} %endif %if %{include_normal_build} @@ -1687,6 +1756,9 @@ require "copy_jdk_configs.lua" %files javadoc %{files_javadoc %{nil}} +%files javadoc-zip +%{files_javadoc_zip %{nil}} + %files accessibility %{files_accessibility %{nil}} %endif @@ -1710,11 +1782,18 @@ require "copy_jdk_configs.lua" %files javadoc-debug %{files_javadoc %{debug_suffix_unquoted}} +%files javadoc-zip-debug +%{files_javadoc_zip %{debug_suffix_unquoted}} + %files accessibility-debug %{files_accessibility %{debug_suffix_unquoted}} %endif %changelog +* Mon Apr 04 2016 jvanek - 1:1.8.0.77-2.b03 +- added patch400 jdk8-archivedJavadoc.patch +- added javadoc-zip(-debug) subpackage with compressed javadoc + * Wed Mar 23 2016 Andrew Hughes - 1:1.8.0.77-1.b03 - Update to u77b03. diff --git a/jdk8-archivedJavadoc.patch b/jdk8-archivedJavadoc.patch new file mode 100644 index 0000000..3a43c5f --- /dev/null +++ b/jdk8-archivedJavadoc.patch @@ -0,0 +1,68 @@ +--- jdk8/make/Javadoc.gmk 2016-04-01 16:53:41.069477682 +0200 ++++ jdk8/make/Javadoc.gmk 2016-04-01 16:53:41.014477059 +0200 +@@ -220,6 +220,12 @@ + JRE_API_DOCSDIR = $(DOCSDIR)/jre/api + PLATFORM_DOCSDIR = $(DOCSDIR)/platform + ++ ++JAVADOC_ARCHIVE_NAME := jdk-$(FULL_VERSION)-docs.zip ++JAVADOC_ARCHIVE_ASSEMBLY_DIR := $(DOCSTMPDIR)/zip-docs ++JAVADOC_ARCHIVE_DIR := $(OUTPUT_ROOT)/bundles ++JAVADOC_ARCHIVE := $(JAVADOC_ARCHIVE_DIR)/$(JAVADOC_ARCHIVE_NAME) ++ + # The non-core api javadocs need to be able to access the root of the core + # api directory, so for jdk/api or jre/api to get to the core api/ + # directory we would use this: +@@ -319,6 +325,37 @@ + all: docs + docs: coredocs otherdocs + ++# ++# Optional target which bundles all generated javadocs into a zip ++# archive. The dependency on docs is handled in Main.gmk. Incremental ++# building of docs is currently broken so if you invoke zip-docs after ++# docs, the docs are always rebuilt. ++# ++ ++zip-docs: $(JAVADOC_ARCHIVE) ++ ++# ++# Add the core docs as prerequisite to the archive to trigger a rebuild ++# if the core docs were rebuilt. Ideally any doc rebuild should trigger ++# this, but the way prerequisites are currently setup in this file, that ++# is hard to achieve. ++# ++ ++$(JAVADOC_ARCHIVE): $(COREAPI_INDEX_FILE) ++ @$(ECHO) "Compressing javadoc to single $(JAVADOC_ARCHIVE_NAME)" ; ++ $(MKDIR) -p $(JAVADOC_ARCHIVE_DIR) ; ++ $(RM) -r $(JAVADOC_ARCHIVE_ASSEMBLY_DIR) ; ++ $(MKDIR) -p $(JAVADOC_ARCHIVE_ASSEMBLY_DIR); ++ all_roots=`$(FIND) $(DOCSDIR) | $(GREP) index.html `; \ ++ pushd $(JAVADOC_ARCHIVE_ASSEMBLY_DIR); \ ++ for index_file in $${all_roots} ; do \ ++ target_dir=`dirname $${index_file}`; \ ++ name=`$(ECHO) $${target_dir} | $(SED) "s;/spec;;" | $(SED) "s;.*/;;"`; \ ++ $(LN) -s $${target_dir} $${name}; \ ++ done; \ ++ $(ZIP) -q -r $(JAVADOC_ARCHIVE) * ; \ ++ popd ; ++ + ################################################################# + # Production Targets -- USE THESE TARGETS WHEN: + # a) You're generating docs outside of release engineering's +--- jdk8/make/Main.gmk 2016-04-01 16:53:41.311480424 +0200 ++++ jdk8/make/Main.gmk 2016-04-01 16:53:41.266479914 +0200 +@@ -165,6 +165,12 @@ + @($(CD) $(SRC_ROOT)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs) + @$(call TargetExit) + ++zip-docs: docs zip-docs-only ++zip-docs-only: start-make ++ @$(call TargetEnter) ++ @($(CD) $(SRC_ROOT)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk zip-docs) ++ @$(call TargetExit) ++ + sign-jars: jdk sign-jars-only + sign-jars-only: start-make + @$(call TargetEnter)