Use maven3 to build

- Fix depmap
- Fix Jave BRs
This commit is contained in:
Stanislav Ochotnicky 2011-09-13 11:46:29 +02:00
parent 7423e0a87f
commit 4e4d90a32d

View File

@ -1,6 +1,6 @@
Name: jsr-305 Name: jsr-305
Version: 0 Version: 0
Release: 0.6.20090319svn%{?dist} Release: 0.7.20090319svn%{?dist}
Summary: Correctness annotations for Java code Summary: Correctness annotations for Java code
Group: Development/Libraries Group: Development/Libraries
@ -14,8 +14,8 @@ URL: http://jsr-305.googlecode.com/
# xz jsr-305-0.4.20090319.tar # xz jsr-305-0.4.20090319.tar
Source0: jsr-305-0.4.20090319.tar.xz Source0: jsr-305-0.4.20090319.tar.xz
BuildRequires: java-1.6.0-openjdk-devel BuildRequires: java >= 0:1.6.0
BuildRequires: jpackage-utils, maven2 BuildRequires: jpackage-utils, maven
BuildRequires: maven-compiler-plugin BuildRequires: maven-compiler-plugin
BuildRequires: maven-install-plugin BuildRequires: maven-install-plugin
BuildRequires: maven-jar-plugin BuildRequires: maven-jar-plugin
@ -23,7 +23,8 @@ BuildRequires: maven-javadoc-plugin
BuildRequires: maven-resources-plugin BuildRequires: maven-resources-plugin
BuildRequires: maven-site-plugin BuildRequires: maven-site-plugin
BuildRequires: maven-surefire-plugin BuildRequires: maven-surefire-plugin
Requires: java >= 1.5, jpackage-utils BuildRequires: maven-surefire-provider-junit
Requires: java, jpackage-utils
BuildArch: noarch BuildArch: noarch
@ -45,15 +46,9 @@ This package contains the API documentation for %{name}.
sed -i 's/\r//' sampleUses/pom.xml sed -i 's/\r//' sampleUses/pom.xml
%build %build
export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository mvn-rpmbuild install javadoc:aggregate
mkdir -p $MAVEN_REPO_LOCAL
mvn-jpp -Dmaven.repo.local=$MAVEN_REPO_LOCAL install
cd ri
mvn-jpp -Dmaven.repo.local=$MAVEN_REPO_LOCAL javadoc:javadoc
%install %install
rm -rf $RPM_BUILD_ROOT
# JAR files # JAR files
mkdir -p $RPM_BUILD_ROOT%{_javadir} mkdir -p $RPM_BUILD_ROOT%{_javadir}
@ -61,19 +56,16 @@ cp -p ri/target/ri-0.1-SNAPSHOT.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar
# Javadocs # Javadocs
mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/%{name} mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/%{name}
cp -rp ri/target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}/ cp -rp target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}/
# pom # pom
mkdir -p $RPM_BUILD_ROOT%{_mavenpomdir} mkdir -p $RPM_BUILD_ROOT%{_mavenpomdir}
install -pm 644 ri/pom.xml $RPM_BUILD_ROOT/%{_mavenpomdir}/JPP-%{name}.pom install -pm 644 ri/pom.xml $RPM_BUILD_ROOT/%{_mavenpomdir}/JPP-%{name}.pom
%add_to_maven_depmap org.apache.maven %{name} %{version} JPP %{name} %add_maven_depmap JPP-%{name}.pom %{name}.jar -a 'com.google.code.findbugs:jsr305'
install -pm 644 pom.xml $RPM_BUILD_ROOT/%{_mavenpomdir}/JPP-%{name}-parent.pom
%add_maven_depmap JPP-%{name}-parent.pom
%post
%update_maven_depmap
%postun
%update_maven_depmap
%pre javadoc %pre javadoc
# workaround for rpm bug 646523 (can be removed in F-17) # workaround for rpm bug 646523 (can be removed in F-17)
@ -81,17 +73,21 @@ install -pm 644 ri/pom.xml $RPM_BUILD_ROOT/%{_mavenpomdir}/JPP-%{name}.pom
rm -rf $(readlink -f %{_javadocdir}/%{name}) %{_javadocdir}/%{name} || : rm -rf $(readlink -f %{_javadocdir}/%{name}) %{_javadocdir}/%{name} || :
%files %files
%defattr(-,root,root,-)
%doc ri/LICENSE sampleUses %doc ri/LICENSE sampleUses
%{_mavenpomdir}/JPP-jsr-305.pom %{_mavenpomdir}/JPP-%{name}.pom
%{_javadir}/* %{_mavenpomdir}/JPP-%{name}-parent.pom
%{_mavendepmapfragdir}/jsr-305 %{_javadir}/%{name}.jar
%{_mavendepmapfragdir}/%{name}
%files javadoc %files javadoc
%defattr(-,root,root,-) %{_javadocdir}/%{name}
%{_javadocdir}/*
%changelog %changelog
* Mon Sep 12 2011 Stanislav Ochotnicky <sochotnicky@redhat.com> - 0-0.7.20090319svn
- Use maven3 to build
- Fix depmap
- Fix Jave BRs
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.6.20090319svn * Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.6.20090319svn
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild