Build with xmvn

- Update to current packaging guidelines
This commit is contained in:
Mikolaj Izdebski 2013-01-08 17:09:57 +01:00
parent de4de36c97
commit 35f024bb82

View File

@ -1,28 +1,25 @@
%global base_name io %global base_name io
%global short_name commons-%{base_name} %global short_name commons-%{base_name}
Name: apache-%{short_name} Name: apache-%{short_name}
Version: 2.4 Version: 2.4
Release: 3%{?dist} Release: 4%{?dist}
Epoch: 1 Epoch: 1
Summary: Utilities to assist with developing IO functionality Summary: Utilities to assist with developing IO functionality
License: ASL 2.0 License: ASL 2.0
Group: Development/Libraries Group: Development/Libraries
URL: http://commons.apache.org/%{base_name} URL: http://commons.apache.org/%{base_name}
Source0: http://archive.apache.org/dist/commons/%{base_name}/source/%{short_name}-%{version}-src.tar.gz Source0: http://archive.apache.org/dist/commons/%{base_name}/source/%{short_name}-%{version}-src.tar.gz
BuildArch: noarch BuildArch: noarch
BuildRequires: java-devel >= 1:1.6.0 BuildRequires: java-devel >= 1:1.6
BuildRequires: jpackage-utils BuildRequires: xmvn >= 0.2.1
BuildRequires: junit4 BuildRequires: javapackages-tools >= 0.10.0
BuildRequires: maven BuildRequires: apache-commons-parent
BuildRequires: maven-surefire-provider-junit4 BuildRequires: maven-surefire-provider-junit
BuildRequires: apache-commons-parent
Requires: java >= 1:1.6.0 Provides: jakarta-%{short_name} = %{epoch}:%{version}-%{release}
Requires: jpackage-utils Obsoletes: jakarta-%{short_name} < %{epoch}:%{version}-%{release}
Provides: jakarta-%{short_name} = %{epoch}:%{version}-%{release}
Obsoletes: jakarta-%{short_name} < %{epoch}:%{version}-%{release}
%description %description
Commons-IO contains utility classes, stream implementations, Commons-IO contains utility classes, stream implementations,
@ -30,50 +27,36 @@ file filters, and endian classes. It is a library of utilities
to assist with developing IO functionality. to assist with developing IO functionality.
%package javadoc %package javadoc
Summary: API documentation for %{name} Summary: API documentation for %{name}
Group: Documentation Group: Documentation
Requires: jpackage-utils Provides: jakarta-%{short_name}-javadoc = %{epoch}:%{version}-%{release}
Provides: jakarta-%{short_name}-javadoc = %{epoch}:%{version}-%{release} Obsoletes: jakarta-%{short_name}-javadoc < %{epoch}:%{version}-%{release}
Obsoletes: jakarta-%{short_name}-javadoc < %{epoch}:%{version}-%{release}
%description javadoc %description javadoc
This package contains the API documentation for %{name}. This package provides %{summary}.
%prep %prep
%setup -q -n %{short_name}-%{version}-src %setup -q -n %{short_name}-%{version}-src
sed -i 's/\r//' *.txt sed -i 's/\r//' *.txt
%build %build
mvn-rpmbuild install javadoc:javadoc %mvn_file : %{short_name} %{name}
%mvn_alias : org.apache.commons:
%mvn_build
%install %install
%mvn_install
# jars %files -f .mfiles
install -d -m 755 %{buildroot}%{_javadir}
install -p -m 644 target/%{short_name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
ln -sf %{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_maven_depmap JPP-%{short_name}.pom %{short_name}.jar -a "org.apache.commons:commons-io"
# javadoc
install -d -m 755 %{buildroot}%{_javadocdir}/%{name}
cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}
%files
%doc LICENSE.txt NOTICE.txt RELEASE-NOTES.txt %doc LICENSE.txt NOTICE.txt RELEASE-NOTES.txt
%{_javadir}/*.jar
%{_mavenpomdir}/JPP-%{short_name}.pom
%{_mavendepmapfragdir}/*
%files javadoc %files javadoc -f .mfiles-javadoc
%doc LICENSE.txt NOTICE.txt %doc LICENSE.txt NOTICE.txt
%doc %{_javadocdir}/%{name}
%changelog %changelog
* Tue Jan 8 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:2.4-4
- Build with xmvn
* Mon Nov 19 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:2.4-3 * Mon Nov 19 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:2.4-3
- Add Provides/Obsoletes for jakarta-commons-io - Add Provides/Obsoletes for jakarta-commons-io