forked from pool/apache-commons-dbcp
This commit is contained in:
@@ -17,42 +17,40 @@
|
||||
|
||||
|
||||
%define base_name dbcp
|
||||
%define short_name commons-%{base_name}
|
||||
Name: apache-%{short_name}
|
||||
Version: 1.4
|
||||
%define short_name commons-%{base_name}2
|
||||
Name: apache-commons-dbcp
|
||||
Version: 2.1.1
|
||||
Release: 0
|
||||
Summary: Jakarta Commons DataBase Pooling Package
|
||||
License: Apache-2.0
|
||||
Group: Development/Libraries/Java
|
||||
URL: https://commons.apache.org/proper/commons-dbcp/
|
||||
Url: https://commons.apache.org/proper/commons-dbcp/
|
||||
Source0: http://archive.apache.org/dist/commons/%{base_name}/source/%{short_name}-%{version}-src.tar.gz
|
||||
Source100: http://archive.apache.org/dist/commons/%{base_name}/source/%{short_name}-%{version}-src.tar.gz.asc
|
||||
Source101: commons.keyring
|
||||
Patch0: apache-commons-dbcp-sourcetarget.patch
|
||||
Patch1: apache-commons-dbcp-javadoc.patch
|
||||
Patch2: apache-commons-dbcp-jdbc41.patch
|
||||
BuildRequires: ant >= 1.6.5
|
||||
BuildRequires: apache-commons-logging
|
||||
BuildRequires: apache-commons-parent
|
||||
BuildRequires: apache-commons-pool
|
||||
BuildRequires: apache-commons-pool2
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: geronimo-jta-1_1-api
|
||||
BuildRequires: java-devel >= 1.7
|
||||
BuildRequires: javapackages-local
|
||||
BuildRequires: javapackages-tools
|
||||
BuildRequires: jdbc-stdext >= 2.0
|
||||
BuildRequires: junit >= 3.8.1
|
||||
BuildRequires: xerces-j2
|
||||
Requires: apache-commons-parent
|
||||
Requires: commons-collections >= 3.2
|
||||
Requires: commons-pool
|
||||
Requires: commons-pool2
|
||||
Requires: jta_api >= 1.1
|
||||
Requires(post): update-alternatives
|
||||
Requires(preun): update-alternatives
|
||||
Provides: %{short_name} = %{version}-%{release}
|
||||
Obsoletes: %{short_name} < %{version}
|
||||
Provides: hibernate_jdbc_cache
|
||||
Provides: jakarta-commons-dbcp = %{version}
|
||||
Obsoletes: jakarta-commons-dbcp < %{version}
|
||||
Provides: jakarta-commons-dbcp2 = %{version}
|
||||
Obsoletes: jakarta-commons-dbcp2 < %{version}
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildArch: noarch
|
||||
|
||||
%description
|
||||
@@ -83,13 +81,12 @@ features.
|
||||
%setup -q -n %{short_name}-%{version}-src
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
# remove all binary libs
|
||||
find . -name "*.jar" -exec rm -f {} \;
|
||||
|
||||
%build
|
||||
ant \
|
||||
-Dcommons-pool.jar=$(build-classpath commons-pool) \
|
||||
-Dcommons-pool.jar=$(build-classpath commons-pool2) \
|
||||
-Djdbc20ext.jar=$(build-classpath jdbc-stdext) \
|
||||
-Djunit.jar=$(build-classpath junit) \
|
||||
-Dxerces.jar=$(build-classpath xerces-j2) \
|
||||
@@ -102,13 +99,9 @@ ant \
|
||||
%install
|
||||
# jars
|
||||
install -d -m 755 %{buildroot}%{_javadir}
|
||||
install -m 644 dist/%{short_name}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
|
||||
install -m 644 dist/%{short_name}-%{version}.jar %{buildroot}%{_javadir}/%{name}2-%{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 -m 644 pom.xml %{buildroot}%{_mavenpomdir}/%{name}-%{version}.pom
|
||||
%add_maven_depmap %{name}-%{version}.pom %{name}-%{version}.jar
|
||||
# javadoc
|
||||
install -d -m 755 %{buildroot}%{_javadocdir}/%{name}
|
||||
cp -pr dist/docs/* %{buildroot}%{_javadocdir}/%{name}
|
||||
@@ -119,29 +112,25 @@ ln -sf %{_sysconfdir}/alternatives/hibernate_jdbc_cache.jar %{buildroot}%{_javad
|
||||
|
||||
%post
|
||||
update-alternatives --install %{_javadir}/hibernate_jdbc_cache.jar \
|
||||
hibernate_jdbc_cache %{_javadir}/%{name}.jar 60
|
||||
hibernate_jdbc_cache %{_javadir}/%{name}2.jar 60
|
||||
|
||||
%preun
|
||||
if [ $1 -eq 0 ] ; then
|
||||
update-alternatives --remove hibernate_jdbc_cache %{_javadir}/%{name}.jar
|
||||
update-alternatives --remove hibernate_jdbc_cache %{_javadir}/%{name}2.jar
|
||||
fi
|
||||
|
||||
%files
|
||||
%license LICENSE.txt
|
||||
%{_javadir}/%{name}.jar
|
||||
%{_javadir}/%{name}-%{version}.jar
|
||||
%defattr(-,root,root)
|
||||
%doc LICENSE.txt
|
||||
%{_javadir}/%{name}2.jar
|
||||
%{_javadir}/%{name}2-%{version}.jar
|
||||
%{_javadir}/%{short_name}.jar
|
||||
%{_javadir}/%{short_name}-%{version}.jar
|
||||
%{_javadir}/hibernate_jdbc_cache.jar
|
||||
%ghost %{_sysconfdir}/alternatives/hibernate_jdbc_cache.jar
|
||||
%{_mavenpomdir}/%{name}-%{version}.pom
|
||||
%if %{defined _maven_repository}
|
||||
%{_mavendepmapfragdir}/%{name}
|
||||
%else
|
||||
%{_datadir}/maven-metadata/%{name}.xml*
|
||||
%endif
|
||||
|
||||
%files javadoc
|
||||
%defattr(-,root,root)
|
||||
%doc %{_javadocdir}/%{name}
|
||||
|
||||
%changelog
|
||||
|
||||
Reference in New Issue
Block a user