diff --git a/.gitignore b/.gitignore index 4a0c58f..b22ba9d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /1.11.3.tar.gz +/scalacheck-*.tar.gz diff --git a/Generate.java b/Generate.java new file mode 100644 index 0000000..7a12c5a --- /dev/null +++ b/Generate.java @@ -0,0 +1,41 @@ +/* Copyright (c) 2021 Jerry James + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +import java.io.FileWriter; +import java.io.IOException; +import scala.collection.immutable.Seq; + +public class Generate { + public static void main(String args[]) { + Seq files = codegen.genAll(); + for (int i = 0; i < files.length(); i++) { + GeneratedFile gen = files.apply(i); + try { + FileWriter f = new FileWriter(args[0] + "/" + gen.name()); + f.write(gen.code()); + f.close(); + } catch (IOException e) { + System.err.println("Failed to generate " + gen.name()); + System.err.println(e.toString()); + System.exit(1); + } + } + } +} diff --git a/scalacheck-1.11.3-ant-build.patch b/scalacheck-1.11.3-ant-build.patch deleted file mode 100644 index 1ef4505..0000000 --- a/scalacheck-1.11.3-ant-build.patch +++ /dev/null @@ -1,77 +0,0 @@ ---- upstream/build.xml 2014-01-22 00:41:09.000000000 +0100 -+++ gil/build.xml 2014-01-28 07:00:38.008161208 +0100 -@@ -1,46 +1,16 @@ - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -+ basedir="." default="build"> - -+ -+ -+ -+ -+ -+ -+ -+ -+ - - - -@@ -122,7 +92,7 @@ - - -+ value="${user.name}"/> - -@@ -144,7 +114,7 @@ - - - -- -+ -
- - diff --git a/scalacheck.mf b/scalacheck.mf new file mode 100644 index 0000000..9f1acc3 --- /dev/null +++ b/scalacheck.mf @@ -0,0 +1,8 @@ +Specification-Title: scalacheck +Specification-Vendor: org.scalacheck +Specification-Version: @VERSION@ +Implementation-Title: scalacheck +Implementation-URL: http://www.scalacheck.org +Implementation-Vendor: org.scalacheck +Implementation-Vendor-Id: org.scalacheck +Implementation-Version: @VERSION@ diff --git a/scalacheck.spec b/scalacheck.spec index a61a452..36501ae 100644 --- a/scalacheck.spec +++ b/scalacheck.spec @@ -1,39 +1,35 @@ -%global scalacheck_version 1.11.3 -%global scala_version 2.10 -%global SBT 0 -%global ANT 1 -%global build_style %{ANT} +# This package is a component of sbt, but needs sbt to build. Use this to +# bootstrap when sbt is not available. +%bcond_with sbt + +# Scal build version +%global scala_version 2.13 Name: scalacheck -Version: %{scalacheck_version} -Release: 17%{?dist} -Summary: property-based testing for Scala +Version: 1.15.2 +Release: 1%{?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 +URL: http://www.scalacheck.org/ +Source0: https://github.com/typelevel/scalacheck/archive/%{version}/%{name}-%{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 +%if %{without sbt} # 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 +Source1: https://repo1.maven.org/maven2/org/scalacheck/%{name}_%{scala_version}/%{version}/%{name}_%{scala_version}-%{version}.pom +Source2: %{name}.mf +Source3: Generate.java %endif BuildArch: noarch -BuildRequires: scala -%if %{build_style} == %{SBT} -BuildRequires: sbt + +BuildRequires: maven-local +BuildRequires: mvn(org.scala-sbt:test-interface) +%if %{without sbt} +BuildRequires: mvn(org.scala-lang:scala-compiler) %else -BuildRequires: ant +BuildRequires: sbt %endif -BuildRequires: mvn(org.scala-sbt:test-interface) -BuildRequires: javapackages-local - %description ScalaCheck is a library written in Scala and used for automated @@ -47,67 +43,58 @@ 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 +%autosetup -%if %{build_style} == %{SBT} +%if %{with 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} +%if %{without sbt} +# Generate files +GENDIR=$PWD/src/main/scala/org/scalacheck +cd project +cp -p %{SOURCE3} . +CLASSPATH=.:$(build-classpath scala/scala-library) +scalac -g:vars codegen.scala +javac -cp $CLASSPATH Generate.java +java -cp $CLASSPATH Generate $GENDIR +cd - + +# Build the jar +mkdir target +files="project/codegen.scala $(find src/main/scala -name \*.scala)" +files="$files $(find src/main/scala-2.13+ -name \*.scala)" +files="$files $(find jvm/src/main -name \*.scala)" +scalac -g:vars -release 11 -classpath $(build-classpath test-interface) \ + -d target $files +cd target +sed 's/@VERSION@/%{version}/g' %{SOURCE2} > %{name}.mf +jar -c -m %{name}.mf -f %{name}.jar org +cd - +%mvn_artifact %{SOURCE1} target/%{name}.jar +%else 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 +%mvn_install %files -f .mfiles -%doc README.markdown RELEASE -%license LICENSE - -%files javadoc -f .mfiles-javadoc +%doc CHANGELOG.markdown README.markdown doc/UserGuide.md %license LICENSE %changelog +* Mon Jan 11 2021 Jerry James - 1.15.2-1 +- Version 1.15.2 + * Sat Aug 01 2020 Fedora Release Engineering - 1.11.3-17 - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild diff --git a/scalacheck_2.10-1.11.3.pom b/scalacheck_2.10-1.11.3.pom deleted file mode 100644 index 6700f34..0000000 --- a/scalacheck_2.10-1.11.3.pom +++ /dev/null @@ -1,44 +0,0 @@ - - - 4.0.0 - org.scalacheck - scalacheck_2.10 - jar - scalacheck - http://www.scalacheck.org - 1.11.3 - - - BSD-style - http://www.opensource.org/licenses/bsd-license.php - repo - - - scalacheck - - org.scalacheck - http://www.scalacheck.org - - - https://github.com/rickynils/scalacheck - scm:git:git@github.com:rickynils/scalacheck.git - - - - rickynils - Rickard Nilsson - - - - - org.scala-lang - scala-library - 2.10.3 - - - org.scala-sbt - test-interface - 1.0 - - - \ No newline at end of file diff --git a/scalacheck_2.13-1.15.2.pom b/scalacheck_2.13-1.15.2.pom new file mode 100644 index 0000000..02f5890 --- /dev/null +++ b/scalacheck_2.13-1.15.2.pom @@ -0,0 +1,46 @@ + + + 4.0.0 + org.scalacheck + scalacheck_2.13 + jar + scalacheck + http://www.scalacheck.org + 1.15.2 + + + BSD 3-clause + https://opensource.org/licenses/BSD-3-Clause + repo + + + scalacheck + + org.scalacheck + http://www.scalacheck.org + + + https://github.com/typelevel/scalacheck + scm:git:git@github.com:typelevel/scalacheck.git + + + + rickynils + Rickard Nilsson + https://github.com/rickynils + rickynils@gmail.com + + + + + org.scala-lang + scala-library + 2.13.3 + + + org.scala-sbt + test-interface + 1.0 + + + \ No newline at end of file diff --git a/sources b/sources index e599e54..119d8e9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -4cd3d734f1bc8287b8fbff28be6e5cff 1.11.3.tar.gz +SHA512 (scalacheck-1.15.2.tar.gz) = c2f0c9779836ebe29f83ba7f634d4e86f61e73ebea2fd509f0208a3c32dd1442ee0c4e638a22ba27dbe2cd1bff6feea9c0ebc0be2eade92b5253f1771e477868