Update to new version; remove logkit dependency; add maven metadata

This commit is contained in:
mef 2010-01-15 14:50:53 +00:00
parent 063989aeeb
commit d7b1567aed
2 changed files with 83 additions and 74 deletions

View File

@ -1,46 +1,29 @@
--- velocity-1.4/src/java/org/apache/velocity/test/VelocityServletTest.java~ 2004-04-14 13:26:41.000000000 +0100
+++ velocity-1.4/src/java/org/apache/velocity/test/VelocityServletTest.java 2005-06-06 11:54:53.000000000 +0100
@@ -22,6 +22,7 @@
import java.net.URL;
import java.util.Enumeration;
import java.util.Properties;
+import java.util.Set;
import javax.servlet.RequestDispatcher;
import javax.servlet.Servlet;
import javax.servlet.ServletConfig;
@@ -237,6 +238,16 @@
--- velocity-1.6.3/src/test/org/apache/velocity/test/VelocityServletTestCase.java 2009-12-07 23:41:27.000000000 +0000
+++ velocity-1.6.3.mef/src/test/org/apache/velocity/test/VelocityServletTestCase.java 2010-01-15 13:03:56.465905895 +0000
@@ -250,6 +250,11 @@
public void setAttribute(String name, Object value)
{
}
+
+ public Set getResourcePaths(String path)
+ {
+ return null;
+ }
+
+ public String getServletContextName()
+ {
+ return null;
+ }
+ public Set getResourcePath(String path)
+ {
+ return null;
+ }
}
static class MockHttpServletResponse implements HttpServletResponse
@@ -391,5 +402,18 @@
@@ -408,5 +413,14 @@
public void setStatus(int i , String s)
{
}
+
+ public void setCharacterEncoding(String charset)
+ {
+ }
+
+ public String getContentType()
+ {
+ return null;
+ }
+
+ public void resetBuffer()
+ public void setCharacterEncoding(String charset)
+ {
+ }
+
+ public String getContentType()
+ {
+ return null;
+ }
}
}

View File

@ -32,24 +32,22 @@
Name: velocity
Version: 1.4
Release: 10.5%{?dist}
Version: 1.6.3
Release: 1
Epoch: 0
Summary: Java-based template engine
License: ASL 2.0
Source: http://archive.apache.org/dist/velocity/engine/1.4/velocity-1.4.tar.gz
Patch0: velocity-AnakiaJDOMFactory-jdom-DefaultJDOMFactory.patch
Patch1: velocity-AnakiaTask-jdom-XMLOutputter.patch
Patch2: velocity-servletapi5.patch
#Disable failure-on-tests rather than not running tests.
Patch3: velocity-build-testcases.patch
#Patch3: velocity-notexentests.patch
# Renames all "enum" variables to "enumer" because "enum" is a reserved word in java >= 1.5
# Not upstreamed, package outdated.
Patch4: velocity-enum.patch
Source0: http://www.apache.org/dist/%{name}/engine/%{version}/%{name}-%{version}.tar.gz
Source1: http://repo1.maven.org/maven2/org/apache/%{name}/%{name}/%{version}/%{name}-%{version}.pom
Patch0: velocity-remove-avalon-logkit.patch
Patch1: velocity-use-system-jars.patch
Patch2: velocity-servletapi5.patch
Patch3: velocity-cleanup-pom.patch
URL: http://velocity.apache.org/
Group: Development/Libraries
Requires: jakarta-commons-collections
Requires: jakarta-commons-logging
Requires: jakarta-commons-lang
# Use servletapi5 instead of servletapi3
Requires: servletapi5
Requires: oro
@ -57,22 +55,27 @@ Requires: werken-xpath
Requires: jdom >= 0:1.0-1
Requires: bcel
Requires: log4j >= 0:1.1
#FIXME replace with excalibur-avalon-logkit when available
Requires: avalon-logkit
Requires(post): jpackage-utils
Requires(postun): jpackage-utils
BuildRequires: werken-xpath
BuildRequires: ant
BuildRequires: antlr
BuildRequires: junit
BuildRequires: ant-junit
BuildRequires: hsqldb
BuildRequires: jakarta-commons-collections
BuildRequires: jakarta-commons-logging
BuildRequires: jakarta-commons-lang
# Use servletapi5 instead of servletapi3
BuildRequires: servletapi5
BuildRequires: oro
BuildRequires: jdom >= 0:1.0-1
BuildRequires: bcel
BuildRequires: log4j >= 0:1.1
#FIXME replace with excalibur-avalon-logkit when available
BuildRequires: avalon-logkit
BuildRequires: jpackage-utils >= 0:1.6
# It fails one of the arithmetic test cases with gcj
BuildRequires: java-devel >= 1:1.6.0
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
@ -123,36 +126,42 @@ Demonstrations and samples for %{name}.
%prep
%setup -q -n %{name}-%{version}
# Remove all binary libs used in compiling the package.
# Note that velocity has some jar files containing macros under
# examples and test that should not be removed.
find build -name '*.jar' -exec rm -f \{\} \;
%patch0 -b .sav
%patch1 -b .sav
# Remove dependency on avalon-logkit
rm -f src/java/org/apache/velocity/runtime/log/AvalonLogChute.java
rm -f src/java/org/apache/velocity/runtime/log/AvalonLogSystem.java
rm -f src/java/org/apache/velocity/runtime/log/VelocityFormatter.java
%patch0 -p1
# Use system jars instead of downloading
%patch1 -p1
#Apply patch to remove explicit dependency on servletapi3
%patch2 -p1
# Remove (unavailable) parent reference and avalon-logkit from POM
cp %{SOURCE1} ./pom.xml
%patch3 -p1
%patch4 -p1
# -----------------------------------------------------------------------------
%build
# Use servletapi5 instead of servletapi3 in CLASSPATH
#FIXME Replace avalon-logkit with excalibur-avalon-logkit when ready
export CLASSPATH=$(build-classpath \
antlr \
jakarta-commons-collections \
jakarta-commons-lang \
jakarta-commons-logging \
servletapi5 \
avalon-logkit \
junit \
oro \
log4j \
jdom \
bcel \
werken.xpath)
werken.xpath \
hsqldb \
junit)
ant \
-buildfile build/build.xml \
-Djunit.jar=%{_javadir}/junit.jar \
-Dbuild.sysclasspath=first \
jar javadocs test
@ -175,8 +184,18 @@ rm -rf docs/api
install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/%{name}
cp -pr convert examples test $RPM_BUILD_ROOT%{_datadir}/%{name}
# Maven metadata
install -pD -T -m 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
%add_to_maven_depmap org.apache.velocity %{name} %{version} JPP %{name}
# -----------------------------------------------------------------------------
%post
%update_maven_depmap
%postun
%update_maven_depmap
%clean
rm -rf $RPM_BUILD_ROOT
@ -186,6 +205,8 @@ rm -rf $RPM_BUILD_ROOT
%defattr(0644,root,root,0755)
%doc LICENSE NOTICE README.txt
%{_javadir}/*.jar
%{_mavendepmapfragdir}/*
%{_mavenpomdir}/*
%files manual
%defattr(0644,root,root,0755)
@ -200,6 +221,11 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/%{name}
%changelog
* Fri Jan 15 2010 Mary Ellen Foster <mefoster at gmail.com> 0:1.6.3-1
- Update to 1.6.3
- Remove dependency on avalon-logkit
- Add maven metadata and pom
* Sun Jan 10 2010 Alexander Kurtakov <akurtako@redhat.com> 0:1.4-10.5
- Drop gcj_support.
- Fix groups and url.