[java-sig-commits] [apache-commons-dbcp/f16] Build with maven 3

Stanislav Ochotnicky sochotni at fedoraproject.org
Thu Dec 1 14:29:36 UTC 2011


commit a068e983e8f6acacc18645c7df65ad610707dd4d
Author: Stanislav Ochotnicky <sochotnicky at redhat.com>
Date:   Thu Dec 1 15:22:56 2011 +0100

    Build with maven 3
    
    - Fixes according to latest guidelines

 apache-commons-dbcp.spec |   85 ++++++++++++++++++---------------------------
 1 files changed, 34 insertions(+), 51 deletions(-)
---
diff --git a/apache-commons-dbcp.spec b/apache-commons-dbcp.spec
index 9253038..03c9144 100644
--- a/apache-commons-dbcp.spec
+++ b/apache-commons-dbcp.spec
@@ -3,17 +3,16 @@
 
 Name:             apache-%{short_name}
 Version:          1.4
-Release:          6%{?dist}
+Release:          7%{?dist}
 Summary:          Apache Commons DataBase Pooling Package
 Group:            Development/Libraries
 License:          ASL 2.0
 URL:              http://commons.apache.org/%{base_name}/
 Source0:          http://www.apache.org/dist/commons/%{base_name}/source/%{short_name}-%{version}-src.tar.gz
 
-# Depmap needed to remove tomcat* deps (needed only for testing) 
+# Depmap needed to remove tomcat* deps (needed only for testing)
 # and fix geronimo transaction
 Source1:          %{short_name}.depmap
-BuildRoot:        %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:        noarch
 
 BuildRequires:    java-devel >= 1:1.6.0
@@ -23,14 +22,12 @@ BuildRequires:    apache-commons-pool
 BuildRequires:    geronimo-parent-poms
 BuildRequires:    jta
 BuildRequires:    maven-plugin-cobertura
+BuildRequires:    maven
 
 Requires:         java >= 1:1.6.0
 Requires:         jpackage-utils
 Requires:         apache-commons-pool
 
-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.4-1
@@ -38,16 +35,16 @@ Obsoletes:        jakarta-%{short_name}-tomcat5 < 0:1.4-1
 Obsoletes:        hibernate_jdbc_cache < 0:1.4-1
 
 %description
-Many Apache projects support interaction with a relational database. Creating a 
-new connection for each user can be time consuming (often requiring multiple 
-seconds of clock time), in order to perform a database transaction that might 
-take milliseconds. Opening a connection per user can be unfeasible in a 
-publicly-hosted Internet application where the number of simultaneous users can 
-be very large. Accordingly, developers often wish to share a "pool" of open 
-connections between all of the application's current users. The number of users 
-actually performing a request at any given time is usually a very small 
-percentage of the total number of active users, and during request processing 
-is the only time that a database connection is required. The application itself 
+Many Apache projects support interaction with a relational database. Creating a
+new connection for each user can be time consuming (often requiring multiple
+seconds of clock time), in order to perform a database transaction that might
+take milliseconds. Opening a connection per user can be unfeasible in a
+publicly-hosted Internet application where the number of simultaneous users can
+be very large. Accordingly, developers often wish to share a "pool" of open
+connections between all of the application's current users. The number of users
+actually performing a request at any given time is usually a very small
+percentage of the total number of active users, and during request processing
+is the only time that a database connection is required. The application itself
 logs into the DBMS, and handles any user account issues internally.
 
 %package javadoc
@@ -65,63 +62,49 @@ This package contains the API documentation for %{name}.
 iconv -f iso8859-1 -t utf-8 RELEASE-NOTES.txt > RELEASE-NOTES.txt.conv && mv -f RELEASE-NOTES.txt.conv RELEASE-NOTES.txt
 
 %build
-export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
-
 # Skip tests, tomcat:naming-java and tomcat:naming-common not available
-mvn-jpp \
-        -e \
-        -Dmaven2.jpp.mode=true \
-        -Dmaven2.jpp.depmap.file="%{SOURCE1}" \
+mvn-rpmbuild \
+        -Dmaven.local.depmap.file="%{SOURCE1}" \
         -Dmaven.test.skip=true \
-        -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
         install javadoc:javadoc
 
 %install
-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)
+install -pm 644 target/%{short_name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
+ln -s %{name}.jar %{buildroot}%{_javadir}/%{short_name}.jar
 
 # 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}
+install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
+%add_maven_depmap JPP-%{name}.pom %{name}.jar -a "org.apache.commons:%{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}
-
-%post
-%update_maven_depmap
+install -d -m 0755 %{buildroot}%{_javadocdir}/%{name}
+cp -pr target/site/api*/* %{buildroot}%{_javadocdir}/%{name}
 
-%postun
-%update_maven_depmap
+%pre javadoc
+# workaround for rpm bug, can be removed in F-20
+[ $1 -gt 1 ] && [ -L %{_javadocdir}/%{name} ] && \
+rm -rf $(readlink -f %{_javadocdir}/%{name}) %{_javadocdir}/%{name} || :
 
-%clean
-rm -rf %{buildroot}
 
 %files
-%defattr(-,root,root,-)
 %doc LICENSE.txt NOTICE.txt README.txt RELEASE-NOTES.txt
-%{_javadir}/*
-%{_mavenpomdir}/*
-%{_mavendepmapfragdir}/*
+%{_javadir}/%{name}.jar
+%{_javadir}/%{short_name}.jar
+%{_mavenpomdir}/JPP-%{name}.pom
+%{_mavendepmapfragdir}/%{name}
 
 %files javadoc
-%defattr(-,root,root,-)
-%doc LICENSE.txt
-%{_javadocdir}/%{name}-%{version}
+%doc LICENSE.txt NOTICE.txt
 %{_javadocdir}/%{name}
 
 %changelog
+* Thu Dec  1 2011 Stanislav Ochotnicky <sochotnicky at redhat.com> - 1.4-7
+- Build with maven 3
+- Fixes according to latest guidelines
+
 * Mon Feb 07 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.4-6
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
 


More information about the java-sig-commits mailing list