jsr-305/jsr-305.spec

99 lines
3.0 KiB
RPMSpec

%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}-%{release}-root
%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
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