apache-commons-pool/apache-commons-pool.spec

187 lines
5.0 KiB
RPMSpec
Raw Permalink Normal View History

%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-pool
Version: 1.5.5
Release: 1mamba
Summary: Jakarta Commons Pool Package
Group: Development/Libraries/Java
Vendor: openmamba
Distribution: openmamba
Packager: gil <puntogil@libero.it>
URL: http://commons.apache.org/pool/
Source0: http://www.apache.org/dist/jakarta/commons/pool/source/commons-pool-%{version}-src.tar.gz
Source1: maven2-2.2.0-settings.xml
Source2: commons-pool-1.5.5-autogeneratedfiles.tar.gz
Source3: jakarta-commons-pool-1.3-tomcat5-build.xml
Patch0: jakarta-commons-pool-1.3-build.patch
Patch1: apache-commons-pool-1.5.5-build_xml.patch
License: Apache Software License 2.0
BuildRequires: apache-ant
%if %maven
BuildRequires: apache-maven2
BuildRequires: apache-maven2-ant-plugin
BuildRequires: apache-maven2-compiler-plugin
BuildRequires: apache-maven2-install-plugin
BuildRequires: apache-maven2-jar-plugin
BuildRequires: apache-maven2-javadoc-plugin
BuildRequires: apache-maven2-source-plugin
#BuildRequires: felix maven-bundle-plugin
%endif
BuildRequires: java-junit3
BuildRequires: jpackage-utils
BuildRequires: java-openjdk
BuildRequires: java-openjdk-javadoc
Obsoletes: apache-commons-pool-tomcat5
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
Pool provides an Object-pooling API, with three major aspects:
1. A generic object pool interface that clients and
implementors can use to provide easily interchangable pooling implementations.
2. A toolkit for creating modular object pools.
3. Several general purpose pool implementations.
%package javadoc
Group: Documentation
Summary: Javadoc for %{name}
%description javadoc
Jakarta Commons Pool Package.
This package contains javadoc for %{name}
%prep
%setup -q -n commons-pool-%{version}-src
for j in $(find . -name "*.jar"); do
rm -rf $j
done
for c in $(find . -name "*.class"); do
rm -rf $c
done
%if %maven
cp %{SOURCE1} settings.xml
mkdir -p .m2/repository/JPP/maven2
sed -i -e "s|<localRepository>__INTERNAL_REPO_PLACEHOLDER__</localRepository>|<localRepository>file://`pwd`/external_repo</localRepository>|g" settings.xml
sed -i -e "s|<url>__EXTERNAL_REPOPLACEHOLDER__</url>|<url>file://`pwd`/.m2/repository</url>|g" settings.xml
%else
tar -xf %{SOURCE2}
%patch1 -p0
#%patch
#cp %{S:3} tomcat5-build.xml
%endif
%build
export JAVA_HOME=/usr/lib/jvm/java
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
mkdir ./tmp
export CLASSPATH=$(build-classpath junit ant)
ant -Dname=commons-pool-%{version} -Dj2se.api=%{_javadocdir}/java dist test
# export CLASSPATH=$CLASSPATH
# ant -f tomcat5-build.xml
%endif
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
mkdir -p %{buildroot}%{_javadir}/pool
install -p -m 644 %target_dir/commons-pool-%{version}.jar \
%{buildroot}%{_javadir}/pool/%{name}-%{version}.jar
#install -p -m 644 pool-tomcat5/commons-pool-tomcat5.jar \
# %{buildroot}%{_javadir}/pool/%{name}-tomcat5-%{version}.jar
mkdir -p %{buildroot}%{_datadir}/maven2/poms
install -pm 644 pom.xml %{buildroot}%{_datadir}/maven2/poms/JPP.pool-commons-pool.pom
%add_to_maven_depmap org.apache.commons commons-pool %{version} JPP/pool commons-pool
%add_to_maven_depmap commons-pool commons-pool %{version} JPP/pool commons-pool
(
cd %{buildroot}%{_javadir}/pool
for jar in *-%{version}*; do
ln -sf ${jar} `echo $jar| sed "s|apache-||g"`
done
)
(
cd %{buildroot}%{_javadir}/pool
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}/pool/apache-commons-pool-%{version}.jar
%{_javadir}/pool/apache-commons-pool.jar
%{_javadir}/pool/commons-pool-%{version}.jar
%{_javadir}/pool/commons-pool.jar
%{_datadir}/maven2/poms
%{_mavendepmapfragdir}
%doc LICENSE.txt NOTICE.txt README.txt RELEASE-NOTES.txt
%files javadoc
%defattr(-,root,root)
%{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}
%changelog
* Sun Feb 27 2011 gil <puntogil@libero.it> 1.5.5-1mamba
- update to 1.5.5
* Wed Nov 10 2010 gil <puntogil@libero.it> 1.4-2mamba
- rebuilt devel
* Thu Jun 11 2009 gil <puntogil@libero.it> 1.4-1mamba
- update to 1.4
- renamed to legacy apache-commons-pool (ex jakarta)
* Sun Mar 08 2009 gil <puntogil@libero.it> 1.3-1mamba
- package created by autospec