Build with xmvn

This commit is contained in:
Michal Srb 2013-01-16 10:11:55 +01:00
parent 2474738317
commit 4e93a36716

View File

@ -4,7 +4,7 @@
Name: apache-%{short_name}
Version: 3.2
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Internet protocol suite Java library
License: ASL 2.0
Group: Development/Libraries
@ -12,18 +12,15 @@ URL: http://commons.apache.org/%{base_name}/
Source0: http://www.apache.org/dist/commons/%{base_name}/source/%{short_name}-%{version}-src.tar.gz
BuildArch: noarch
BuildRequires: xmvn >= 0.2.3
BuildRequires: java-devel
BuildRequires: jpackage-utils
BuildRequires: maven
BuildRequires: maven-doxia-sitetools
BuildRequires: maven-surefire-provider-junit
BuildRequires: maven-surefire-provider-junit4
BuildRequires: maven-plugin-build-helper
BuildRequires: apache-commons-parent
Requires: java
Requires: jpackage-utils
Provides: jakarta-%{short_name} = 0:%{version}-%{release}
Obsoletes: jakarta-%{short_name} < 0:2.0-3
@ -40,6 +37,7 @@ Summary: API documentation for %{name}
Group: Documentation
Requires: jpackage-utils
Provides: jakarta-%{short_name}-javadoc = 0:%{version}-%{release}
Obsoletes: jakarta-%{short_name}-javadoc < 0:2.0-3
%description javadoc
@ -51,40 +49,27 @@ sed -i 's/\r//' NOTICE.txt LICENSE.txt
%build
export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
mkdir -p $MAVEN_REPO_LOCAL
%mvn_file : %{short_name} %{name}
%mvn_alias : org.apache.commons:%{short_name}
# test.failure.ignore added because package would not build on koji
# with TimeTCPClientTest failing
mvn-rpmbuild -Dmaven.test.failure.ignore=true \
install javadoc:aggregate
%mvn_build -f
%install
# jars
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}
install -p -m 644 target/%{short_name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar
ln -s %{name}.jar $RPM_BUILD_ROOT%{_javadir}/%{short_name}.jar
# pom
install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir}
install -pm 644 pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP-%{name}.pom
%add_maven_depmap JPP-%{name}.pom %{name}.jar -a "org.apache.commons:%{short_name}"
# javadoc
install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}
cp -pr target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
%mvn_install
%files
%files -f .mfiles
%doc LICENSE.txt NOTICE.txt
%{_javadir}/*
%{_mavenpomdir}/JPP-%{name}.pom
%{_mavendepmapfragdir}/%{name}
%files javadoc
%doc %{_javadocdir}/%{name}
%files javadoc -f .mfiles-javadoc
%doc LICENSE.txt NOTICE.txt
%changelog
* Wed Jan 16 2013 Michal Srb <msrb@redhat.com> - 3.2-2
- Build with xmvn
* Mon Dec 3 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.2-1
- Update to upstream version 3.2