Name: oscache Version: 2.4.1 Release: 1%{?dist} Summary: High performance J2EE caching solution Group: Development/Libraries License: ASL 2.0 Url: https://bitbucket.org/opensymphony/oscache/ # svn export http://svn.opensymphony.com/svn/oscache/tags/v2_4_1 oscache-2.4.1 # find oscache-2.4.1 -name '*.jar' -delete # find oscache-2.4.1 -name '*.class' -delete # find oscache-2.4.1 -name '*.bat' -delete # tar czf oscache-2.4.1-src-svn.tar.gz oscache-2.4.1 Source0: %{name}-%{version}-src-svn.tar.gz # force jgroups212 and tomcat 7.x apis Source1: %{name}-%{version}-depmap # disable groboutils test Patch0: %{name}-%{version}-no-groboutils.patch # add iunit 4 support Patch1: %{name}-%{version}-test.patch BuildRequires: java-devel BuildRequires: jpackage-utils BuildRequires: apache-commons-logging BuildRequires: geronimo-jms BuildRequires: hibernate3 BuildRequires: jgroups212 BuildRequires: tomcat-jsp-2.2-api BuildRequires: tomcat-servlet-3.0-api # test deps BuildRequires: httpunit BuildRequires: junit BuildRequires: junitperf BuildRequires: maven BuildRequires: maven-compiler-plugin #BuildRequires: maven-idea-plugin BuildRequires: maven-jar-plugin BuildRequires: maven-javadoc-plugin #BuildRequires: maven-plugin-cobertura BuildRequires: maven-resources-plugin #BuildRequires: maven-site-plugin BuildRequires: maven-source-plugin BuildRequires: maven-surefire-plugin BuildRequires: maven-surefire-provider-junit4 Requires: apache-commons-logging Requires: geronimo-jms # Requires: hibernate3 Requires: jgroups212 Requires: tomcat-jsp-2.2-api Requires: tomcat-servlet-3.0-api Requires: java Requires: jpackage-utils BuildArch: noarch %description OSCache solves fundamental problems for dynamic websites: + Caching Dynamic Content - Dynamic content must often be executed in some form each request, but sometimes that content doesn't change every request. Caching the whole page does not help because sections of the page change every request. OSCache solves this problem by providing a means to cache sections of JSP pages. + Caching Binary Content - Generated images and PDFs can be very costly in terms of server load. OSCache solves this problem through a Servlet 2.3 CachingFilter which can cache any URI (such as an entire page or a generated image/PDF) + Error Tolerance - If one error occurs somewhere on your dynamic page, chances are the whole page will be returned as an error, even if 95%% of the page executed correctly. OSCache solves this problem by allowing you to serve the cached content in the event of an error, and then reporting the error appropriately. %package javadoc Group: Documentation Summary: API documentation for %{name} Requires: jpackage-utils %description javadoc This package contains API documentation for %{name}. %prep %setup -q # req GroboUtils rm src/test/java/com/opensymphony/oscache/base/TestConcurrency2.java %patch0 -p1 %patch1 -p0 sed -i "s|1.4|1.5|" pom.xml sed -i "s|1.4|1.5|" pom.xml sed -i "s|hibernate|hibernate-core|" pom.xml sed -i "s|jgroups|org.jgroups|" pom.xml sed -i "s|jgroups-all|jgroups|" pom.xml sed -i "s|pom.url|project.url|" pom.xml %pom_remove_dep groboutils:groboutils-core %pom_xpath_inject "pom:project/pom:dependencies" " org.apache.tomcat tomcat-jsp-api 7.0.27 " . #[ERROR] /home/gil/rpmbuild/BUILD/oscache-2.4.1/src/test/java/com/opensymphony/oscache/base/events/TestCompleteEvents.java:[38,24] error: unreported exception Exception; must be caught or declared to be thrown #compile: # [javac] /home/gil/rpmbuild/BUILD/oscache-2.4.1/build.xml:81: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds # [javac] Compiling 65 source files to /home/gil/rpmbuild/BUILD/oscache-2.4.1/build/java # [javac] warning: [options] bootstrap class path not set in conjunction with -source 1.5 # [javac] /home/gil/rpmbuild/BUILD/oscache-2.4.1/src/java/com/opensymphony/oscache/base/Cache.java:360: error: method add in class EventListenerList cannot be applied to given types; # [javac] listenerList.add(listener.getClass(), listener); # [javac] ^ # [javac] required: Class,T # [javac] found: Class,CacheEventListener # [javac] reason: no instance(s) of type variable(s) T exist so that argument type CacheEventListener conforms to formal parameter type T # [javac] where T is a type-variable: # [javac] T extends EventListener declared in method add(Class,T) # [javac] where CAP#1 is a fresh type-variable: # [javac] CAP#1 extends CacheEventListener from capture of ? extends CacheEventListener # [javac] /home/gil/rpmbuild/BUILD/oscache-2.4.1/src/java/com/opensymphony/oscache/base/Cache.java:673: error: method remove in class EventListenerList cannot be applied to given types; # [javac] listenerList.remove(listener.getClass(), listener); # [javac] ^ # [javac] required: Class,T # [javac] found: Class,CacheEventListener # [javac] reason: no instance(s) of type variable(s) T exist so that argument type CacheEventListener conforms to formal parameter type T # [javac] where T is a type-variable: # [javac] T extends EventListener declared in method remove(Class,T) # [javac] where CAP#1 is a fresh type-variable: # [javac] CAP#1 extends CacheEventListener from capture of ? extends CacheEventListener # [javac] Note: Some input files use or override a deprecated API. # [javac] Note: Recompile with -Xlint:deprecation for details. # [javac] Note: Some input files use unchecked or unsafe operations. # [javac] Note: Recompile with -Xlint:unchecked for details. # [javac] 2 errors # [javac] 1 warning sed -i "s|listenerList.add(listener.getClass(), listener);|//listenerList.add(listener.getClass(), listener);|" src/java/com/opensymphony/oscache/base/Cache.java sed -i "s|listenerList.remove(listener.getClass(), listener);|//listenerList.remove(listener.getClass(), listener);|" src/java/com/opensymphony/oscache/base/Cache.java sed -i "s|// listenerList.add(CacheEventListener.class, listener);|listenerList.add(CacheEventListener.class, listener);|" src/java/com/opensymphony/oscache/base/Cache.java sed -i "s|// listenerList.remove(CacheEventListener.class, listener);|listenerList.remove(CacheEventListener.class, listener);|" src/java/com/opensymphony/oscache/base/Cache.java %build mvn-rpmbuild -Dproject.build.sourceEncoding=UTF-8 -Dmaven.local.depmap.file=%{SOURCE1} install javadoc:aggregate %install mkdir -p %{buildroot}%{_javadir} install -m 644 target/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar mkdir -p %{buildroot}%{_mavenpomdir} install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom %add_maven_depmap JPP-%{name}.pom %{name}.jar mkdir -p %{buildroot}%{_javadocdir}/%{name} cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name} %files %{_javadir}/%{name}.jar %{_mavenpomdir}/JPP-%{name}.pom %{_mavendepmapfragdir}/%{name} %doc LICENSE.txt readme.txt %files javadoc %{_javadocdir}/%{name} %doc LICENSE.txt %changelog * Tue May 29 2012 gil cattaneo 2.4.1-1 - initial rpm