Compare commits

...

No commits in common. "c8-stream-201902" and "c8-stream-10.6" have entirely different histories.

9 changed files with 362 additions and 110 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/Xerces-J-src.2.12.0.tar.gz
SOURCES/Xerces-J-src.2.11.0.tar.gz

View File

@ -1 +1 @@
474275833fe481c1da2461d6b2bb6bd3304dee7e SOURCES/Xerces-J-src.2.12.0.tar.gz
c57f0251ce9246c6026aa9f92241f37108f7141f SOURCES/Xerces-J-src.2.11.0.tar.gz

View File

@ -0,0 +1,131 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.xerces.util;
import java.util.Map;
import com.sun.javadoc.Tag;
import com.sun.tools.doclets.Taglet;
/**
* This class provides support for a 'xerces.experimental' tag
* in javadoc comments. The tag creates a warning in the generated
* html for users.
*
* @author Ankit Pasricha, IBM
*/
public class ExperimentalTaglet implements Taglet {
private static final String NAME = "xerces.experimental";
private static final String HEADER = "EXPERIMENTAL:";
/* (non-Javadoc)
* @see com.sun.tools.doclets.Taglet#inConstructor()
*/
public boolean inConstructor() {
return false;
}
/* (non-Javadoc)
* @see com.sun.tools.doclets.Taglet#inField()
*/
public boolean inField() {
return false;
}
/* (non-Javadoc)
* @see com.sun.tools.doclets.Taglet#inMethod()
*/
public boolean inMethod() {
return true;
}
/* (non-Javadoc)
* @see com.sun.tools.doclets.Taglet#inOverview()
*/
public boolean inOverview() {
return true;
}
/* (non-Javadoc)
* @see com.sun.tools.doclets.Taglet#inPackage()
*/
public boolean inPackage() {
return false;
}
/* (non-Javadoc)
* @see com.sun.tools.doclets.Taglet#inType()
*/
public boolean inType() {
return true;
}
/* (non-Javadoc)
* @see com.sun.tools.doclets.Taglet#isInlineTag()
*/
public boolean isInlineTag() {
return false;
}
/* (non-Javadoc)
* @see com.sun.tools.doclets.Taglet#getName()
*/
public String getName() {
return NAME;
}
/* (non-Javadoc)
* @see com.sun.tools.doclets.Taglet#toString(com.sun.javadoc.Tag)
*/
public String toString(Tag arg0) {
return "<DT><H1 style=\"font-size:150%\">" + HEADER + "</H1><DD>"
+ "This class should not be considered stable. It is likely to be altered or replaced in the future.<br/>"
+ "<I>" + arg0.text() + "</I></DD>\n";
}
/* (non-Javadoc)
* @see com.sun.tools.doclets.Taglet#toString(com.sun.javadoc.Tag[])
*/
public String toString(Tag[] tags) {
if (tags.length == 0) {
return null;
}
String result = "\n<DT><H1 style=\"font-size:150%\">" + HEADER + "</H1><DD>";
result += "This class should not be considered stable. It is likely to be altered or replaced in the future.";
result += "<I>";
for (int i = 0; i < tags.length; i++) {
result += "<br/>";
result += tags[i].text();
}
return result + "</I></DD>\n";
}
/**
* Register this Taglet.
* @param tagletMap the map to register this tag to.
*/
public static void register(Map tagletMap) {
ExperimentalTaglet tag = new ExperimentalTaglet();
Taglet t = (Taglet) tagletMap.get(tag.getName());
if (t != null) {
tagletMap.remove(tag.getName());
}
tagletMap.put(tag.getName(), tag);
}
}

131
SOURCES/InternalTaglet.java Normal file
View File

