Update to current packaging guidelines

This commit is contained in:
Mikolaj Izdebski 2013-06-18 16:10:33 +02:00
parent e27ac79b6c
commit 1cd4f4c555

View File

@ -3,11 +3,12 @@ Version: 0
Release: 0.14.20090319svn%{?dist} Release: 0.14.20090319svn%{?dist}
Summary: Correctness annotations for Java code Summary: Correctness annotations for Java code
Group: Development/Libraries
# The majority of code is BSD-licensed, but some Java sources # The majority of code is BSD-licensed, but some Java sources
# are licensed under CC-BY license, see: $ grep -r Creative . # are licensed under CC-BY license, see: $ grep -r Creative .
License: BSD and CC-BY License: BSD and CC-BY
URL: http://jsr-305.googlecode.com/ URL: http://jsr-305.googlecode.com/
BuildArch: noarch
# There has been no official release yet. This is a snapshot of the Subversion # There has been no official release yet. This is a snapshot of the Subversion
# repository as of 19 Mar 2009. Use the following commands to generate the # repository as of 19 Mar 2009. Use the following commands to generate the
# tarball: # tarball:
@ -18,25 +19,10 @@ Source0: jsr-305-0.4.20090319.tar.xz
# File containing URL to CC-BY license text # File containing URL to CC-BY license text
Source1: NOTICE-CC-BY.txt Source1: NOTICE-CC-BY.txt
BuildRequires: maven-local
BuildRequires: java >= 0:1.6.0
BuildRequires: jpackage-utils, maven-local
BuildRequires: maven-compiler-plugin
BuildRequires: maven-install-plugin
BuildRequires: maven-jar-plugin
BuildRequires: maven-javadoc-plugin
BuildRequires: maven-resources-plugin
BuildRequires: maven-site-plugin
BuildRequires: maven-surefire-plugin
BuildRequires: maven-surefire-provider-junit
Requires: java, jpackage-utils
BuildArch: noarch
%package javadoc %package javadoc
Summary: Javadoc documentation for %{name} Summary: Javadoc documentation for %{name}
Group: Documentation
Requires: jpackage-utils
%description %description
This package contains reference implementations, test cases, and other This package contains reference implementations, test cases, and other
@ -48,52 +34,31 @@ This package contains the API documentation for %{name}.
%prep %prep
%setup -q -n %{name} %setup -q -n %{name}
sed -i 's/\r//' sampleUses/pom.xml
cp %{SOURCE1} NOTICE-CC-BY cp %{SOURCE1} NOTICE-CC-BY
%mvn_file :ri %{name}
%mvn_alias :ri com.google.code.findbugs:jsr305
%mvn_package ":{proposedAnnotations,tcl}" __noinstall
# do not build sampleUses module - it causes Javadoc generation to fail # do not build sampleUses module - it causes Javadoc generation to fail
sed -i '/<module>sampleUses<\/module>/d' pom.xml %pom_disable_module sampleUses
%build %build
mvn-rpmbuild install javadoc:aggregate %mvn_build
%install %install
%mvn_install
# JAR files %files -f .mfiles
mkdir -p $RPM_BUILD_ROOT%{_javadir}
cp -p ri/target/ri-0.1-SNAPSHOT.jar $RPM_BUILD_ROOT%{_javadir}/%{name}.jar
# Javadocs
mkdir -p $RPM_BUILD_ROOT%{_javadocdir}/%{name}
cp -rp target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}/
# pom
mkdir -p $RPM_BUILD_ROOT%{_mavenpomdir}
install -pm 644 ri/pom.xml $RPM_BUILD_ROOT/%{_mavenpomdir}/JPP-%{name}.pom
%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
%pre javadoc
# workaround for rpm bug 646523 (can be removed in F-17)
[ $1 -gt 1 ] && [ -L %{_javadocdir}/%{name} ] && \
rm -rf $(readlink -f %{_javadocdir}/%{name}) %{_javadocdir}/%{name} || :
%files
%doc ri/LICENSE NOTICE-CC-BY sampleUses %doc ri/LICENSE NOTICE-CC-BY sampleUses
%{_mavenpomdir}/JPP-%{name}.pom
%{_mavenpomdir}/JPP-%{name}-parent.pom
%{_javadir}/%{name}.jar
%{_mavendepmapfragdir}/%{name}
%files javadoc %files javadoc -f .mfiles-javadoc
%doc ri/LICENSE NOTICE-CC-BY %doc ri/LICENSE NOTICE-CC-BY
%{_javadocdir}/%{name}
%changelog %changelog
* Tue Jun 18 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 0-0.14.20090319svn
- Update to current packaging guidelines
* Tue Jun 18 2013 Michal Srb <msrb@redhat.com> - 0-0.14.20090319svn * Tue Jun 18 2013 Michal Srb <msrb@redhat.com> - 0-0.14.20090319svn
- Install license file with javadoc subpackage (Resolves: rhbz#975411) - Install license file with javadoc subpackage (Resolves: rhbz#975411)
- Add file containing link to CC-BY license text - Add file containing link to CC-BY license text