Blob Blame History Raw
%global scalacheck_version 1.11.3
%global scala_version 2.10
%global SBT 0
%global ANT 1
%global build_style %{ANT}

Name:           scalacheck
Version:        %{scalacheck_version}
Release:        6%{?dist}
Summary:        property-based testing for Scala

License:        BSD
URL:            http://www.scalacheck.org
Source0:        https://github.com/rickynils/scalacheck/archive/%{scalacheck_version}.tar.gz

%if %{build_style} == %{SBT}
# remove cross-compilation (not supported for Fedora) and
# binary-compatibility testing (due to unsupported deps)
Patch0:        scalacheck-1.11.0-build.patch
%else
# We don't generate a POM from the ant build
Source1:       http://repo1.maven.org/maven2/org/scalacheck/%{name}_%{scala_version}/%{version}/%{name}_%{scala_version}-%{version}.pom
# remove maven-ant-tasks
Patch0:        scalacheck-1.11.3-ant-build.patch
%endif

BuildArch:      noarch
BuildRequires:  scala
%if %{build_style} == %{SBT}
BuildRequires:  sbt
%else
BuildRequires:  ant
%endif
BuildRequires:  mvn(org.scala-sbt:test-interface)
BuildRequires:  javapackages-local


%description
ScalaCheck is a library written in Scala and used for automated
property-based testing of Scala or Java programs. ScalaCheck was
originally inspired by the Haskell library QuickCheck, but has also
ventured into its own.

ScalaCheck has no external dependencies other than the Scala runtime,
and works great with sbt, the Scala build tool. It is also fully
integrated in the test frameworks ScalaTest and specs2. You can of
course also use ScalaCheck completely standalone, with its built-in
test runner.

%package javadoc
Summary:        Javadoc for %{name}

%description javadoc
Javadoc for %{name}.

%prep
%setup -q
find . -name \*.class -delete
find . -name \*.jar -delete

%if %{build_style} == %{SBT}
cp -r /usr/share/java/sbt/ivy-local .
mkdir boot
%else

%endif

%patch0 -p1

%if %{build_style} == %{SBT}
sed -i -e 's/0[.]13[.]0/0.13.1/g' project/build.properties
%endif

%mvn_file org.%{name}:%{name}_%{scala_version} %{name}

%build

%if %{build_style} == %{SBT}
export SBT_BOOT_DIR=$PWD/boot
export SBT_IVY_DIR=$PWD/ivy-local
sbt package deliverLocal publishM2Configuration
%mvn_artifact target/scala-%{scala_version}/%{name}_%{scala_version}-%{version}.pom target/scala-%{scala_version}/%{name}_%{scala_version}-%{version}.jar
%else
ant -Dversion=%{version} jar doc
%mvn_artifact %{SOURCE1} target/%{name}-%{version}.jar
%endif

%install

%if %{build_style} == %{SBT}

%mvn_install -J target/scala-%{scala_version}/api

%else
%mvn_install -J target/doc/main/api

# We only run %%check in an ant build at the moment
%check
ant test

%endif

%files -f .mfiles
%doc README.markdown RELEASE
%license LICENSE

%files javadoc -f .mfiles-javadoc
%license LICENSE

%changelog
* Thu Aug 06 2015 gil cattaneo <puntogil@libero.it> 1.11.3-6
- Fix FTBFS RHBZ#1107280
- Introduce license macro

* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.11.3-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.11.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Mon Feb 10 2014 William Benton <willb@redhat.com> - 1.11.3-3
- rebuild

* Thu Jan 30 2014 William Benton <willb@redhat.com> - 1.11.3-2 
- rebuild now that all of our dependencies are in stable

* Wed Jan 29 2014 William Benton <willb@redhat.com> - 1.11.3-1 
- added optional but on-by-default Ant build (thanks to Gil Cattaneo for contributing this!)

* Mon Dec 23 2013 William Benton <willb@redhat.com> - 1.11.0-1 
- initial package