%define maven 0 %if %maven %define target_dir target %define api_dir %target_dir/site/apidocs %else %define target_dir dist %define api_dir %target_dir/docs/api %endif Name: apache-commons-dbcp Version: 1.4 Release: 1mamba Summary: Apache Commons DBCP (Commons Database Connection Pooling) Group: Development/Libraries/Java Vendor: openmamba Distribution: openmamba Packager: gil URL: http://commons.apache.org/dbcp/ # https://issues.apache.org/jira/secure/attachment/12362389/patch.txt # svn export http://svn.apache.org/repos/asf/commons/proper/dbcp/trunk commons-dbcp-1.3 # tar czf commons-dbcp-1.3-SNAPSHOT-svn-src.tar.gz commons-dbcp-1.3 Source0: http://www.apache.org/dist/commons/dbcp/source/commons-dbcp-1.4-src.tar.gz # svn export -r '{2007-02-15}' http://svn.apache.org/repos/asf/commons/proper/commons-build/trunk/ jakarta-commons-build-dbcp # tar czf jakarta-commons-build-dbcp.tar.gz jakarta-commons-build-dbcp Source1: maven2-2.2.0-settings.xml Source2: apache-commons-dbcp-1.4-autogeneratedfiles.tar.gz Patch0: apache-commons-dbcp-1.3-build_xml.patch License: Apache Software License Version 2.0 BuildRequires: apache-ant BuildRequires: apache-commons-pool BuildRequires: apache-geronimo-1.2-specs %if %maven BuildRequires: apache-maven2 BuildRequires: apache-maven2-ant-plugin BuildRequires: apache-maven2-assembly-plugin BuildRequires: apache-maven2-changes-plugin BuildRequires: apache-maven2-checkstyle-plugin BuildRequires: apache-maven2-compiler-plugin BuildRequires: apache-maven2-install-plugin BuildRequires: apache-maven2-jar-plugin BuildRequires: apache-maven2-javadoc-plugin BuildRequires: apache-maven2-pmd-plugin #BuildRequires: felix-maven-bundle-plugin #BuildRequires: mojo clirr-maven-plugin #BuildRequires: mojo cobertura-maven-plugin %endif BuildRequires: jakarta-commons-collections BuildRequires: jakarta-commons-collections-tomcat5 BuildRequires: jakarta-commons-logging BuildRequires: java-backport-util-concurrent BuildRequires: java-gcj-compat BuildRequires: java-junit3 BuildRequires: jpackage-utils BuildRequires: libtomcat5-common BuildRequires: xerces-j2 BuildRequires: xml-commons-apis Requires: apache-commons-pool Requires: jakarta-commons-collections BuildRoot: %{_tmppath}/%{name}-%{version}-root #check_message: # [echo] Could not find ${naming-java.jar} %description The DBCP package shall create and maintain a database connection pool package written in the Java language to be distributed under the ASF license. The package shall be available as a pseudo-JDBC driver and via a DataSource interface. The package shall also support multiple logins to multiple database systems, reclamation of stale or dead connections, testing for valid connections, PreparedStatement pooling, and other features. %package javadoc Group: Documentation Summary: Javadoc for %{name} %description javadoc Apache Commons DBCP (Database Connection Pools) Package. This package contains javadoc for %{name} %package manual Group: Documentation Summary: Documents for %{name} %description manual Apache Commons DBCP (Database Connection Pools) Package. This package contains documents for %{name}. %package tomcat5 Group: Development/Libraries/Java Summary: Pool dependency for Tomcat5 %description tomcat5 Apache Commons DBCP (Database Connection Pools) Package. This package contains DBCP dependency for Tomcat5. %prep %setup -q -n commons-dbcp-%{version}-src for j in $(find . -name "*.jar"); do mv $j ${j}.no done %if %maven mv build.xml build.xml-old cp %{SOURCE1} settings.xml mkdir -p .m2/repository/JPP/maven2 sed -i -e "s|__INTERNAL_REPO_PLACEHOLDER__|file://`pwd`/external_repo|g" settings.xml sed -i -e "s|__EXTERNAL_REPO_PLACEHOLDER__|file://`pwd`/.m2/repository|g" settings.xml %else tar -xzf %{SOURCE2} %patch0 -p0 %endif cp %{S:2} tomcat5-build.xml sed -i 's/\r//' LICENSE.txt sed -i 's/\r//' NOTICE.txt sed -i 's/\r//' README.txt %build export JAVA_HOME=/usr/lib/jvm/jdk-gcj export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository %if %maven mkdir external_repo ln -s %{_javadir} external_repo/JPP mvn-jpp \ -e \ -s $(pwd)/settings.xml \ -Dmaven.test.failure.ignore=true \ -Dmaven.repo.local=$MAVEN_REPO_LOCAL \ ant:ant org.apache.felix:maven-bundle-plugin:ant install javadoc:javadoc %else export CLASSPATH=$(build-classpath pool/apache-commons-pool commons-collections \ xerces-j2 tomcat5/naming-factory tomcat5/naming-resources \ geronimo/jta-1.1-api geronimo/ejb-2.1-api geronimo/ejb-3.0-api \ backport-util-concurrent):$java_home/jre/lib/rt.jar ant \ -Dbuild.sysclasspath=first \ -Dcommons-pool.jar=$(build-classpath pool/apache-commons-pool) \ -Dcommons-collections.jar=$(build-classpath commons-collections) \ -Djunit.jar=$(build-classpath junit-3.8.2) \ -Djndi.jar=$JAVA_HOME/jre/lib/rt.jar \ -Dsax2.jar=$(build-classpath xml-commons-jaxp-1.3-apis) \ -Djdbc20ext.jar=$JAVA_HOME/jre/lib/rt.jar \ -Dcommons-logging.jar=$(build-classpath commons-logging) \ -Dxerces.jar=$(build-classpath xerces-j2) \ -Dxml-apis.jar=$(build-classpath xml-commons-jaxp-1.3-apis) \ -Djta-spec.jar=$(build-classpath geronimo/jta-1.0.1B-api) \ -Djta-impl.jar=$(build-classpath geronimo/jta-1.1-api) \ -Dbackport-util-concurrent.jar=$(build-classpath backport-util-concurrent) \ -Dejb-spec.jar=$(build-classpath geronimo/ejb-2.1-api-1.1) \ -Dnaming-common.jar=$(build-classpath tomcat5/naming-resources) \ -Dnaming-java=$JAVA_HOME/jre/lib/rt.jar \ -Djava.io.tmpdir=. \ -Dname=commons-dbcp-%{version} \ build-jar javadoc mkdir -p pool/dist/ ln -sf $(build-classpath pool/apache-commons-pool) pool/dist/commons-pool.jar export CLASSPATH=$CLASSPATH:$(build-classpath junit-3.8.2) ant \ -Djdbc20ext.jar=$JAVA_HOME/jre/lib/rt.jar \ -Djunit.jar=$(build-classpath junit-3.8.2) \ -Dcommons-pool.jar=$(build-classpath pool/apache-commons-pool) \ -Dcommons-logging.jar=$(build-classpath commons-logging) \ -Dxerces.jar=$(build-classpath xerces-j2) \ -Dxml-apis.jar=$(build-classpath xml-commons-jaxp-1.3-apis) \ -Djta-spec.jar=$(build-classpath geronimo/jta-1.0.1B-api) \ -Djta-impl.jar=$(build-classpath geronimo/jta-1.1-api) \ -Dbackport-util-concurrent.jar=$(build-classpath backport-util-concurrent) \ -Dejb-spec.jar=$(build-classpath geronimo/ejb-2.1-api) \ -Djta-impl.jar=$(build-classpath geronimo/jta-1.1-api) \ -Dnaming-common.jar=$(build-classpath tomcat5/naming-resources) \ -Dnaming-java=$JAVA_HOME/jre/lib/rt.jar \ -Dname=commons-dbcp-%{version} \ -Djava.io.tmpdir=. prepare dist %endif export CLASSPATH=$CLASSPATH:$(build-classpath commons-collections-tomcat5 pool/apache-commons-pool) #ant -f tomcat5-build.xml %install [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" mkdir -p %{buildroot}%{_javadir}/dbcp install -p -m 644 %target_dir/commons-dbcp-%{version}.jar \ %{buildroot}%{_javadir}/dbcp/%{name}-%{version}.jar #install -p -m 644 pool-tomcat5/commons-dbcp-tomcat5.jar \ # %{buildroot}%{_javadir}/dbcp/%{name}-tomcat5-%{version}.jar mkdir -p %{buildroot}%{_datadir}/maven2/poms install -pm 644 pom.xml %{buildroot}%{_datadir}/maven2/poms/JPP.dbcp-commons-pool.pom %add_to_maven_depmap org.apache.commons commons-dbcp %{version} JPP/dbcp commons-pool %add_to_maven_depmap commons-dbcp commons-dbcp %{version} JPP/dbcp commons-pool ( cd %{buildroot}%{_javadir}/dbcp for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed "s|apache-||g"` done ) ( cd %{buildroot}%{_javadir}/dbcp for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"` done ) mkdir -p %{buildroot}%{_javadocdir}/%{name}-%{version} cp -pr %api_dir/* %{buildroot}%{_javadocdir}/%{name}-%{version} ln -s %{name}-%{version} %{buildroot}%{_javadocdir}/%{name} #%{_bindir}/aot-compile-rpm %clean [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" %post %update_maven_depmap %postun %update_maven_depmap %files %defattr(-,root,root) %{_javadir}/dbcp/apache-commons-dbcp-%{version}.jar %{_javadir}/dbcp/apache-commons-dbcp.jar %{_javadir}/dbcp/commons-dbcp-%{version}.jar %{_javadir}/dbcp/commons-dbcp.jar %{_datadir}/maven2/poms %{_mavendepmapfragdir} %doc LICENSE.txt NOTICE.txt README.txt %files javadoc %defattr(-,root,root) %{_javadocdir}/apache-commons-dbcp-%{version} %{_javadocdir}/apache-commons-dbcp %files manual %defattr(-,root,root) %doc doc #%files tomcat5 #%defattr(-,root,root) #%{_javadir}/dbcp/apache-commons-dbcp-tomcat5-%{version}.jar #%{_javadir}/dbcp/apache-commons-dbcp-tomcat5.jar #%{_javadir}/dbcp/commons-dbcp-tomcat5-%{version}.jar #%{_javadir}/dbcp/commons-dbcp-tomcat5.jar %changelog * Mon Feb 28 2011 gil 1.4-1mamba - update to 1.4 * Mon Feb 28 2011 gil 1.3-4mamba - add OSGi Manifest and maven 2 pom - rebuilt with java-gcj-compat and new apache-commons-pool support * Wed Nov 10 2010 gil 1.3-3mamba - rebuilt devel * Mon Jun 15 2009 gil 1.3-2mamba - rebuilt sun-java 6u20 * Thu Jun 11 2009 gil 1.3-1mamba - update to 1.3 - renamed to legacy apache-commons-dbcp (ex jakarta) * Sun Mar 08 2009 gil 1.2.2-1mamba - package created by autospec