package init

This commit is contained in:
sherlock2010 2020-02-17 20:46:10 +08:00
parent 7b43c6d206
commit c740ca779d
13 changed files with 797 additions and 0 deletions

131
ExperimentalTaglet.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.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
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);
}
}

151
XJavac.java Normal file
View File

@ -0,0 +1,151 @@
/*
* 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 org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.util.JavaEnvUtils;
import org.apache.tools.ant.taskdefs.Javac;
import java.lang.StringBuffer;
import java.util.Properties;
import java.util.Locale;
/**
* The implementation of the javac compiler for JDK 1.4 and above
*
* The purpose of this task is to diagnose whether we're
* running on a 1.4 or above JVM; if we are, to
* set up the bootclasspath such that the build will
* succeed; if we aren't, then invoke the Javac12
* task.
*
* @author Neil Graham, IBM
*/
public class XJavac extends Javac {
/**
* Run the compilation.
*
* @exception BuildException if the compilation has problems.
*/
public void execute() throws BuildException {
if(isJDK14OrHigher()) {
// maybe the right one; check vendor:
// by checking system properties:
Properties props = null;
try {
props = System.getProperties();
} catch (Exception e) {
throw new BuildException("unable to determine java vendor because could not access system properties!");
}
// this is supposed to be provided by all JVM's from time immemorial
String vendor = ((String)props.get("java.vendor")).toUpperCase(Locale.ENGLISH);
if (vendor.indexOf("IBM") >= 0) {
// we're on an IBM 1.4 or higher; fiddle with the bootclasspath.
setBootclasspath(createIBMJDKBootclasspath());
}
// need to do special things for Sun too and also
// for Apple, HP, FreeBSD, SableVM, Kaffe and Blackdown: a Linux port of Sun Java
else if( (vendor.indexOf("SUN") >= 0) ||
(vendor.indexOf("BLACKDOWN") >= 0) ||
(vendor.indexOf("APPLE") >= 0) ||
(vendor.indexOf("HEWLETT-PACKARD") >= 0) ||
(vendor.indexOf("KAFFE") >= 0) ||
(vendor.indexOf("SABLE") >= 0) ||
(vendor.indexOf("FREEBSD") >= 0)) {
// we're on an SUN 1.4 or higher; fiddle with the bootclasspath.
// since we can't eviscerate XML-related info here,
// we must use the classpath
Path bcp = createBootclasspath();
Path clPath = getClasspath();
bcp.append(clPath);
String currBCP = (String)props.get("sun.boot.class.path");
Path currBCPath = new Path(null);
currBCPath.createPathElement().setPath(currBCP);
bcp.append(currBCPath);
setBootclasspath(bcp);
}
}
// now just do the normal thing:
super.execute();
}
/**
* Creates bootclasspath for IBM JDK 1.4 and above.
*/
private Path createIBMJDKBootclasspath() {
Path bcp = createBootclasspath();
String javaHome = System.getProperty("java.home");
StringBuffer bcpMember = new StringBuffer();
bcpMember.append(javaHome).append("/lib/charsets.jar:");
bcp.createPathElement().setPath(bcpMember.toString());
bcpMember.replace(javaHome.length(), bcpMember.length(), "/lib/core.jar:");
bcp.createPathElement().setPath(bcpMember.toString());
bcpMember.replace(javaHome.length(), bcpMember.length(), "/lib/vm.jar:");
bcp.createPathElement().setPath(bcpMember.toString());
bcpMember.replace(javaHome.length(), bcpMember.length(), "/lib/java.util.jar:");
bcp.createPathElement().setPath(bcpMember.toString());
bcpMember.replace(javaHome.length(), bcpMember.length(), "/lib/rt.jar:");
bcp.createPathElement().setPath(bcpMember.toString());
bcpMember.replace(javaHome.length(), bcpMember.length(), "/lib/graphics.jar:");
bcp.createPathElement().setPath(bcpMember.toString());
bcpMember.replace(javaHome.length(), bcpMember.length(), "/lib/javaws.jar:");
bcp.createPathElement().setPath(bcpMember.toString());
bcpMember.replace(javaHome.length(), bcpMember.length(), "/lib/jaws.jar:");
bcp.createPathElement().setPath(bcpMember.toString());
bcpMember.replace(javaHome.length(), bcpMember.length(), "/lib/security.jar:");
bcp.createPathElement().setPath(bcpMember.toString());
bcpMember.replace(javaHome.length(), bcpMember.length(), "/lib/server.jar:");
bcp.createPathElement().setPath(bcpMember.toString());
bcpMember.replace(javaHome.length(), bcpMember.length(), "/lib/ext/JawBridge.jar:");
bcp.createPathElement().setPath(bcpMember.toString());
bcpMember.replace(javaHome.length(), bcpMember.length(), "/lib/ext/gskikm.jar:");
bcp.createPathElement().setPath(bcpMember.toString());
bcpMember.replace(javaHome.length(), bcpMember.length(), "/lib/ext/ibmjceprovider.jar:");
bcp.createPathElement().setPath(bcpMember.toString());
bcpMember.replace(javaHome.length(), bcpMember.length(), "/lib/ext/indicim.jar:");
bcp.createPathElement().setPath(bcpMember.toString());
bcpMember.replace(javaHome.length(), bcpMember.length(), "/lib/ext/jaccess.jar:");
bcp.createPathElement().setPath(bcpMember.toString());
bcpMember.replace(javaHome.length(), bcpMember.length(), "/lib/ext/ldapsec.jar:");
bcp.createPathElement().setPath(bcpMember.toString());
bcpMember.replace(javaHome.length(), bcpMember.length(), "/lib/ext/oldcertpath.jar");
bcp.createPathElement().setPath(bcpMember.toString());
return bcp;
}
/**
* Checks whether the JDK version is 1.4 or higher. If it's not
* JDK 1.4 we check whether we're on a future JDK by checking
* that we're not on JDKs 1.0, 1.1, 1.2 or 1.3. This check by
* exclusion should future proof this task from new versions of
* Ant which are aware of higher JDK versions.
*
* @return true if the JDK version is 1.4 or higher.
*/
private boolean isJDK14OrHigher() {
final String version = JavaEnvUtils.getJavaVersion();
return version.equals(JavaEnvUtils.JAVA_1_4) ||
(!version.equals(JavaEnvUtils.JAVA_1_3) &&
!version.equals(JavaEnvUtils.JAVA_1_2) &&
!version.equals(JavaEnvUtils.JAVA_1_1) &&
!version.equals(JavaEnvUtils.JAVA_1_0));
}
}

