File jsr-305.spec of Package jsr-305

#
# spec file for package jsr-305 (Version 0.1)
#
# Copyright (c) 2010 SUSE LINUX Products 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 http://bugs.opensuse.org/
#


%define section free

Name:           jsr-305
Version:        0.1
Release:        1
Summary:        JSR 305: Annotations for Software Defect Detection in Java
# http://groups.google.com/group/jsr-305/browse_thread/thread/8105869a258c8c4f
License:        BSD
Group:          Development/Libraries/Java
Url:            http://code.google.com/p/jsr-305/
# svn export -r20080806 http://jsr-305.googlecode.com/svn/trunk/ jsr-305-0.1
# tar cjf jsr-305-0.1.bz2 jsr-305-0.1
Source0:        http://code.google.com/p/jsr-305/jsr-305-0.1.tar.bz2
Source1:        jsr-305-ri-build.xml
# bnc#653551
# The URL reffers to New BSD License - used <OWNER> == Bill Pugh, <YEAR> == 2008
Source2:        license
Provides:       jsr305 = %{version}-%{release}
Requires:       jpackage-utils
BuildRequires:  ant
BuildRequires:  java-devel
BuildRequires:  java-javadoc
BuildRequires:  jpackage-utils
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
This project contains reference implementations, test cases, and other
documents under source code control for Java Specification Request 305:
Annotations for Software Defect Detection. More information at the Google
group: http://groups.google.com/group/jsr-305.

%package javadoc
License:        BSD
Summary:        Javadoc for %{name}
Group:          Documentation/HTML

%description javadoc
This project contains reference implementations, test cases, and other
documents under source code control for Java Specification Request 305:
Annotations for Software Defect Detection. More information at the Google
group: http://groups.google.com/group/jsr-305.

%prep
%setup -q
%{__cp} -a %{SOURCE1} ri/build.xml
%{__cp} %{SOURCE2} .

%build
export OPT_JAR_LIST=:
export CLASSPATH=
pushd ri
%{ant} -Dant.build.javac.source=1.5 -Dant.build.javac.target=1.5 \
       -Dversion=%{version} -Djava.javadoc=%{_javadocdir}/java
popd

%install
# jars
%{__mkdir_p} %{buildroot}%{_javadir}
%{__cp} -a ri/jsr-305-%{version}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
%{__ln_s} %{name}-%{version}.jar %{buildroot}%{_javadir}/jsr305-%{version}.jar
(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; do %{__ln_s} ${jar} ${jar/-%{version}/}; done)

# poms
%add_to_maven_depmap org.jsr-305 %{name} %{version} JPP %{name}

%{__mkdir_p} %{buildroot}%{_datadir}/maven2/poms
%{__cp} -a ri/pom.xml %{buildroot}%{_datadir}/maven2/poms/JPP.%{name}.pom

# javadoc
%{__mkdir_p} %{buildroot}%{_javadocdir}/%{name}-%{version}
%{__cp} -a ri/javadoc/* %{buildroot}%{_javadocdir}/%{name}-%{version}
%{__ln_s} %{name}-%{version} %{buildroot}%{_javadocdir}/%{name}

%clean
%{__rm} -rf %{buildroot}

%post
%update_maven_depmap

%postun
%update_maven_depmap

%files
%defattr(0644,root,root,0755)
%doc license
%{_javadir}/%{name}-%{version}.jar
%{_javadir}/%{name}.jar
%{_javadir}/jsr305-%{version}.jar
%{_javadir}/jsr305.jar
%{_datadir}/maven2/poms/*
%config %{_mavendepmapfragdir}/*

%files javadoc
%defattr(0644,root,root,0755)
%{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}

%changelog
openSUSE Build Service is sponsored by