Merge with upstream version Natively compile packages

This commit is contained in:
Matt Wringe 2006-07-23 21:52:46 +00:00
parent 9f41f983c3
commit 08dabf2b16
9 changed files with 532 additions and 69 deletions

View File

@ -1,4 +1,2 @@
bcel-5.1-src.tar.gz
bcel-5.1
noarch
*.src.rpm
bcel-5.1-src-RHCLEAN.tar.gz
jakarta-site2.tar.gz

49
bcel-5.1-build.patch Normal file
View File

@ -0,0 +1,49 @@
--- bcel-5.1/src/java/org/apache/bcel/verifier/statics/Pass2Verifier.java~ 2004-10-16 15:06:59.231184305 -0400
+++ bcel-5.1/src/java/org/apache/bcel/verifier/statics/Pass2Verifier.java 2004-10-16 15:07:47.577200177 -0400
@@ -345,7 +345,7 @@
for (int i=0; i<atts.length; i++){
if ((! (atts[i] instanceof SourceFile)) &&
- (! (atts[i] instanceof Deprecated)) &&
+ (! (atts[i] instanceof org.apache.bcel.classfile.Deprecated)) &&
(! (atts[i] instanceof InnerClasses)) &&
(! (atts[i] instanceof Synthetic))){
addMessage("Attribute '"+tostring(atts[i])+"' as an attribute of the ClassFile structure '"+tostring(obj)+"' is unknown and will therefore be ignored.");
@@ -519,7 +519,7 @@
for (int i=0; i<atts.length; i++){
if ((! (atts[i] instanceof ConstantValue)) &&
(! (atts[i] instanceof Synthetic)) &&
- (! (atts[i] instanceof Deprecated))){
+ (! (atts[i] instanceof org.apache.bcel.classfile.Deprecated))){
addMessage("Attribute '"+tostring(atts[i])+"' as an attribute of Field '"+tostring(obj)+"' is unknown and will therefore be ignored.");
}
if (! (atts[i] instanceof ConstantValue)){
@@ -660,7 +660,7 @@
if ((! (atts[i] instanceof Code)) &&
(! (atts[i] instanceof ExceptionTable)) &&
(! (atts[i] instanceof Synthetic)) &&
- (! (atts[i] instanceof Deprecated))){
+ (! (atts[i] instanceof org.apache.bcel.classfile.Deprecated))){
addMessage("Attribute '"+tostring(atts[i])+"' as an attribute of Method '"+tostring(obj)+"' is unknown and will therefore be ignored.");
}
if ((! (atts[i] instanceof Code)) &&
@@ -702,7 +702,7 @@
addMessage("SourceFile attribute '"+tostring(obj)+"' has a funny name: remember not to confuse certain parsers working on javap's output. Also, this name ('"+sourcefilename+"') is considered an unqualified (simple) file name only.");
}
}
- public void visitDeprecated(Deprecated obj){//vmspec2 4.7.10
+ public void visitDeprecated(org.apache.bcel.classfile.Deprecated obj){//vmspec2 4.7.10
checkIndex(obj, obj.getNameIndex(), CONST_Utf8);
String name = ((ConstantUtf8) cp.getConstant(obj.getNameIndex())).getBytes();
--- bcel-5.1/src/java/org/apache/bcel/verifier/statics/StringRepresentation.java~ 2004-10-16 15:09:58.664972664 -0400
+++ bcel-5.1/src/java/org/apache/bcel/verifier/statics/StringRepresentation.java 2004-10-16 15:10:15.874842037 -0400
@@ -172,7 +172,7 @@
public void visitConstantValue(ConstantValue obj){
tostring = toString(obj);
}
- public void visitDeprecated(Deprecated obj){
+ public void visitDeprecated(org.apache.bcel.classfile.Deprecated obj){
tostring = toString(obj);
}
public void visitExceptionTable(ExceptionTable obj){

16
bcel-5.1-jpp-depmap.xml Normal file
View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<depset>
<dependency>
<maven>
<groupId>regexp</groupId>
<artifactId>regexp</artifactId>
<version>1.2</version>
</maven>
<jpp>
<groupId>JPP</groupId>
<artifactId>regexp</artifactId>
<jar>regexp.jar</jar>
<version>1.2</version>
</jpp>
</dependency>
</depset>

View File

@ -0,0 +1,33 @@
--- project.xml.sav 2003-04-25 10:25:37.000000000 +0200
+++ project.xml 2006-04-11 16:23:12.000000000 +0200
@@ -21,7 +21,6 @@
</description>
<url>http://jakarta.apache.org/bcel/</url>
- <cvsWebUrl>http://cvs.apache.org/viewcvs/jakarta-bcel/</cvsWebUrl>
<siteAddress>jakarta.apache.org</siteAddress>
<siteDirectory>/www/jakarta.apache.org/bcel/</siteDirectory>
@@ -73,22 +72,7 @@
<build>
<sourceDirectory>src/java</sourceDirectory>
- <aspectSourceDirectory/>
- <testSourceDirectory>src/java</testSourceDirectory>
- <!-- Unit test classes -->
- <unitTestPatterns>
- <unitTestPattern>exclude = **/*.class</unitTestPattern>
- </unitTestPatterns>
-
- <!-- J A R R E S O U R C E S -->
- <!-- Resources that are packaged up inside the JAR file -->
-
- <jarResources>
- </jarResources>
-
- <jars>
- </jars>
</build>
</project>

288
bcel.spec
View File

@ -1,26 +1,93 @@
%define name bcel
%define version 5.1
%define release 1jpp_8fc
# Copyright (c) 2000-2005, JPackage Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the
# distribution.
# 3. Neither the name of the JPackage Project nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#For fedora, we want a native gcj compilation
%define _with_gcj_support 1
#Fedora currently does not support maven
%define _without_maven 1
%define gcj_support %{?_with_gcj_support:1}%{!?_with_gcj_support:%{?_without_gcj_support:0}%{!?_without_gcj_support:%{?_gcj_support:%{_gcj_support}}%{!?_gcj_support:0}}}
# If you don't want to build with maven, and use straight ant instead,
# give rpmbuild option '--without maven'
%define with_maven %{!?_without_maven:1}%{?_without_maven:0}
%define without_maven %{?_without_maven:1}%{!?_without_maven:0}
%define section free
Name: %{name}
Version: %{version}
Release: %{release}
Name: bcel
Version: 5.1
Release: 7jpp_1fc
Epoch: 0
Summary: Byte Code Engineering Library
License: Apache Software License
Source0: http://jakarta.apache.org/builds/jakarta-bcel/release/v5.1/bcel-5.1-src.tar.gz
Source0: bcel-5.1-src-RHCLEAN.tar.gz
# svn export https://svn.apache.org/repos/asf/jakarta/bcel/tags/BCEL_5_1
Source1: pom-maven2jpp-depcat.xsl
Source2: pom-maven2jpp-newdepmap.xsl
Source3: pom-maven2jpp-mapdeps.xsl
Source4: bcel-5.1-jpp-depmap.xml
Source5: jakarta-site2.tar.gz
Patch0: bcel-5.1-build.patch
Patch1: bcel-5.1-project_xml.patch
URL: http://jakarta.apache.org/%{name}/
Group: Development/Libraries/Java
#Vendor: JPackage Project
#Distribution: JPackage
Requires: regexp
BuildRequires: ant
%if %{with_maven}
BuildRequires: maven >= 0:1.1
BuildRequires: saxon
BuildRequires: saxon-scripts
%endif
#excalibur-avalong-logkit should be used once Maven is supported in Fedora
BuildRequires: avalon-logkit
#BuildRequires: excalibur-avalon-logkit
BuildRequires: jakarta-commons-collections
BuildRequires: jdom
BuildRequires: velocity
BuildRequires: regexp
BuildRequires: jpackage-utils >= 0:1.5
BuildRequires: jpackage-utils >= 0:1.6
BuildRequires: werken.xpath
%if ! %{gcj_support}
BuildArch: noarch
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
%if %{gcj_support}
BuildRequires: java-gcj-compat-devel
Requires(post): java-gcj-compat
Requires(postun): java-gcj-compat
%endif
%description
The Byte Code Engineering Library (formerly known as JavaClass) is
intended to give users a convenient possibility to analyze, create, and
@ -40,110 +107,203 @@ being the Xalan XSLT processor at Apache.
%package javadoc
Summary: Javadoc for %{name}
Group: Development/Documentation
Prereq: coreutils
%description javadoc
Javadoc for %{name}.
%{summary}.
%if 0
%package manual
Summary: Manual for %{name}
Group: Development/Libraries/Java
%description manual
Documentation for %{name}.
%endif
%{summary}.
%prep
%setup -q
%package demo
Summary: Examples for %{name}
Group: Development/Libraries/Java
%description demo
%{summary}.
#%prep
#cat <<EOT
#
# If you dont want to build with maven,
# give rpmbuild option '--without maven'
#
#EOT
%setup -q -n BCEL_5_1
# remove all binary libs
find . -name "*.jar" -exec rm -f {} \;
#find . -name "*.jar" -exec rm -f {} \;
for j in $(find . -name "*.jar"); do
mv $j $j.no
done
gzip -dc %{SOURCE5} | tar xf -
mkdir jakarta-site2/lib
pushd jakarta-site2/lib/
build-jar-repository -s -p . jdom
build-jar-repository -s -p . velocity
build-jar-repository -s -p . commons-collections
build-jar-repository -s -p . avalon-logkit
build-jar-repository -s -p . werken.xpath
popd
pushd lib
ln -sf $(build-classpath regexp) Regexp.jar
popd
%patch0 -p1
%patch1 -b .sav
# very broken build
perl -p -i -e 's| depends=\"examples\"||g;' build.xml
touch manifest.txt
%build
export CLASSPATH=%(build-classpath regexp)
ant -Dbuild.dest=./build -Dbuild.dir=./build -Dname=%{name} compile
ant -Dbuild.dest=./build -Dbuild.dir=./build -Dname=%{name} jar
ant -Dbuild.dest=./build -Dbuild.dir=./build -Dname=%{name} apidocs
%if %{with_maven}
export DEPCAT=$(pwd)/bcel-5.1-depcat.new.xml
echo '<?xml version="1.0" standalone="yes"?>' > $DEPCAT
echo '<depset>' >> $DEPCAT
for p in $(find . -name project.xml); do
pushd $(dirname $p)
/usr/bin/saxon project.xml %{SOURCE1} >> $DEPCAT
popd
done
echo >> $DEPCAT
echo '</depset>' >> $DEPCAT
/usr/bin/saxon $DEPCAT %{SOURCE2} > bcel-5.1-depmap.new.xml
for p in $(find . -name project.xml); do
pushd $(dirname $p)
cp project.xml project.xml.orig
/usr/bin/saxon -o project.xml project.xml.orig %{SOURCE3} map=%{SOURCE4}
popd
done
export MAVEN_HOME_LOCAL=$(pwd)/.maven
maven \
-Dmaven.repo.remote=file:/usr/share/maven/repository \
-Dmaven.home.local=${MAVEN_HOME_LOCAL} \
jar:jar javadoc:generate xdoc:transform
%else
ant -d -Dbuild.dest=build/classes -Dbuild.dir=build \
-Ddocs.src=xdocs -Djakarta.site2=jakarta-site2 -Djdom.jar=jdom.jar \
compile jar apidocs xdocs
%endif
%install
# jars
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
install -m 644 build/%{name}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}-%{version}.jar
(cd $RPM_BUILD_ROOT%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
%__mkdir_p %{buildroot}%{_javadir}
%if %{with_maven}
%__install -m 644 target/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
%else
%__install -m 644 build/%{name}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
%endif
(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do %__ln_s ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
# javadoc
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
cp -pr docs/api/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
rm -rf docs/api
%__mkdir_p %{buildroot}%{_javadocdir}/%{name}-%{version}
%if %{with_maven}
%__cp -pr target/docs/apidocs/* %{buildroot}%{_javadocdir}/%{name}-%{version}
%__rm -rf target/docs/apidocs
%else
%__cp -pr docs/api/* %{buildroot}%{_javadocdir}/%{name}-%{version}
%__rm -rf docs/api
%endif
# samples
%__mkdir_p %{buildroot}%{_datadir}/%{name}-%{version}
%__cp -pr examples/* %{buildroot}%{_datadir}/%{name}-%{version}
# manual
%__mkdir_p %{buildroot}%{_docdir}/%{name}-%{version}
%if %{with_maven}
%__cp -pr target/docs/* %{buildroot}%{_docdir}/%{name}-%{version}
%else
%__cp -pr docs/* %{buildroot}%{_docdir}/%{name}-%{version}
%endif
%if %{gcj_support}
%{_bindir}/aot-compile-rpm
%endif
%clean
rm -rf $RPM_BUILD_ROOT
%pre
rm -f %{_javadir}/bcel.jar
%__rm -rf %{buildroot}
%post javadoc
rm -f %{_javadocdir}/%{name}
ln -s %{name}-%{version} %{_javadocdir}/%{name}
%__rm -f %{_javadocdir}/%{name}
%__ln_s %{name}-%{version} %{_javadocdir}/%{name}
%postun javadoc
if [ "$1" = "0" ]; then
rm -f %{_javadocdir}/%{name}
%__rm -f %{_javadocdir}/%{name}
fi
%post
%if %{gcj_support}
if [ -x %{_bindir}/rebuild-gcj-db ]
then
%{_bindir}/rebuild-gcj-db
fi
%endif
%postun
%if %{gcj_support}
if [ -x %{_bindir}/rebuild-gcj-db ]
then
%{_bindir}/rebuild-gcj-db
fi
%endif
%files
%defattr(0644,root,root,0755)
%doc LICENSE.txt
%{_javadir}/*
%if %{gcj_support}
%attr(-,root,root) %{_libdir}/gcj/%{name}/bcel-5.1.jar.*
%endif
%files javadoc
%defattr(0644,root,root,0755)
%{_javadocdir}/%{name}-%{version}
%if 0
%files manual
%defattr(0644,root,root,0755)
%doc docs/*
%endif
%doc %{_docdir}/%{name}-%{version}
%files demo
%defattr(0644,root,root,0755)
%{_datadir}/%{name}-%{version}
# -----------------------------------------------------------------------------
%changelog
* Sat Jul 22 2006 Jakub Jelinek <jakub@redhat.com> - 0:5.1-1jpp_8fc
- Rebuilt
* Thu Jul 20 2006 Matt Wringe <mwringe at redhat.com> 0:5.1-7jpp_1fc
- Merged with upstream version
- set to build with Ant instead of Maven
* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 0:5.1-1jpp_7fc
- rebuild
* Thu Jul 20 2006 Matt Wringe <mwringe at redhat.com> 0:5.1-7jpp
- Add missing werken.xpath to the build requires
- Added conditional native compilation
- Changed spec file encoding from ISO-8859-1 to UTF-8
* Mon Mar 6 2006 Jeremy Katz <katzj@redhat.com> - 0:5.1-1jpp_6fc
- stop the scriptlet spew
* Tue Apr 11 2006 Ralph Apel <r.apel@r-apel.de> 0:5.1-6jpp
- First JPP-1.7 release
- Use tidyed sources from svn
- Add resources to build the manual
- Add examples to -demo subpackage
- Build with maven by default
- Add option to build with straight ant
* Wed Dec 21 2005 Jesse Keating <jkeating@redhat.com> - 0:5.1-1jpp_5fc
- rebuilt again
* Fri Nov 19 2004 David Walluck <david@jpackage.org> 0:5.1-5jpp
- rebuild to fix packager
* Tue Dec 13 2005 Jesse Keating <jkeating@redhat.com>
- rebuilt for new gcj
* Sat Nov 06 2004 David Walluck <david@jpackage.org> 0:5.1-4jpp
- rebuild with javac 1.4.2
* Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com>
- rebuilt
* Sat Oct 16 2004 David Walluck <david@jpackage.org> 0:5.1-3jpp
- rebuild for JPackage 1.6
* Tue Nov 8 2005 Vadim Nasardinov <vadimn@redhat.com> - 0:5.1-1jpp_4fc
- Converted from ISO-8859-1 to UTF-8
* Tue Jan 11 2005 Gary Benson <gbenson@redhat.com> 0:5.1-1jpp_4fc
- Reenable building of classes that require javax.swing (#130006).
* Thu Nov 4 2004 Gary Benson <gbenson@redhat.com> 0:5.1-1jpp_3fc
- Build into Fedora.
* Fri Mar 26 2004 Frank Ch. Eigler <fche@redhat.com> 0:5.1-1jpp_2rh
- add RHUG upgrade cleanup
* Thu Mar 4 2004 Frank Ch. Eigler <fche@redhat.com> 0:5.1-1jpp_1rh
- RH vacuuming
* Fri Aug 20 2004 Ralph Apel <r.apel at r-apel.de> 0:5.1-2jpp
- Build with ant-1.6.2
* Sun May 11 2003 David Walluck <david@anti-microsoft.org> 0:5.1-1jpp
- 5.1

109
pom-maven2jpp-depcat.xsl Normal file
View File

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="*[name() != 'dependencies']|*/text()">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="//dependencies">
<xsl:for-each select="./dependency">
<xsl:element name="dependency">
<xsl:element name="maven">
<xsl:choose>
<xsl:when test="./groupId">
<xsl:copy-of select="./groupId"/>
<xsl:copy-of select="./artifactId"/>
</xsl:when>
<xsl:when test="./id">
<xsl:choose>
<xsl:when test="substring-before(./id/text(),':') != ''">
<xsl:element name="groupId">
<xsl:value-of select="substring-before(./id/text(),':')"/>
</xsl:element>
<xsl:element name="artifactId">
<xsl:value-of select="substring-after(./id/text(),':')"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:element name="groupId">
<xsl:value-of select="./id/text()"/>
</xsl:element>
<xsl:element name="artifactId">
<xsl:value-of select="./id/text()"/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
ERROR
</xsl:otherwise>
</xsl:choose>
<xsl:for-each select="./*">
<xsl:if test="(name() != 'groupId') and (name() != 'artifactId') and (name() != 'id')">
<xsl:copy-of select="."/>
</xsl:if>
</xsl:for-each>
</xsl:element>
<xsl:element name="jpp">
<xsl:element name="groupId">JPP</xsl:element>
<xsl:choose>
<xsl:when test="./artifactId">
<xsl:copy-of select="./artifactId"/>
</xsl:when>
<xsl:when test="./id">
<xsl:choose>
<xsl:when test="substring-after(./id/text(),':') != ''">
<xsl:element name="artifactId">
<xsl:value-of select="substring-after(./id/text(),':')"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:element name="artifactId">
<xsl:value-of select="./id/text()"/>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
ERROR
</xsl:otherwise>
</xsl:choose>
<xsl:element name="jar">
<xsl:choose>
<xsl:when test="./artifactId">
<xsl:value-of select="./artifactId/text()"/>
</xsl:when>
<xsl:when test="./id">
<xsl:choose>
<xsl:when test="substring-after(./id/text(),':') != ''">
<xsl:value-of select="substring-after(./id/text(),':')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="./id/text()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
ERROR
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="./type">
<xsl:choose>
<xsl:when test="./type/text() = 'plugin'">.jar</xsl:when>
<xsl:otherwise>.<xsl:value-of select="./type/text()"/></xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>.jar</xsl:otherwise>
</xsl:choose>
</xsl:element>
<xsl:for-each select="./*">
<xsl:if test="(name() != 'groupId') and (name() != 'artifactId') and (name() != 'id')">
<xsl:copy-of select="."/>
</xsl:if>
</xsl:for-each>
</xsl:element>
</xsl:element>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

74
pom-maven2jpp-mapdeps.xsl Normal file
View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="map" />
<xsl:output method="xml" indent="yes" omit-xml-declaration="no"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/project" >
<xsl:element name="project">
<xsl:copy-of select="child::*[not(self::dependencies)]"/>
<xsl:if test="not(./dependencies)">
<xsl:element name="dependencies">
<xsl:for-each select="document($map)//add/dependency">
<xsl:copy-of select="."/>
</xsl:for-each>
</xsl:element>
</xsl:if>
<xsl:apply-templates select="dependencies"/>
</xsl:element>
</xsl:template>
<xsl:template match="dependencies" >
<xsl:element name="dependencies">
<xsl:for-each select="dependency">
<xsl:if test="./artifactId">
<xsl:call-template name="replace">
<xsl:with-param name="artifact" select="./artifactId/text()"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="./id">
<xsl:choose>
<xsl:when test="substring-after(./id/text(),':') != ''">
<xsl:call-template name="replace">
<xsl:with-param name="artifact" select="substring-after(./id/text(),':')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="replace">
<xsl:with-param name="artifact" select="./id/text()"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:for-each>
<xsl:for-each select="document($map)//add/dependency">
<xsl:copy-of select="."/>
</xsl:for-each>
</xsl:element>
</xsl:template>
<xsl:template name="replace">
<xsl:param name="artifact"/>
<xsl:variable name="this" select="."/>
<xsl:element name="dependency">
<xsl:choose>
<xsl:when test="document($map)//dependency/maven[./artifactId/text() = $artifact]">
<xsl:for-each select="document($map)//dependency/maven[./artifactId/text() = $artifact][1]">
<xsl:copy-of select="../jpp/*"/>
<xsl:copy-of select="$this/properties"/>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="./*"/>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
<xsl:if test="document($map)//dependency/maven[./artifactId/text() = $artifact]">
<xsl:for-each select="document($map)//dependency/maven[./artifactId/text() = $artifact][1]">
<xsl:for-each select="../add/dependency">
<xsl:element name="dependency">
<xsl:copy-of select="./*"/>
<xsl:copy-of select="$this/properties"/>
</xsl:element>
</xsl:for-each>
</xsl:for-each>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:saxon="http://icl.com/saxon"
extension-element-prefixes="saxon">
<xsl:output method="xml" indent="yes" omit-xml-declaration="no"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/" >
<xsl:element name="depset">
<saxon:group select="//dependency" group-by="./maven/artifactId">
<xsl:sort select="./maven/artifactId"/>
<xsl:element name="dependency">
<xsl:element name="maven">
<xsl:copy-of select="./maven/*[name() != 'properties']"/>
</xsl:element>
<xsl:element name="jpp">
<xsl:copy-of select="./jpp/*[name() != 'properties']"/>
</xsl:element>
</xsl:element>
<saxon:item/>
</saxon:group>
</xsl:element>
</xsl:template>
</xsl:stylesheet>

View File

@ -1 +1,2 @@
c9ebfa7373eb4416e590205fd0005039 bcel-5.1-src.tar.gz
67e0be2f572e10516061b6903a713ed9 bcel-5.1-src-RHCLEAN.tar.gz
2c511b30e00109b501c6f3bd757a1ce1 jakarta-site2.tar.gz