BIN
Xerces-J-src.2.11.0.tar.gz Normal file

Binary file not shown.

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>

72
xerces-j2-build.patch Normal file
View File

@ -0,0 +1,72 @@
--- build.xml.orig 2010-11-26 20:42:11.000000000 +0000
+++ build.xml 2010-12-11 19:20:35.913500731 +0000
@@ -108,7 +108,6 @@
<property name="distsrc.dir" value="${build.dir}/${parser.shortname}-${parser_version}"/>
<property name="disttools.dir" value="${build.dir}/tools"/>
<property name="distbin.dir" value="${build.dir}/${parser.shortname}-${parser_version}"/>
- <property name='src.apis.zip' value="${tools.dir}/xml-commons-external-src.zip"/>
<filter token="year" value="${year}"/>
<filter token="version" value="${parser.Version}"/>
@@ -247,30 +246,6 @@
<copy file="${src.dir}/org/apache/xerces/impl/xpath/regex/message.properties"
tofile="${build.src}/org/apache/xerces/impl/xpath/regex/message_en.properties"/>
- <!-- now deal with API's: -->
- <unzip src="${src.apis.zip}" dest="${build.src}">
- <patternset
- includes="org/xml/sax/**
- javax/xml/**
- javax/xml/datatype/**
- javax/xml/namespace/**
- javax/xml/parsers/**
- javax/xml/stream/**
- javax/xml/transform/**
- javax/xml/validation/**
- javax/xml/xpath/**
- org/w3c/dom/*
- org/w3c/dom/bootstrap/**
- org/w3c/dom/events/**
- org/w3c/dom/html/**
- org/w3c/dom/ls/**
- org/w3c/dom/ranges/**
- org/w3c/dom/traversal/**
- org/w3c/dom/views/**
- org/w3c/dom/xpath/**"
- />
- </unzip>
-
<!-- substitute tokens as needed -->
<replace file="${build.dir}/src/org/apache/xerces/impl/Version.java"
token="@@VERSION@@" value="${parser.Name} ${parser.Version}"/>
@@ -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;"/>
-
- <!-- now deal with API's: -->
- <unzip src="${src.apis.zip}" dest="${build.src}">
- <patternset
- includes="org/xml/sax/**
- javax/xml/**
- javax/xml/datatype/**
- javax/xml/namespace/**
- javax/xml/parsers/**
- javax/xml/stream/**
- javax/xml/transform/**
- javax/xml/validation/**
- javax/xml/xpath/**
- org/w3c/dom/*
- org/w3c/dom/bootstrap/**
- org/w3c/dom/events/**
- org/w3c/dom/html/**
- org/w3c/dom/ls/**
- org/w3c/dom/ranges/**
- org/w3c/dom/traversal/**
- org/w3c/dom/views/**
- org/w3c/dom/xpath/**"
- />
- </unzip>
<!-- substitute tokens as needed -->

12
xerces-j2-constants.1 Normal file
View File

@ -0,0 +1,12 @@
.TH XERCES-J2-CONSTANTS 1 "08 April 2013" "xerces-2.11.0" "User commands"
.SH NAME
xerces-j2-constants \- display constants used by Xerces2 Java Parser
.SH SYNOPSIS
.BR xerces-j2-constants
.SH DESCRIPTION
Xerces-J2-Constants dumps common constants used by Xerces2 Java Parser
to standard output.

20
xerces-j2-constants.sh Normal file
View File

@ -0,0 +1,20 @@
#!/bin/sh
#
# Xerces-J2 constants script
# JPackage Project (http://www.jpackage.org/)
# $Id: xerces-j2-constants.sh,v 1.3 2005/05/26 14:21:22 gbenson Exp $
# Source functions library
. /usr/share/java-utils/java-functions
# Configuration
MAIN_CLASS=org.apache.xerces.impl.Constants
# Set parameters
set_jvm
export CLASSPATH=$(build-classpath xerces-j2)
set_flags $BASE_FLAGS
set_options $BASE_OPTIONS
# Let's start
run "$@"

17
xerces-j2-manifest.patch Normal file
View File

@ -0,0 +1,17 @@
--- src/manifest.xerces.orig 2010-11-26 22:42:07.000000000 +0200
+++ src/manifest.xerces 2012-12-17 11:11:52.200392844 +0200
@@ -1,5 +1,14 @@
Manifest-Version: 1.0
Created-By: @java.version@ (@java.vendor@)
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-SymbolicName: org.apache.xerces
+Bundle-ManifestVersion: 2
+Bundle-Name: @impl.name@
+Bundle-Localization: plugin
+Bundle-Version: @impl.version@
+Bundle-Vendor: Apache Software Foundation
+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/Version.class
Comment: @impl.name@

48
xerces-j2-pom.xml Normal file
View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
<version>4</version>
</parent>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.11.0</version>
<name>Xerces2 Java Parser</name>
<description>
Xerces2 is the next generation of high performance, fully compliant XML parsers in the
Apache Xerces family. This new version of Xerces introduces the Xerces Native Interface (XNI),
a complete framework for building parser components and configurations that is extremely
modular and easy to program.
</description>
<url>http://xerces.apache.org/xerces2-j</url>
<dependencies>
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>1.4.01</version>
</dependency>
<dependency>
<groupId>xml-resolver</groupId>
<artifactId>xml-resolver</artifactId>
<version>1.2</version>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
</build>
</project>

12
xerces-j2-version.1 Normal file
View File

@ -0,0 +1,12 @@
.TH XERCES-J2-VERSION 1 "08 April 2013" "xerces-2.11.0" "User commands"
.SH NAME
xerces-j2-version \- display version of Xerces2 Java Parser
.SH SYNOPSIS
.BR xerces-j2-version
.SH DESCRIPTION
Xerces-J2-Version prints version of Xerces2 Java Parser to standard
output.

20
xerces-j2-version.sh Normal file
View File

@ -0,0 +1,20 @@
#!/bin/sh
#
# Xerces-J2 version script
# JPackage Project (http://www.jpackage.org/)
# $Id: xerces-j2-version.sh,v 1.3 2005/05/26 14:21:22 gbenson Exp $
# Source functions library
. /usr/share/java-utils/java-functions
# Configuration
MAIN_CLASS=org.apache.xerces.impl.Version
# Set parameters
set_jvm
export CLASSPATH=$(build-classpath xerces-j2)
set_flags $BASE_FLAGS
set_options $BASE_OPTIONS
# Let's start
run "$@"

136
xerces-j2.spec Normal file
View File

@ -0,0 +1,136 @@
Name: xerces-j2
Version: 2.11.0
Release: 36
Summary: Java XML parser
License: ASL 2.0 and W3C
URL: http://xerces.apache.org/xerces2-j/
Source0: http://archive.apache.org/dist/xerces/j/Xerces-J-src.%{version}.tar.gz
Source1: %{name}-version.sh
Source2: %{name}-constants.sh
Source11: %{name}-version.1
Source12: %{name}-constants.1
Source3: https://svn.apache.org/repos/asf/xerces/java/tags/Xerces-J_2_11_0/tools/src/XJavac.java
Source5: https://svn.apache.org/repos/asf/xerces/java/tags/Xerces-J_2_11_0/tools/src/ExperimentalTaglet.java
Source6: https://svn.apache.org/repos/asf/xerces/java/tags/Xerces-J_2_11_0/tools/src/InternalTaglet.java
Source7: %{name}-pom.xml
Patch0: %{name}-build.patch
Patch1: %{name}-manifest.patch
Patch2: xerces-j2-CVE-2013-4002.patch
BuildRequires: javapackages-local ant apache-parent xalan-j2 >= 2.7.1
BuildRequires: xml-commons-apis >= 1.4.01 xml-commons-resolver >= 1.2
Requires: xalan-j2 >= 2.7.1 xml-commons-resolver >= 1.2
Requires: xml-commons-apis >= 1.4.01 javapackages-tools
Provides: jaxp_parser_impl = 1.4
Provides: %{name}-scripts = %{version}-%{release}
Obsoletes: %{name}-scripts < 2.11.0-6
Obsoletes: %{name}-javadoc-apis < %{version}-%{release}
Obsoletes: %{name}-manual < %{version}-%{release}
Provides: %{name}-demo = %{version}-%{release}
Obsoletes: %{name}-demo < %{version}-%{release}
BuildArch: noarch
%description
Welcome to the future! Xerces2 is the next generation of high
performance, fully compliant XML parsers in the Apache Xerces family.
This new version of Xerces introduces the Xerces Native Interface (XNI),
a complete framework for building parser components and configurations
that is extremely modular and easy to program.
The Apache Xerces2 parser is the reference implementation of XNI but
other parser components, configurations, and parsers can be written
using the Xerces Native Interface. For complete design and
implementation documents, refer to the XNI Manual.
Xerces 2 is a fully conforming XML Schema processor. For more
information, refer to the XML Schema page.
Xerces 2 also provides a partial implementation of Document Object Model
Level 3 Core, Load and Save and Abstract Schemas [deprecated] Working
Drafts. For more information, refer to the DOM Level 3 Implementation
page.
%package help
Summary: Documents for %{name}
Buildarch: noarch
Requires: man info
Provides: %{name}-javadoc = %{version}-%{release}
Obsoletes: %{name}-javadoc < %{version}-%{release}
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 help
Man pages and other related documents for %{name}.
%prep
%autosetup -p0 -n xerces-2_11_0
install -d tools/org/apache/xerces/util
install -d tools/bin
cp -a %{SOURCE3} %{SOURCE5} %{SOURCE6} tools/org/apache/xerces/util
find -name '*.class' -exec rm -f '{}' \;
find -name '*.jar' -exec rm -f '{}' \;
sed -i 's/\r//' LICENSE README NOTICE
%mvn_alias : xerces:xerces xerces:xmlParserAPIs apache:%{name}
%mvn_file : %{name} jaxp_parser_impl
%build
pushd tools
javac -classpath $(build-classpath ant) org/apache/xerces/util/XJavac.java
jar cf bin/xjavac.jar org/apache/xerces/util/XJavac.class
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
ln -sf $(build-classpath %{name}) x.jar
popd
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 javadocs
%mvn_artifact %{SOURCE7} build/xercesImpl.jar
%install
%mvn_install
install -d $RPM_BUILD_ROOT%{_javadocdir}/%{name}
install -d $RPM_BUILD_ROOT%{_javadocdir}/%{name}/impl
install -d $RPM_BUILD_ROOT%{_javadocdir}/%{name}/xs
install -d $RPM_BUILD_ROOT%{_javadocdir}/%{name}/xni
install -d $RPM_BUILD_ROOT%{_javadocdir}/%{name}/other
cp -pr build/docs/javadocs/xerces2/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}/impl
cp -pr build/docs/javadocs/api/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}/xs
cp -pr build/docs/javadocs/xni/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}/xni
cp -pr build/docs/javadocs/other/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}/other
install -pD -m755 -T %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/%{name}-version
install -pD -m755 -T %{SOURCE2} $RPM_BUILD_ROOT%{_bindir}/%{name}-constants
install -d -m 755 $RPM_BUILD_ROOT%{_mandir}/man1
install -p -m 644 %{SOURCE11} $RPM_BUILD_ROOT%{_mandir}/man1
install -p -m 644 %{SOURCE12} $RPM_BUILD_ROOT%{_mandir}/man1
install -pD -T build/xercesSamples.jar $RPM_BUILD_ROOT%{_datadir}/%{name}/%{name}-samples.jar
cp -pr data $RPM_BUILD_ROOT%{_datadir}/%{name}
%post
update-alternatives --remove jaxp_parser_impl %{_javadir}/%{name}.jar >/dev/null 2>&1 || :
ln -sf %{name}.jar %{_javadir}/jaxp_parser_impl.jar
%files -f .mfiles
%doc LICENSE
%{_bindir}/*
%{_datadir}/%{name}
%files help
%doc NOTICE README
%{_javadocdir}/%{name}
%{_mandir}/*/*
%changelog
* Mon Feb 17 2020 zhouyihang<zhouyihang1@huawei.com> - 2.11.0-36
- Package init