From d8c68472070d4c3fe593bdcc9c1e6a7bb455f7a1 Mon Sep 17 00:00:00 2001 From: Mat Booth Date: Mon, 13 May 2013 15:56:28 +0100 Subject: [PATCH] Package pom.xml and build with maven, rhbz #825455 - Remove ancient obsoletes/provides for jakarta package - Fix some misc other outdated packaging practices --- apache-commons-modeler.spec | 66 ++++++----- pom.xml | 224 ++++++++++++++++++++++++++++++++++++ 2 files changed, 256 insertions(+), 34 deletions(-) create mode 100644 pom.xml diff --git a/apache-commons-modeler.spec b/apache-commons-modeler.spec index 19195b2..12bfdff 100644 --- a/apache-commons-modeler.spec +++ b/apache-commons-modeler.spec @@ -3,13 +3,14 @@ Name: apache-%{short_name} Version: 2.0.1 -Release: 10%{?dist} +Release: 11%{?dist} Summary: Model MBeans utility classes 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 -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +# POM file based on the one from an unreleased upstream snapstream +Source1: pom.xml BuildArch: noarch BuildRequires: java-devel >= 1:1.6.0 @@ -18,19 +19,13 @@ BuildRequires: ant BuildRequires: apache-commons-beanutils BuildRequires: apache-commons-digester BuildRequires: apache-commons-logging -BuildRequires: junit +BuildRequires: maven-local Requires: java >= 1:1.6.0 Requires: jpackage-utils Requires: apache-commons-beanutils Requires: apache-commons-digester Requires: apache-commons-logging -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:2.0.1-6 %description Commons Modeler makes the process of setting up JMX (Java Management @@ -42,8 +37,6 @@ actual Model MBean instances. Summary: Javadoc for %{name} Group: Documentation Requires: jpackage-utils -# This should go away with F-17 -Obsoletes: jakarta-%{short_name}-javadoc < 0:2.0.1-6 %description javadoc This package contains the API documentation for %{name}. @@ -54,45 +47,50 @@ sed -i 's/\r//' LICENSE.txt sed -i 's/\r//' RELEASE-NOTES.txt sed -i 's/\r//' NOTICE.txt -%build -# TODO: Use Maven for building as soon as upstream provides proper build.xml. -export CLASSPATH=$(build-classpath \ - apache-commons-logging \ - apache-commons-digester \ - apache-commons-beanutils \ - junit ) +# Copy pom file into place +cp -p %{SOURCE1} . -ant -Dbuild.sysclasspath=first test dist +# Remove redundant dep on mx4j +%pom_remove_dep mx4j:mx4j-jmx + +# Fix ant dependency +%pom_remove_dep ant:ant +%pom_add_dep org.apache.ant:ant:1.8 + +%build +mvn-rpmbuild install javadoc:aggregate -Dproject.build.sourceEncoding=UTF-8 %install -rm -rf %{buildroot} - # jars install -d -m 0755 %{buildroot}%{_javadir} -install -pm 644 dist/%{short_name}.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 +(cd %{buildroot}%{_javadir} && for jar in *; do ln -sf ${jar} `echo $jar| sed "s|apache-||g"`; done) + +# pom +install -d -m 0755 %{buildroot}%{_mavenpomdir} +install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom +%add_maven_depmap -a "org.apache.commons:%{short_name}" JPP-%{name}.pom %{name}.jar # javadoc -install -d -m 0755 %{buildroot}%{_javadocdir}/%{name}-%{version} -cp -pr dist/docs/api*/* %{buildroot}%{_javadocdir}/%{name}-%{version}/ -ln -s %{name}-%{version} %{buildroot}%{_javadocdir}/%{name} - -%clean -rm -rf %{buildroot} +install -d -m 0755 %{buildroot}%{_javadocdir}/%{name} +cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}/ %files -%defattr(-,root,root,-) %doc LICENSE.txt NOTICE.txt RELEASE-NOTES.txt %{_javadir}/* +%{_mavenpomdir}/* +%{_mavendepmapfragdir}/* %files javadoc -%defattr(-,root,root,-) -%doc LICENSE.txt -%{_javadocdir}/%{name}-%{version} +%doc LICENSE.txt NOTICE.txt %{_javadocdir}/%{name} %changelog +* Mon May 13 2013 Mat Booth - 2.0.1-11 +- Package pom.xml and build with maven, rhbz #825455 +- Remove ancient obsoletes/provides for jakarta package +- Fix some misc other outdated packaging practices + * Wed Feb 13 2013 Fedora Release Engineering - 2.0.1-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..014a0cd --- /dev/null +++ b/pom.xml @@ -0,0 +1,224 @@ + + + + + org.apache.commons + commons-parent + 15 + + 4.0.0 + commons-modeler + commons-modeler + 2.0.1 + Commons Modeler + 2002 + + Commons Modeler makes the process of setting up JMX (Java + Management Extensions) MBeans easier by configuring the required meta + data using an XML descriptor. In addition, Modeler provides a factory + mechanism to create the actual Model MBean instances. + + http://commons.apache.org/proper/commons-modeler/ + + + jira + http://issues.apache.org/jira/browse/MODELER + + + + scm:svn:http://svn.apache.org/repos/asf/commons/proper/modeler/trunk + scm:svn:https://svn.apache.org/repos/asf/commons/proper/modeler/trunk + http://svn.apache.org/viewvc/commons/proper/modeler/trunk + + + + + Craig McClanahan + craigmcc + craigmcc@apache.org + Apache + + + + Yoav Shapira + yoavs + yoavs@apache.org + Apache + + + + Bill Barker + billbarker + billbarker@apache.org + Apache + + + + Davanum Srinivas + dims + dims@apache.org + Apache + + + + + + commons-digester + commons-digester + 1.4.1 + + + + commons-logging + commons-logging-api + 1.0.4 + + + + mx4j + mx4j-jmx + 2.1.1 + provided + + + + xml-apis + xml-apis + 2.0.2 + provided + + + + junit + junit + 3.8.1 + test + + + + ant + ant + 1.5 + true + + + + + modeler + 2.0.1 + + MODELER + 12310486 + + + + src/java + src/test + + + . + META-INF + + NOTICE.txt + LICENSE.txt + + + + src/java/org/apache/commons/modeler/ant + META-INF + + ant.properties + + + + src/java + META-INF + + **/ant.properties + **/mbeans-descriptors.dtd + + + + + + + src/test + false + + **/*.xml + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + **/*TestCase.java + + + + + maven-assembly-plugin + + + src/assembly/bin.xml + src/assembly/src.xml + + gnu + + + + org.apache.maven.plugins + maven-scm-publish-plugin + + + javadocs + + + + + + + + + + org.apache.maven.plugins + maven-changes-plugin + 2.0 + + ${basedir}/xdocs/changes.xml + %URL%/%ISSUE% + + + + + changes-report + + + + + + + +