[apache-commons-chain] Initial import (#826955)

gil gil at fedoraproject.org
Wed Jun 6 13:45:11 UTC 2012


commit 68a55241c6d94026b7c7ef0ab011a097b9e6d190
Author: gil <puntogil at libero.it>
Date:   Wed Jun 6 13:47:12 2012 +0200

    Initial import (#826955)

 .gitignore                               |    1 +
 apache-commons-chain-1.2-pom.patch       |   13 +++
 apache-commons-chain-1.2-portlet20.patch |   66 ++++++++++++++++
 apache-commons-chain-1.2-servlet30.patch |   20 +++++
 apache-commons-chain.spec                |  125 ++++++++++++++++++++++++++++++
 sources                                  |    1 +
 6 files changed, 226 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..2ab3e58 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/commons-chain-1.2-src.tar.gz
diff --git a/apache-commons-chain-1.2-pom.patch b/apache-commons-chain-1.2-pom.patch
new file mode 100644
index 0000000..a424759
--- /dev/null
+++ b/apache-commons-chain-1.2-pom.patch
@@ -0,0 +1,13 @@
+--- pom.xml	2008-05-29 18:43:21.000000000 +0200
++++ pom.xml-gil	2012-05-26 17:18:56.893517572 +0200
+@@ -154,8 +154,8 @@
+         </dependency>
+ 
+         <dependency>
+-            <groupId>myfaces</groupId>
+-            <artifactId>myfaces-api</artifactId>
++            <groupId>org.jboss.spec.javax.faces</groupId>
++            <artifactId>jboss-jsf-api_2.1_spec</artifactId>
+             <version>1.1.0</version>
+             <optional>true</optional>
+             <exclusions>
diff --git a/apache-commons-chain-1.2-portlet20.patch b/apache-commons-chain-1.2-portlet20.patch
new file mode 100644
index 0000000..4456e92
--- /dev/null
+++ b/apache-commons-chain-1.2-portlet20.patch
@@ -0,0 +1,66 @@
+diff -Nru src/test/org/apache/commons/chain/web/portlet/MockPortletContext.java src/test/org/apache/commons/chain/web/portlet-gil/MockPortletContext.java
+--- src/test/org/apache/commons/chain/web/portlet/MockPortletContext.java	2008-05-29 18:43:14.000000000 +0200
++++ src/test/org/apache/commons/chain/web/portlet-gil/MockPortletContext.java	2012-05-26 17:40:42.000000000 +0200
+@@ -135,4 +135,9 @@
+         attributes.put(name, value);
+     }
+ 
++    public Enumeration<String> getContainerRuntimeOptions() {
++        // TODO
++        throw new UnsupportedOperationException("Not supported.");
++    }
++
+ }
+diff -Nru src/test/org/apache/commons/chain/web/portlet/MockPortletRequest.java src/test/org/apache/commons/chain/web/portlet-gil/MockPortletRequest.java
+--- src/test/org/apache/commons/chain/web/portlet/MockPortletRequest.java	2008-05-29 18:43:14.000000000 +0200
++++ src/test/org/apache/commons/chain/web/portlet-gil/MockPortletRequest.java	2012-05-26 18:10:29.000000000 +0200
+@@ -27,6 +27,7 @@
+ import javax.portlet.PortletMode;
+ import javax.portlet.PortletPreferences;
+ import javax.portlet.WindowState;
++import javax.servlet.http.Cookie;
+ import java.security.Principal;
+ import java.util.Map;
+ import java.util.HashMap;
+@@ -312,4 +313,24 @@
+         }
+     }
+ 
++    public Map<String, String[]> getPublicParameterMap() {
++        // TODO
++        throw new UnsupportedOperationException("Not supported.");
++    }
++
++    public Map<String, String[]> getPrivateParameterMap() {
++        // TODO
++        throw new UnsupportedOperationException("Not supported.");
++    }
++
++    public Cookie[] getCookies() {
++        // TODO
++        throw new UnsupportedOperationException("Not supported.");
++    }
++
++    public String getWindowID() {
++        // TODO
++        throw new UnsupportedOperationException("Not supported.");
++    }
++
+ }
+diff -Nru src/test/org/apache/commons/chain/web/portlet/MockPortletSession.java src/test/org/apache/commons/chain/web/portlet-gil/MockPortletSession.java
+--- src/test/org/apache/commons/chain/web/portlet/MockPortletSession.java	2008-05-29 18:43:14.000000000 +0200
++++ src/test/org/apache/commons/chain/web/portlet-gil/MockPortletSession.java	2012-05-26 17:44:41.000000000 +0200
+@@ -172,4 +172,13 @@
+         }
+     }
+ 
++    public Map<String, Object> getAttributeMap(int scope) {
++        // TODO
++        throw new UnsupportedOperationException("Not supported.");
++    }
++
++    public Map<String, Object> getAttributeMap() {
++        // TODO
++        throw new UnsupportedOperationException("Not supported.");
++    }
+ }
diff --git a/apache-commons-chain-1.2-servlet30.patch b/apache-commons-chain-1.2-servlet30.patch
new file mode 100644
index 0000000..2930ecf
--- /dev/null
+++ b/apache-commons-chain-1.2-servlet30.patch
@@ -0,0 +1,20 @@
+--- src/test/org/apache/commons/chain/web/servlet/MockServletContext.java	2008-05-29 18:43:13.000000000 +0200
++++ src/test/org/apache/commons/chain/web/servlet/MockServletContext.java-gil	2012-05-26 17:56:07.670501581 +0200
+@@ -26,6 +26,7 @@
+ import org.apache.commons.logging.LogFactory;
+ 
+ import java.io.InputStream;
++import java.lang.UnsupportedOperationException;
+ import java.net.MalformedURLException;
+ import java.net.URL;
+ import java.util.Enumeration;
+@@ -149,5 +150,9 @@
+         attributes.put(name, value);
+     }
+ 
++    public String getContextPath() {
++        // TODO
++        throw new UnsupportedOperationException("Not supported.");
++    }
+ 
+ }
diff --git a/apache-commons-chain.spec b/apache-commons-chain.spec
new file mode 100644
index 0000000..2d18309
--- /dev/null
+++ b/apache-commons-chain.spec
@@ -0,0 +1,125 @@
+%global base_name chain
+%global short_name commons-%{base_name}
+Name:          apache-commons-chain
+Version:       1.2
+Release:       2%{?dist}
+Summary:       An implementation of the GoF Chain of Responsibility pattern
+Group:         Development/Libraries
+License:       ASL 2.0
+URL:           http://commons.apache.org/%{base_name}/
+Source0:       ftp://ftp.gbnet.net/pub/apache/dist/commons/%{base_name}/source/%{short_name}-%{version}-src.tar.gz
+# replace myfaces-api with jboss-jsf-2.1-api
+Patch0:        %{name}-%{version}-pom.patch
+# javax.servlet 3.0 api support
+Patch1:        %{name}-%{version}-servlet30.patch
+# javax.portlet 2.0 api support
+Patch2:        %{name}-%{version}-portlet20.patch
+
+BuildRequires: java-devel
+BuildRequires: jpackage-utils
+
+BuildRequires: apache-commons-beanutils
+BuildRequires: apache-commons-digester
+BuildRequires: apache-commons-logging
+BuildRequires: jboss-jsf-2.1-api
+BuildRequires: portlet-2.0-api
+BuildRequires: tomcat-servlet-3.0-api
+
+# test deps
+BuildRequires: junit
+
+BuildRequires: maven
+BuildRequires: maven-antrun-plugin
+BuildRequires: maven-compiler-plugin
+BuildRequires: maven-install-plugin
+BuildRequires: maven-jar-plugin
+BuildRequires: maven-javadoc-plugin
+BuildRequires: maven-plugin-bundle
+BuildRequires: maven-resources-plugin
+BuildRequires: maven-site-plugin
+BuildRequires: maven-surefire-plugin
+
+Requires:      apache-commons-beanutils
+Requires:      apache-commons-digester
+Requires:      apache-commons-logging
+Requires:      jboss-jsf-2.1-api
+Requires:      portlet-2.0-api
+Requires:      tomcat-servlet-3.0-api
+
+Requires:      java
+Requires:      jpackage-utils
+BuildArch:     noarch
+
+%description
+A popular technique for organizing the execution of complex
+processing flows is the "Chain of Responsibility" pattern, as
+described (among many other places) in the classic "Gang of Four"
+design patterns book. Although the fundamental API contracts
+required to implement this design pattern are extremely simple,
+it is useful to have a base API that facilitates using the pattern,
+and (more importantly) encouraging composition of command
+implementations from multiple diverse sources.
+Towards that end, the Chain API models a computation as a series
+of "commands" that can be combined into a "chain". The API for a
+command consists of a single method (execute()), which is passed
+a "context" parameter containing the dynamic state of the
+computation, and whose return value is a boolean that determines
+whether or not processing for the current chain has been completed
+(true), or whether processing should be delegated to the next
+command in the chain (false).
+
+%package javadoc
+Group:         Documentation
+Summary:       Javadoc for %{name}
+Requires:      jpackage-utils
+
+%description javadoc
+This package contains javadoc for %{name}.
+
+%prep
+%setup -q -n %{short_name}-%{version}-src
+find . -name '*.class' -delete
+find . -name '*.jar' -delete
+
+perl -pi -e 's/\r$//g;' *.txt
+%patch0 -p0
+%patch1 -p0
+%patch2 -p0
+# Failed tests:   testDefaut(org.apache.commons.chain.config.ConfigParserTestCase): Correct command count expected:<17> but was:<19>
+rm -r src/test/org/apache/commons/chain/config/ConfigParserTestCase.java
+
+%build
+
+mvn-rpmbuild -Dmaven.compile.source=1.5 -Dmaven.compile.target=1.5 install javadoc:aggregate
+
+%install
+
+mkdir -p %{buildroot}%{_javadir}
+install -m 644 target/%{short_name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
+( cd %{buildroot}%{_javadir} && ln -s %{name}.jar %{short_name}.jar )
+
+mkdir -p %{buildroot}%{_mavenpomdir}
+install -m 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{short_name}.pom
+%add_maven_depmap JPP-%{short_name}.pom %{short_name}.jar
+
+mkdir -p %{buildroot}%{_javadocdir}/%{name}
+cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}
+
+%files
+%{_javadir}/%{name}.jar
+%{_javadir}/%{short_name}.jar
+%{_mavenpomdir}/JPP-%{short_name}.pom
+%{_mavendepmapfragdir}/%{name}
+%doc LICENSE.txt NOTICE.txt RELEASE-NOTES.txt
+
+%files javadoc
+%{_javadocdir}/%{name}
+%doc LICENSE.txt NOTICE.txt
+
+%changelog
+* Tue Jun 05 2012 gil cattaneo <puntogil at libero.it> 1.2-2
+- NOTICE.txt file installed along with javadoc package
+
+* Thu Apr 19 2012 gil cattaneo <puntogil at libero.it> 1.2-1
+- initial rpm
+
diff --git a/sources b/sources
index e69de29..2ccccdd 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+a94fef07630d88c859fb8397ddbcb6ba  commons-chain-1.2-src.tar.gz


More information about the scm-commits mailing list