Remove the tools tarball

This commit is contained in:
gbenson 2005-06-10 09:53:42 +00:00
parent 0d3f76f411
commit c0e4fcf3df
5 changed files with 154 additions and 14 deletions

View File

@ -1,6 +1,5 @@
Xerces-J-src.2.6.2.tar.gz
Xerces-J-tools.2.6.2.tar.gz
XJavac.java
xml-commons-external-1.2.01-src.zip
xerces-2_6_2
i386
*.src.rpm

135
XJavac.java Normal file
View File

@ -0,0 +1,135 @@
/*
* Copyright 2001-2005 The Apache Software Foundation.
*
* Licensed 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 IBM JDK 1.4
*
* The purpose of this task is to diagnose whether we're
* running on an IBM 1.4 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; fiddle with the bootclasspath.
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/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());
setBootclasspath(bcp);
}
// need to do special things for Sun too and also
// for Apple, HP 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)) {
// we're on an SUN 1.4; 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();
}
/**
* 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));
}
}

View File

@ -1,3 +1,2 @@
cfd536b8d72f8ebe3465ae35f5e3775d Xerces-J-src.2.6.2.tar.gz
55ba4b71ae95acf7d50c4bc0d796ee76 Xerces-J-tools.2.6.2.tar.gz
166f59c462cda808ca20f16e1690699f XJavac.java
47fda4da12a26e95d3f2273a55d29581 xml-commons-external-1.2.01-src.zip

View File

@ -6,7 +6,7 @@
<!-- enable compilation under IBM JDK 1.4 -->
- <taskdef name="xjavac" classname="org.apache.xerces.util.XJavac"/>
+ <taskdef name="xjavac" classname="org.apache.xerces.util.XJavac"
+ classpath="./tools/bin/xjavac.jar"/>
+ classpath="./tools/xjavac.jar"/>
<!-- Allow properties following these statements to be overridden -->
<!-- Note that all of these don't have to exist. They've just been defined

View File

@ -15,16 +15,17 @@ Group: Text Processing/Markup/XML
Source0: http://www.apache.org/dist/xml/xerces-j/Xerces-J-src.%{version}.tar.gz
Source1: %{name}-version.sh
Source2: %{name}-constants.sh
Source3: http://archive.apache.org/dist/xml/xerces-j/Xerces-J-tools.%{version}.tar.gz
Patch0: %{name}-build.patch
Patch1: %{name}-bz152255.patch
Source3: XJavac.java
Source4: xml-commons-external-1.2.01-src.zip
Patch0: %{name}-build.patch
Patch1: %{name}-bz152255.patch
Provides: jaxp_parser_impl
Requires: xml-commons-apis
Requires: xml-commons-resolver
Requires: /usr/sbin/update-alternatives
BuildRequires: java-devel
BuildRequires: ant >= 0:1.5
BuildRequires: jpackage-utils >= 0:1.5
#BuildRequires: jikes
BuildRequires: jaxp_parser_impl
BuildRequires: xml-commons-resolver
BuildRequires: xml-commons-apis
@ -113,16 +114,19 @@ Additional utility scripts for %{name}.
%prep
%setup -q -n xerces-%{cvs_version}
%setup -q -T -a 3 -D -n xerces-%{cvs_version}
%setup -T -D -n xerces-%{cvs_version}
%patch0 -p1 -b .build
%patch1 -p1 -b .bz152255
# clean jar files
find -name "*.jar" | sed '/\/xjavac\.jar$/d' | xargs rm -f
mkdir -p tools/org/apache/xerces/util
cp -a %{SOURCE3} tools/org/apache/xerces/util
cp -a %{SOURCE4} tools
%build
pushd tools
find -name '*.java' | xargs javac -cp $(build-classpath ant)
find -name '*.class' | xargs jar cf xjavac.jar
popd
unset CLASSPATH
ant \
-Dbuild.compiler=modern \
@ -286,6 +290,9 @@ update-alternatives --install %{_javadir}/jaxp_parser_impl.jar \
%changelog
* Fri Jun 10 2005 Gary Benson <gbenson@redhat.com>
- Remove the tools tarball, and build xjavac from source.
* Thu May 26 2005 Gary Benson <gbenson@redhat.com> 0:2.6.2-4jpp_7fc
- Rearrange how BC-compiled stuff is built and installed.