Blob Blame History Raw
%global base_name       pool
%global short_name      commons-%{base_name}

Name:             apache-%{short_name}
Version:          1.5.5
Release:          4%{?dist}
Summary:          Apache Commons Pool Package
Group:            Development/Libraries
License:          ASL 2.0
URL:    {base_name}/
BuildRoot:        %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch:        noarch

BuildRequires:    java-devel >= 1:1.6.0
BuildRequires:    jpackage-utils
BuildRequires:    apache-commons-parent
BuildRequires:    maven-source-plugin

Requires:         java >= 1:1.6.0
Requires:         jpackage-utils
Requires(post):   jpackage-utils
Requires(postun): jpackage-utils

# This should go away with F-17
Provides:         jakarta-%{short_name} = 0:%{version}-%{release}
Obsoletes:        jakarta-%{short_name} < 0:1.3-14
Obsoletes:        jakarta-%{short_name}-tomcat5 < 0:1.3-14
Obsoletes:        jakarta-%{short_name}-manual < 0:1.3-14

The goal of Pool package is it to create and maintain an object (instance) 
pooling package to be distributed under the ASF license. The package should 
support a variety of pool implementations, but encourage support of an 
interface that makes these implementations interchangeable.

%package javadoc
Summary:          Javadoc for %{name}
Group:            Documentation
Requires:         jpackage-utils
# This should go away with F-17
Obsoletes:        jakarta-%{short_name}-javadoc < 0:1.3-14

%description javadoc
This package contains the API documentation for %{name}.

%setup -q -n %{short_name}-%{version}-src

export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
mvn-jpp \
        -e \
        -Dmaven2.jpp.mode=true \
        -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
        install javadoc:javadoc

rm -rf %{buildroot}

# jars
install -d -m 0755 %{buildroot}%{_javadir}
install -pm 644 target/%{short_name}-%{version}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed  "s|apache-||g"`; done)
(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed  "s|-%{version}||g"`; done)

# pom
install -d -m 755 %{buildroot}%{_mavenpomdir}
install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{short_name}.pom
%add_to_maven_depmap org.apache.commons %{short_name} %{version} JPP %{short_name}

# following line is only for backwards compatibility. New packages
# should use proper groupid org.apache.commons and also artifactid
%add_to_maven_depmap %{short_name} %{short_name} %{version} JPP %{short_name}

# javadoc
install -d -m 0755 %{buildroot}%{_javadocdir}/%{name}-%{version}
cp -pr target/site/api*/* %{buildroot}%{_javadocdir}/%{name}-%{version}/
ln -s %{name}-%{version} %{buildroot}%{_javadocdir}/%{name}



rm -rf %{buildroot}


%files javadoc
%doc LICENSE.txt

* Tue Nov 9 2010 Chris Spike <> 1.5.5-4
- Removed maven* BRs in favour of apache-commons-parent
- Added deprecated groupId to depmap for compatibility reasons

* Mon Oct 18 2010 Chris Spike <> 1.5.5-3
- Removed Epoch

* Tue Oct 5 2010 Chris Spike <> 1.5.5-2
- Consistently using 'buildroot' macro instead of 'RPM_BUILD_ROOT' now

* Fri Oct 1 2010 Chris Spike <> 1.5.5-1
- Rename and rebase from jakarta-commons-pool