added javadoc-zip(-debug) subpackage with compressed javadoc based on patch400 jdk8-archivedJavadoc.patch

This commit is contained in:
Jiri Vanek 2016-04-04 16:54:41 +02:00
parent ebc98b64d4
commit db2f51d746
2 changed files with 148 additions and 1 deletions

View File

@ -475,6 +475,24 @@ exit 0
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: %global files_jre() %{expand:
%{_datadir}/icons/hicolor/*x*/apps/java-%{javaver}.png %{_datadir}/icons/hicolor/*x*/apps/java-%{javaver}.png
%{_datadir}/applications/*policytool%1.desktop %{_datadir}/applications/*policytool%1.desktop
@ -589,6 +607,12 @@ exit 0
%doc %{buildoutputdir %%1}/images/%{j2sdkimage}/jre/LICENSE %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: %global files_accessibility() %{expand:
%{_jvmdir}/%{jredir %%1}/lib/%{archinstall}/libatk-wrapper.so %{_jvmdir}/%{jredir %%1}/lib/%{archinstall}/libatk-wrapper.so
%{_jvmdir}/%{jredir %%1}/lib/ext/java-atk-wrapper.jar %{_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} Name: java-%{javaver}-%{origin}
Version: %{javaver}.%{updatever} 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, # 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 # 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 # also included the epoch in their virtual provides. This created a
@ -865,6 +889,8 @@ Patch505: 8143855.patch
Patch201: system-libjpeg.patch Patch201: system-libjpeg.patch
# Local fixes # Local fixes
# see http://mail.openjdk.java.net/pipermail/build-dev/2016-March/016852.html thread
Patch400: jdk8-archivedJavadoc.patch
# Non-OpenJDK fixes # Non-OpenJDK fixes
Patch300: jstack-pr1845.patch Patch300: jstack-pr1845.patch
@ -1033,6 +1059,19 @@ BuildArch: noarch
The OpenJDK API documentation. The OpenJDK API documentation.
%endif %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} %if %{include_debug_build}
%package javadoc-debug %package javadoc-debug
Summary: OpenJDK API Documentation %{for_debug} Summary: OpenJDK API Documentation %{for_debug}
@ -1046,6 +1085,20 @@ BuildArch: noarch
The OpenJDK API documentation %{for_debug}. The OpenJDK API documentation %{for_debug}.
%endif %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} %if %{include_normal_build}
%package accessibility %package accessibility
Summary: OpenJDK accessibility connector Summary: OpenJDK accessibility connector
@ -1161,6 +1214,7 @@ tar xzf %{SOURCE8}
cp -r tapset tapset%{debug_suffix} cp -r tapset tapset%{debug_suffix}
%endif %endif
%patch400
for suffix in %{build_loop} ; do for suffix in %{build_loop} ; do
for file in "tapset"$suffix/*.in; do for file in "tapset"$suffix/*.in; do
@ -1276,6 +1330,8 @@ make \
SCTP_WERROR= \ SCTP_WERROR= \
%{targets} %{targets}
make zip-docs
# the build (erroneously) removes read permissions from some jars # the build (erroneously) removes read permissions from some jars
# this is a regression in OpenJDK 7 (our compiler): # this is a regression in OpenJDK 7 (our compiler):
# http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1437 # http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=1437
@ -1449,6 +1505,7 @@ popd
# Install Javadoc documentation. # Install Javadoc documentation.
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir} install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}
cp -a %{buildoutputdir $suffix}/docs $RPM_BUILD_ROOT%{_javadocdir}/%{uniquejavadocdir $suffix} 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. # Install icons and menu entries.
for s in 16 24 32 48 ; do for s in 16 24 32 48 ; do
@ -1625,6 +1682,12 @@ require "copy_jdk_configs.lua"
%postun javadoc %postun javadoc
%{postun_javadoc %{nil}} %{postun_javadoc %{nil}}
%post javadoc-zip
%{post_javadoc_zip %{nil}}
%postun javadoc-zip
%{postun_javadoc_zip %{nil}}
%endif %endif
%if %{include_debug_build} %if %{include_debug_build}
@ -1657,6 +1720,12 @@ require "copy_jdk_configs.lua"
%postun javadoc-debug %postun javadoc-debug
%{postun_javadoc %{debug_suffix_unquoted}} %{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 %endif
%if %{include_normal_build} %if %{include_normal_build}
@ -1687,6 +1756,9 @@ require "copy_jdk_configs.lua"
%files javadoc %files javadoc
%{files_javadoc %{nil}} %{files_javadoc %{nil}}
%files javadoc-zip
%{files_javadoc_zip %{nil}}
%files accessibility %files accessibility
%{files_accessibility %{nil}} %{files_accessibility %{nil}}
%endif %endif
@ -1710,11 +1782,18 @@ require "copy_jdk_configs.lua"
%files javadoc-debug %files javadoc-debug
%{files_javadoc %{debug_suffix_unquoted}} %{files_javadoc %{debug_suffix_unquoted}}
%files javadoc-zip-debug
%{files_javadoc_zip %{debug_suffix_unquoted}}
%files accessibility-debug %files accessibility-debug
%{files_accessibility %{debug_suffix_unquoted}} %{files_accessibility %{debug_suffix_unquoted}}
%endif %endif
%changelog %changelog
* Mon Apr 04 2016 jvanek <jvanek@redhat.com> - 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 <gnu.andrew@redhat.com> - 1:1.8.0.77-1.b03 * Wed Mar 23 2016 Andrew Hughes <gnu.andrew@redhat.com> - 1:1.8.0.77-1.b03
- Update to u77b03. - Update to u77b03.

View File

@ -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)