@ -0,0 +1,131 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.xerces.util;
import java.util.Map;
import com.sun.javadoc.Tag;
import com.sun.tools.doclets.Taglet;
/**
* This class provides support for a 'xerces.internal' tag
* in javadoc comments. The tag creates a warning in the generated
* html for users.
*
* @author Ankit Pasricha, IBM
*/
public class InternalTaglet implements Taglet {
private static final String NAME = "xerces.internal";
private static final String HEADER = "INTERNAL:";
/* (non-Javadoc)
* @see com.sun.tools.doclets.Taglet#inConstructor()
*/
public boolean inConstructor() {
return false;
}
/* (non-Javadoc)
* @see com.sun.tools.doclets.Taglet#inField()
*/
public boolean inField() {
return false;
}
/* (non-Javadoc)
* @see com.sun.tools.doclets.Taglet#inMethod()
*/
public boolean inMethod() {
return true;
}
/* (non-Javadoc)
* @see com.sun.tools.doclets.Taglet#inOverview()
*/
public boolean inOverview() {
return true;
}
/* (non-Javadoc)
* @see com.sun.tools.doclets.Taglet#inPackage()
*/
public boolean inPackage() {
return false;
}
/* (non-Javadoc)
* @see com.sun.tools.doclets.Taglet#inType()
*/
public boolean inType() {
return true;
}
/* (non-Javadoc)
* @see com.sun.tools.doclets.Taglet#isInlineTag()
*/
public boolean isInlineTag() {
return false;
}
/* (non-Javadoc)
* @see com.sun.tools.doclets.Taglet#getName()
*/
public String getName() {
return NAME;
}
/* (non-Javadoc)
* @see com.sun.tools.doclets.Taglet#toString(com.sun.javadoc.Tag)
*/
public String toString(Tag arg0) {
return "<DT><H1 style=\"font-size:110%\">" + HEADER + "</H1><DD>"
+ "Usage of this class is not supported. It may be altered or removed at any time.<br/>"
+ "<I>" + arg0.text() + "</I></DD>\n";
}
/* (non-Javadoc)
* @see com.sun.tools.doclets.Taglet#toString(com.sun.javadoc.Tag[])
*/
public String toString(Tag[] tags) {
if (tags.length == 0) {
return null;
}
String result = "\n<DT><H1 style=\"font-size:110%\">" + HEADER + "</H1><DD>";
result += "Usage of this class is not supported. It may be altered or removed at any time.";
result += "<I>";
for (int i = 0; i < tags.length; i++) {
result += "<br/>";
result += tags[i].text();
}
return result + "</I></DD>\n";
}
/**
* Register this Taglet.
* @param tagletMap the map to register this tag to.
*/
public static void register(Map tagletMap) {
InternalTaglet tag = new InternalTaglet();
Taglet t = (Taglet) tagletMap.get(tag.getName());
if (t != null) {
tagletMap.remove(tag.getName());
}
tagletMap.put(tag.getName(), tag);
}
}

View File

