Complete spec file rewrite

- Build with xmvn
- Use better description
- Simplify build-requires
- Update to current packaging guidelines
This commit is contained in:
Mikolaj Izdebski 2013-04-19 10:35:20 +02:00
parent 0c5dab96a5
commit dfb9a189f6

View File

@ -1,110 +1,46 @@
# Copyright (c) 2000-2005, JPackage Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the
# distribution.
# 3. Neither the name of the JPackage Project nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
Name: modello
Version: 1.7
Release: 1%{?dist}
Release: 2%{?dist}
Epoch: 0
Summary: Modello Data Model toolkit
# The majority of files are under MIT license, but some of them are
# ASL 2.0 or BSD-licensed.
License: ASL 2.0 and BSD and MIT
Group: Development/Libraries
URL: http://modello.codehaus.org/
Source0: http://repo2.maven.org/maven2/org/codehaus/%{name}/%{name}/%{version}/%{name}-%{version}-source-release.zip
Source1: http://www.apache.org/licenses/LICENSE-2.0.txt
BuildArch: noarch
BuildRequires: ant >= 0:1.6
BuildRequires: jpackage-utils >= 0:1.7.2
BuildRequires: maven-local
BuildRequires: maven-assembly-plugin
BuildRequires: maven-compiler-plugin
BuildRequires: maven-install-plugin
BuildRequires: maven-jar-plugin
BuildRequires: maven-javadoc-plugin
BuildRequires: maven-project
BuildRequires: maven-resources-plugin
BuildRequires: maven-surefire-plugin
BuildRequires: maven-site-plugin
BuildRequires: maven-surefire-provider-junit
BuildRequires: maven-dependency-plugin
BuildRequires: maven-plugin-plugin
BuildRequires: maven-shared-reporting-impl
BuildRequires: maven-shared-invoker
BuildRequires: classworlds >= 0:1.1
BuildRequires: plexus-containers-container-default
BuildRequires: plexus-utils
BuildRequires: plexus-velocity
BuildRequires: velocity
BuildRequires: maven-doxia
BuildRequires: maven-doxia-sitetools
BuildRequires: maven-doxia-tools
BuildRequires: plexus-build-api
BuildRequires: ws-jaxme
BuildRequires: xmlunit
BuildRequires: geronimo-parent-poms
Requires: classworlds >= 0:1.1
Requires: maven
Requires: maven-project
Requires: plexus-containers-container-default
Requires: plexus-build-api
Requires: plexus-utils
Requires: plexus-velocity
Requires: velocity
Requires: guava
Requires: xbean
Requires: jpackage-utils
BuildRequires: java-devel
BuildRequires: mvn(junit:junit)
BuildRequires: mvn(org.apache.maven.plugin-tools:maven-plugin-annotations)
BuildRequires: mvn(org.apache.maven.plugins:maven-dependency-plugin)
BuildRequires: mvn(org.apache.maven:maven-model)
BuildRequires: mvn(org.apache.maven:maven-plugin-api)
BuildRequires: mvn(org.apache.maven:maven-project)
BuildRequires: mvn(org.codehaus.plexus:plexus-compiler-api)
BuildRequires: mvn(org.codehaus.plexus:plexus-compiler-javac)
BuildRequires: mvn(org.codehaus.plexus:plexus-container-default)
BuildRequires: mvn(org.codehaus.plexus:plexus-utils)
BuildRequires: mvn(org.sonatype.plexus:plexus-build-api)
Provides: modello-maven-plugin = %{epoch}:%{version}-%{release}
Obsoletes: modello-maven-plugin < 0:1.0-0.a8.3jpp
%description
Modello is a Data Model toolkit in use by the
http://maven.apache.org/maven2.
It all starts with the Data Model. Once a data model is defined,
the toolkit can be used to generate any of the following at compile
time.
Java POJOs of the model.
Java POJOs to XML Writer (provided via xpp3 or dom4j).
XML to Java Pojos Reader (provided via xpp3 or dom4j).
XDoc documentation of the data model.
Java model to [Prevayler|http://www.prevayler.org/] Store.
Java model to [JPOX|http://www.jpox.org/] Store.
Java model to [JPOX|http://www.jpox.org/] Mapping.
Modello is a Data Model toolkit in use by the Apache Maven Project.
Modello is a framework for code generation from a simple model.
Modello generates code from a simple model format based on a plugin
architecture, various types of code and descriptors can be generated
from the single model, including Java POJOs, XML
marshallers/unmarshallers, XSD and documentation.
%package javadoc
Summary: Javadoc for %{name}
Group: Documentation
Requires: jpackage-utils
%description javadoc
API documentation for %{name}.
@ -114,57 +50,31 @@ API documentation for %{name}.
cp -p %{SOURCE1} LICENSE
# We don't generate site; don't pull extra dependencies.
%pom_remove_plugin :maven-site-plugin
# Tests require Plexus compiler >= 2.0
%pom_disable_module modello-test
%build
# skip tests because we have too old xmlunit in Fedora now (1.0.8)
mvn-rpmbuild \
-Dmaven.test.skip=true \
install javadoc:aggregate
%mvn_build -f
%install
# poms and depmap fragments
install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir}
for i in `find . -name pom.xml -not -path ./pom.xml -not -path "*src/it/*"`; do
# i is in format ..../artifactid/pom.xml
cp -p $i $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.`basename \`dirname $i\``.pom
%mvn_install
artifactname=`basename \`dirname $i\` | sed -e s:^modello-::g`
%add_to_maven_depmap org.codehaus.modello modello-$artifactname %{version} JPP/%{name} $artifactname
done
%jpackage_script org.codehaus.modello.ModelloCli "" "" modello:plexus-containers/plexus-container-default:plexus/classworlds:plexus/utils:plexus/plexus-build-api:xbean/xbean-reflect:guava %{name} true
cp -p pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.modello-modello.pom
%add_maven_depmap JPP.modello-modello.pom
# script
install -d -m 755 $RPM_BUILD_ROOT%{_bindir}
%jpackage_script org.codehaus.modello.ModelloCli "" "" "modello/core:modello/plugin-xpp3:modello/plugin-xml:guava:xbean:plexus/containers-container-default:plexus/utils:plexus/classworlds)" %{name} true
# jars
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}/%{name}
for jar in $(find -type f -name "*-%{version}.jar" | grep -E target/.*.jar); do
install -m 644 $jar $RPM_BUILD_ROOT%{_javadir}/%{name}/`basename $jar |sed -e s:modello-::g|sed -e s:-%{version}::g`
done
# javadoc
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}
cp -pr target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
%files
%files -f .mfiles
%dir %{_javadir}/%{name}
%doc LICENSE
%{_mavenpomdir}/*
%{_javadir}/%{name}
%{_bindir}/*
%{_mavendepmapfragdir}/*
%files javadoc
%files javadoc -f .mfiles-javadoc
%doc LICENSE
%{_javadocdir}/%{name}
%changelog
* Fri Apr 19 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:1.7-2
- Build with xmvn
- Use better description
- Simplify build-requires
- Update to current packaging guidelines
* Thu Feb 21 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 0:1.7-1
- Update to upstream version 1.7