Package pom.xml and build with maven, rhbz #825455

- Remove ancient obsoletes/provides for jakarta package
- Fix some misc other outdated packaging practices
This commit is contained in:
Mat Booth 2013-05-13 15:56:28 +01:00
commit d8c6847207
2 changed files with 256 additions and 34 deletions

View file

@ -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 <fedora@matbooth.co.uk> - 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 <rel-eng@lists.fedoraproject.org> - 2.0.1-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

224
pom.xml Normal file
View file

@ -0,0 +1,224 @@
<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.apache.commons</groupId>
<artifactId>commons-parent</artifactId>
<version>15</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>commons-modeler</groupId>
<artifactId>commons-modeler</artifactId>
<version>2.0.1</version>
<name>Commons Modeler</name>
<inceptionYear>2002</inceptionYear>
<description>
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.
</description>
<url>http://commons.apache.org/proper/commons-modeler/</url>
<issueManagement>
<system>jira</system>
<url>http://issues.apache.org/jira/browse/MODELER</url>
</issueManagement>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/commons/proper/modeler/trunk</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/commons/proper/modeler/trunk</developerConnection>
<url>http://svn.apache.org/viewvc/commons/proper/modeler/trunk</url>
</scm>
<developers>
<developer>
<name>Craig McClanahan</name>
<id>craigmcc</id>
<email>craigmcc@apache.org</email>
<organization>Apache</organization>
</developer>
<developer>
<name>Yoav Shapira</name>
<id>yoavs</id>
<email>yoavs@apache.org</email>
<organization>Apache</organization>
</developer>
<developer>
<name>Bill Barker</name>
<id>billbarker</id>
<email>billbarker@apache.org</email>
<organization>Apache</organization>
</developer>
<developer>
<name>Davanum Srinivas</name>
<id>dims</id>
<email>dims@apache.org</email>
<organization>Apache</organization>
</developer>
</developers>
<dependencies>
<dependency>
<groupId>commons-digester</groupId>
<artifactId>commons-digester</artifactId>
<version>1.4.1</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging-api</artifactId>
<version>1.0.4</version>
</dependency>
<dependency>
<groupId>mx4j</groupId>
<artifactId>mx4j-jmx</artifactId>
<version>2.1.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>2.0.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ant</groupId>
<artifactId>ant</artifactId>
<version>1.5</version>
<optional>true</optional>
</dependency>
</dependencies>
<properties>
<commons.componentid>modeler</commons.componentid>
<commons.release.version>2.0.1</commons.release.version>
<commons.binary.suffix></commons.binary.suffix>
<commons.jira.id>MODELER</commons.jira.id>
<commons.jira.pid>12310486</commons.jira.pid>
</properties>
<build>
<sourceDirectory>src/java</sourceDirectory>
<testSourceDirectory>src/test</testSourceDirectory>
<resources>
<resource>
<directory>.</directory>
<targetPath>META-INF</targetPath>
<includes>
<include>NOTICE.txt</include>
<include>LICENSE.txt</include>
</includes>
</resource>
<resource>
<directory>src/java/org/apache/commons/modeler/ant</directory>
<targetPath>META-INF</targetPath>
<includes>
<include>ant.properties</include>
</includes>
</resource>
<resource>
<directory>src/java</directory>
<targetPath>META-INF</targetPath>
<includes>
<include>**/ant.properties</include>
<include>**/mbeans-descriptors.dtd</include>
</includes>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/test</directory>
<filtering>false</filtering>
<includes>
<include>**/*.xml</include>
</includes>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/*TestCase.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>src/assembly/bin.xml</descriptor>
<descriptor>src/assembly/src.xml</descriptor>
</descriptors>
<tarLongFileMode>gnu</tarLongFileMode>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-publish-plugin</artifactId>
<configuration>
<ignorePathsToDelete>
<ignorePathToDelete>javadocs</ignorePathToDelete>
</ignorePathsToDelete>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changes-plugin</artifactId>
<version>2.0</version>
<configuration>
<xmlPath>${basedir}/xdocs/changes.xml</xmlPath>
<issueLinkTemplate>%URL%/%ISSUE%</issueLinkTemplate>
</configuration>
<reportSets>
<reportSet>
<reports>
<report>changes-report</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
</project>