jsr-305/jsr-305.spec

112 lines
3.5 KiB
RPMSpec
Raw Normal View History

#
# spec file for package jsr-305
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%global svn_revision 51
%global svn_date 20130910
Name: jsr-305
Version: 0.1+%{svn_date}
Release: 0
Summary: Correctness annotations for Java code
# The majority of code is BSD-licensed, but some Java sources
# are licensed under CC-BY license, see: $ grep -r Creative .
License: BSD-3-Clause
Group: Development/Libraries/Java
Url: http://code.google.com/p/jsr-305/
# There has been no official release yet. This is a snapshot of the Subversion
# repository as of 10 Sep 2013. Use the following commands to generate the
# tarball:
# svn export -r %{svn_revision} http://%{name}.googlecode.com/svn/trunk %{name}
# tar -czvf %{name}-%{svn_date}svn.tgz %{name}
Source0: jsr-305-%{svn_date}svn.tgz
Source1: jsr-305-ri-build.xml
# File containing URL to CC-BY license text
Source2: NOTICE-CC-BY.txt
BuildRequires: ant
BuildRequires: dos2unix
BuildRequires: fdupes
BuildRequires: java-devel
BuildRequires: javapackages-local
BuildArch: noarch
%package javadoc
Summary: Javadoc documentation for %{name}
Group: Development/Libraries/Java
%description
This package contains reference implementations, test cases, and other
documents for Java Specification Request 305: Annotations for Software Defect
Detection.
%description javadoc
This package contains the API documentation for %{name}.
%prep
%setup -q -n %{name}
cp -a %{SOURCE1} ri/build.xml
cp %{SOURCE2} NOTICE-CC-BY
dos2unix sampleUses/pom.xml
# do not build sampleUses module - it causes Javadoc generation to fail
%pom_disable_module sampleUses
%build
export OPT_JAR_LIST=:
export CLASSPATH=
pushd ri
%{ant} -Dant.build.javac.source=1.6 -Dant.build.javac.target=1.6 \
-Dversion=%{version} -Djava.javadoc=%{_javadocdir}/java
popd
%install
# jars
mkdir -p %{buildroot}%{_javadir}
cp -a ri/jsr-305-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
ln -s %{name}-%{version}.jar %{buildroot}%{_javadir}/jsr305.jar
# poms
mkdir -p %{buildroot}%{_mavenpomdir}
cp -a ri/pom.xml %{buildroot}%{_mavenpomdir}/%{name}.pom
%add_maven_depmap %{name}.pom %{name}.jar -a com.google.code.findbugs:jsr305
mkdir -p %{buildroot}%{_mavenpomdir}/%{name}
cp -a pom.xml %{buildroot}%{_mavenpomdir}/%{name}/%{name}.pom
%add_maven_depmap %{name}/%{name}.pom
# javadoc
mkdir -p %{buildroot}%{_javadocdir}/%{name}
cp -a ri/javadoc/* %{buildroot}%{_javadocdir}/%{name}
%fdupes -s %{buildroot}%{_javadocdir}/%{name}
%files
%defattr(0644,root,root,0755)
%doc ri/LICENSE NOTICE-CC-BY sampleUses
%{_javadir}/%{name}.jar
%{_javadir}/jsr305.jar
%{_mavenpomdir}/*
%if %{defined _maven_repository}
%{_mavendepmapfragdir}/%{name}
%else
%{_datadir}/maven-metadata/%{name}.xml*
%endif
%files javadoc
%defattr(0644,root,root,0755)
%doc ri/LICENSE NOTICE-CC-BY
%{_javadocdir}/%{name}
%changelog