@ -1,84 +0,0 @@
From: Markus Koschany <apo@debian.org>
Date: Sat, 12 May 2018 22:12:44 +0200
Subject: getContentDocument
Fix FTBFS with Java10 due to missing method getContentDocument.
Forwarded: no
---
src/org/apache/html/dom/HTMLFrameElementImpl.java | 7 +++++++
src/org/apache/html/dom/HTMLIFrameElementImpl.java | 5 +++++
src/org/apache/html/dom/HTMLObjectElementImpl.java | 5 +++++
3 files changed, 17 insertions(+)
diff --git a/src/org/apache/html/dom/HTMLFrameElementImpl.java b/src/org/apache/html/dom/HTMLFrameElementImpl.java
index 18ab953..e90a592 100644
--- a/src/org/apache/html/dom/HTMLFrameElementImpl.java
+++ b/src/org/apache/html/dom/HTMLFrameElementImpl.java
@@ -17,6 +17,8 @@
package org.apache.html.dom;
import org.w3c.dom.html.HTMLFrameElement;
+import org.w3c.dom.Document;
+
/**
* @xerces.internal
@@ -127,6 +129,11 @@ public class HTMLFrameElementImpl
setAttribute( "src", src );
}
+ public Document getContentDocument()
+ {
+ return null;
+ }
+
/**
* Constructor requires owner document.
diff --git a/src/org/apache/html/dom/HTMLIFrameElementImpl.java b/src/org/apache/html/dom/HTMLIFrameElementImpl.java
index c326557..287ba9e 100644
--- a/src/org/apache/html/dom/HTMLIFrameElementImpl.java
+++ b/src/org/apache/html/dom/HTMLIFrameElementImpl.java
@@ -17,6 +17,7 @@
package org.apache.html.dom;
import org.w3c.dom.html.HTMLIFrameElement;
+import org.w3c.dom.Document;
/**
* @xerces.internal
@@ -150,6 +151,10 @@ public class HTMLIFrameElementImpl
setAttribute( "width", width );
}
+ public Document getContentDocument()
+ {
+ return null;
+ }
/**
* Constructor requires owner document.
diff --git a/src/org/apache/html/dom/HTMLObjectElementImpl.java b/src/org/apache/html/dom/HTMLObjectElementImpl.java
index b065e69..cd27fc8 100644
--- a/src/org/apache/html/dom/HTMLObjectElementImpl.java
+++ b/src/org/apache/html/dom/HTMLObjectElementImpl.java
@@ -17,6 +17,7 @@
package org.apache.html.dom;
import org.w3c.dom.html.HTMLObjectElement;
+import org.w3c.dom.Document;
/**
* @xerces.internal
@@ -239,6 +240,10 @@ public class HTMLObjectElementImpl
setAttribute( "width", width );
}
+ public Document getContentDocument()
+ {
+ return null;
+ }
/**

View File

@ -0,0 +1,47 @@
--- src/org/apache/xerces/impl/XMLScanner.java 2013/07/03 18:25:06 1499505
+++ src/org/apache/xerces/impl/XMLScanner.java 2013/07/03 18:29:43 1499506
@@ -542,7 +542,7 @@
// document is until we scan the encoding declaration
// you cannot reliably read any characters outside
// of the ASCII range here. -- mrglavas
- String name = fEntityScanner.scanName();
+ String name = scanPseudoAttributeName();
XMLEntityManager.print(fEntityManager.getCurrentEntity());
if (name == null) {
reportFatalError("PseudoAttrNameExpected", null);
@@ -599,6 +599,35 @@
} // scanPseudoAttribute(XMLString):String
/**
+ * Scans the name of a pseudo attribute. The only legal names
+ * in XML 1.0/1.1 documents are 'version', 'encoding' and 'standalone'.
+ *
+ * @return the name of the pseudo attribute or <code>null</code>
+ * if a legal pseudo attribute name could not be scanned.
+ */
+ private String scanPseudoAttributeName() throws IOException, XNIException {
+ final int ch = fEntityScanner.peekChar();
+ switch (ch) {
+ case 'v':
+ if (fEntityScanner.skipString(fVersionSymbol)) {
+ return fVersionSymbol;
+ }
+ break;
+ case 'e':
+ if (fEntityScanner.skipString(fEncodingSymbol)) {
+ return fEncodingSymbol;
+ }
+ break;
+ case 's':
+ if (fEntityScanner.skipString(fStandaloneSymbol)) {
+ return fStandaloneSymbol;
+ }
+ break;
+ }
+ return null;
+ } // scanPseudoAttributeName()
+
+ /**
* Scans a processing instruction.
* <p>
* <pre>

View File

@ -39,7 +39,7 @@
<!-- substitute tokens as needed -->
<replace file="${build.dir}/src/org/apache/xerces/impl/Version.java"
token="@@VERSION@@" value="${parser.Name} ${parser.Version}"/>
@@ -1232,30 +1207,6 @@
@@ -1231,30 +1206,6 @@
<!-- HACK: Remove reference to XML11Configurable from SAX parser -->
<replace file="${build.dir}/src/org/apache/xerces/parsers/AbstractSAXParser.java"
token="return (fConfiguration instanceof XML11Configurable);" value="return false;"/>

View File

@ -13,5 +13,5 @@
+Require-Bundle: system.bundle,javax.xml;visibility:=reexport, org.apache.xml.resolver;bundle-version="[1.2.0,2.0.0)";visibility:=reexport,org.apache.xml.serializer;bundle-version="[2.7.1,3.0.0)"
+Export-Package: META-INF.services;version="@impl.version@",org.apache.html.dom;version="@impl.version@",org.apache.wml;version="@impl.version@",org.apache.wml.dom;version="@impl.version@",org.apache.xerces.dom;version="@impl.version@",org.apache.xerces.dom.events;version="@impl.version@",org.apache.xerces.dom3.as;version="@impl.version@",org.apache.xerces.impl;version="@impl.version@",org.apache.xerces.impl.dtd;version="@impl.version@",org.apache.xerces.impl.dtd.models;version="@impl.version@",org.apache.xerces.impl.dv;version="@impl.version@",org.apache.xerces.impl.dv.dtd;version="@impl.version@",org.apache.xerces.impl.dv.util;version="@impl.version@",org.apache.xerces.impl.dv.xs;version="@impl.version@",org.apache.xerces.impl.io;version="@impl.version@",org.apache.xerces.impl.msg;version="@impl.version@",org.apache.xerces.impl.validation;version="@impl.version@",org.apache.xerces.impl.xpath;version="@impl.version@",org.apache.xerces.impl.xpath.regex;version="@impl.version@",org.apache.xerces.impl.xs;version="@impl.version@",org.apache.xerces.impl.xs.identity;version="@impl.version@",org.apache.xerces.impl.xs.models;version="@impl.version@",org.apache.xerces.impl.xs.opti;version="@impl.version@",org.apache.xerces.impl.xs.traversers;version="@impl.version@",org.apache.xerces.impl.xs.util;version="@impl.version@",org.apache.xerces.jaxp;version="@impl.version@",org.apache.xerces.jaxp.datatype;version="@impl.version@",org.apache.xerces.jaxp.validation;version="@impl.version@",org.apache.xerces.parsers;version="@impl.version@",org.apache.xerces.stax;version="@impl.version@",org.apache.xerces.stax.events;version="@impl.version@",org.apache.xerces.util;version="@impl.version@",org.apache.xerces.xinclude;version="@impl.version@",org.apache.xerces.xni;version="@impl.version@",org.apache.xerces.xni.grammars;version="@impl.version@",org.apache.xerces.xni.parser;version="@impl.version@",org.apache.xerces.xpointer;version="@impl.version@",org.apache.xerces.xs;version="@impl.version@",org.apache.xerces.xs.datatypes;version="@impl.version@",org.apache.xml.serialize;version="@impl.version@",org.w3c.dom.html;version="@impl.version@"
Name: org/apache/xerces/impl/
Name: org/apache/xerces/impl/Version.class
Comment: @impl.name@

View File

@ -1,10 +1,10 @@
%global cvs_version 2_12_0
%global cvs_version 2_11_0
%define __requires_exclude system.bundle
Name: xerces-j2
Version: 2.12.0
Release: 4%{?dist}
Version: 2.11.0
Release: 34%{?dist}
Summary: Java XML parser
# Most of the source is ASL 2.0
# W3C licensed files:
@ -22,6 +22,10 @@ Source12: %{name}-constants.1
# Custom javac ant task used by the build
Source3: https://svn.apache.org/repos/asf/xerces/java/tags/Xerces-J_%{cvs_version}/tools/src/XJavac.java
# Custom doclet tags used in javadocs
Source5: https://svn.apache.org/repos/asf/xerces/java/tags/Xerces-J_%{cvs_version}/tools/src/ExperimentalTaglet.java
Source6: https://svn.apache.org/repos/asf/xerces/java/tags/Xerces-J_%{cvs_version}/tools/src/InternalTaglet.java
Source7: %{name}-pom.xml
# Patch the build so that it doesn't try to use bundled xml-commons source
@ -30,8 +34,9 @@ Patch0: %{name}-build.patch
# Patch the manifest so that it includes OSGi stuff
Patch1: %{name}-manifest.patch
# Fix FTBFS with Java10 due to missing method getContentDocument
Patch2: https://sources.debian.org/data/main/libx/libxerces2-java/2.12.0-1/debian/patches/getContentDocument.patch
# Backported fix from upstream http://svn.apache.org/viewvc?view=revision&revision=1499506
# See https://bugzilla.redhat.com/show_bug.cgi?id=1140031
Patch2: xerces-j2-CVE-2013-4002.patch
BuildArch: noarch
@ -52,10 +57,13 @@ Requires: javapackages-tools
Provides: jaxp_parser_impl = 1.4
Provides: %{name}-scripts = %{version}-%{release}
Obsoletes: %{name}-scripts < 2.11.0-6
# This documentation is provided by xml-commons-apis
Obsoletes: %{name}-javadoc-apis < %{version}-%{release}
# http://mail-archives.apache.org/mod_mbox/xerces-j-dev/201008.mbox/%3COF8D7E2F83.0271A181-ON8525777F.00528302-8525777F.0054BBE0@ca.ibm.com%3E
Obsoletes: %{name}-manual < %{version}-%{release}
%description
Welcome to the future! Xerces2 is the next generation of high performance,
@ -84,6 +92,18 @@ also handles name spaces according to the XML Namespaces 1.1 Recommendation,
and will correctly serialize XML 1.1 documents if the DOM level 3 load/save
APIs are in use.
%package javadoc
Summary: Javadocs for %{name}
# Consolidating all javadocs into one package
Obsoletes: %{name}-javadoc-impl < %{version}-%{release}
Obsoletes: %{name}-javadoc-xs < %{version}-%{release}
Obsoletes: %{name}-javadoc-xni < %{version}-%{release}
Obsoletes: %{name}-javadoc-other < %{version}-%{release}
%description javadoc
This package contains the API documentation for %{name}.
%package demo
Summary: Demonstrations and samples for %{name}
Requires: %{name} = %{version}-%{release}
@ -95,12 +115,12 @@ Requires: %{name} = %{version}-%{release}
%setup -q -n xerces-%{cvs_version}
%patch0 -p0 -b .orig
%patch1 -p0 -b .orig
%patch2 -p1
%patch2 -p0 -b .orig
# Copy the custom ant tasks into place
mkdir -p tools/org/apache/xerces/util
mkdir -p tools/bin
cp -a %{SOURCE3} tools/org/apache/xerces/util
cp -a %{SOURCE3} %{SOURCE5} %{SOURCE6} tools/org/apache/xerces/util
# Make sure upstream hasn't sneaked in any jars we don't know about
find -name '*.class' -exec rm -f '{}' \;
@ -119,6 +139,10 @@ pushd tools
javac -classpath $(build-classpath ant) org/apache/xerces/util/XJavac.java
jar cf bin/xjavac.jar org/apache/xerces/util/XJavac.class
# Build custom doc taglets
javac -classpath /usr/lib/jvm/java/lib/tools.jar org/apache/xerces/util/*Taglet.java
jar cf bin/xerces2taglets.jar org/apache/xerces/util/*Taglet.class
ln -sf $(build-classpath xalan-j2-serializer) serializer.jar
ln -sf $(build-classpath xml-commons-apis) xml-apis.jar
ln -sf $(build-classpath xml-commons-resolver) resolver.jar
@ -126,16 +150,28 @@ ln -sf $(build-classpath xerces-j2) x.jar
popd
# Build everything
export ANT_OPTS="-Xmx256m -Djava.awt.headless=true -Dbuild.sysclasspath=first -Ddisconnected=true"
ant -Djavac.source=1.6 -Djavac.target=1.6 \
export ANT_OPTS="-Xmx256m -Djava.endorsed.dirs=$(pwd)/tools -Djava.awt.headless=true -Dbuild.sysclasspath=first -Ddisconnected=true"
ant -Djavac.source=1.5 -Djavac.target=1.5 \
-Dbuild.compiler=modern \
clean jars
clean jars javadocs
%mvn_artifact %{SOURCE7} build/xercesImpl.jar
%install
%mvn_install
# javadoc
mkdir -p %{buildroot}%{_javadocdir}/%{name}
mkdir -p %{buildroot}%{_javadocdir}/%{name}/impl
mkdir -p %{buildroot}%{_javadocdir}/%{name}/xs
mkdir -p %{buildroot}%{_javadocdir}/%{name}/xni
mkdir -p %{buildroot}%{_javadocdir}/%{name}/other
cp -pr build/docs/javadocs/xerces2/* %{buildroot}%{_javadocdir}/%{name}/impl
cp -pr build/docs/javadocs/api/* %{buildroot}%{_javadocdir}/%{name}/xs
cp -pr build/docs/javadocs/xni/* %{buildroot}%{_javadocdir}/%{name}/xni
cp -pr build/docs/javadocs/other/* %{buildroot}%{_javadocdir}/%{name}/other
# scripts
install -pD -m755 -T %{SOURCE1} %{buildroot}%{_bindir}/%{name}-version
install -pD -m755 -T %{SOURCE2} %{buildroot}%{_bindir}/%{name}-constants
@ -160,22 +196,13 @@ ln -sf %{name}.jar %{_javadir}/jaxp_parser_impl.jar
%{_bindir}/*
%{_mandir}/*/*
%files javadoc
%{_javadocdir}/%{name}
%files demo
%{_datadir}/%{name}
%changelog
* Tue Nov 05 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 2.12.0-4
- Mass rebuild for javapackages-tools 201902
* Fri May 24 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 2.12.0-3
- Mass rebuild for javapackages-tools 201901
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.12.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Mon Nov 19 2018 Marian Koncek <mkoncek@redhat.com> - 2.12.0-1
- Update to upstream version 2.12.0
* Fri Aug 03 2018 Michael Simacek <msimacek@redhat.com> - 2.11.0-34
- Fix license tag to include W3C