commit d3845d1982111103069857d94c0e584d6bce6f62 Author: Adrian Schröter Date: Mon Oct 14 14:26:57 2024 +0200 Sync from SUSE:ALP:Source:Standard:1.0 hamcrest revision 0ae0c8800126153adee84223ff73b991 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..fecc750 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/0001-Fix-build-with-OpenJDK-11.patch b/0001-Fix-build-with-OpenJDK-11.patch new file mode 100644 index 0000000..4e882e2 --- /dev/null +++ b/0001-Fix-build-with-OpenJDK-11.patch @@ -0,0 +1,131 @@ +From d33031924faa557bb43ba0471f74d942ddfeae50 Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +Date: Tue, 5 Nov 2019 14:50:23 +0100 +Subject: [PATCH] Fix build with OpenJDK 11 + +--- + .../src/main/java/org/hamcrest/collection/ArrayMatching.java | 3 ++- + .../org/hamcrest/collection/IsArrayContainingInAnyOrder.java | 2 +- + .../org/hamcrest/collection/IsArrayContainingInOrder.java | 2 +- + .../hamcrest/collection/IsIterableContainingInAnyOrder.java | 2 +- + .../collection/IsIterableContainingInRelativeOrder.java | 2 +- + hamcrest/src/main/java/org/hamcrest/core/AllOf.java | 2 +- + hamcrest/src/main/java/org/hamcrest/core/AnyOf.java | 2 +- + .../src/main/java/org/hamcrest/core/CombinableMatcher.java | 4 ++-- + 8 files changed, 10 insertions(+), 9 deletions(-) + +diff --git a/hamcrest/src/main/java/org/hamcrest/collection/ArrayMatching.java b/hamcrest/src/main/java/org/hamcrest/collection/ArrayMatching.java +index fc968e0..baab775 100644 +--- a/hamcrest/src/main/java/org/hamcrest/collection/ArrayMatching.java ++++ b/hamcrest/src/main/java/org/hamcrest/collection/ArrayMatching.java +@@ -67,7 +67,8 @@ public class ArrayMatching { + */ + @SafeVarargs + public static Matcher arrayContainingInAnyOrder(Matcher... itemMatchers) { +- return arrayContainingInAnyOrder(asList(itemMatchers)); ++ Collection> itemMatchersList = asList(itemMatchers); ++ return new ArrayAsIterableMatcher<>(new IsIterableContainingInAnyOrder<>(itemMatchersList), itemMatchersList, "in any order"); + } + + /** +diff --git a/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInAnyOrder.java b/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInAnyOrder.java +index 7e72a62..c0c7efc 100644 +--- a/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInAnyOrder.java ++++ b/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInAnyOrder.java +@@ -59,7 +59,7 @@ public class IsArrayContainingInAnyOrder extends TypeSafeMatcher { + * a list of matchers, each of which must be satisfied by an entry in an examined array + */ + public static Matcher arrayContainingInAnyOrder(Matcher... itemMatchers) { +- return arrayContainingInAnyOrder(Arrays.asList(itemMatchers)); ++ return new IsArrayContainingInAnyOrder(Arrays.asList(itemMatchers)); + } + + /** +diff --git a/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInOrder.java b/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInOrder.java +index c046914..2022f1a 100644 +--- a/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInOrder.java ++++ b/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInOrder.java +@@ -73,7 +73,7 @@ public class IsArrayContainingInOrder extends TypeSafeMatcher { + * the matchers that must be satisfied by the items in the examined array + */ + public static Matcher arrayContaining(Matcher... itemMatchers) { +- return arrayContaining(asList(itemMatchers)); ++ return new IsArrayContainingInOrder(asList(itemMatchers)); + } + + /** +diff --git a/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java b/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java +index d6a9a33..9a7e6c0 100644 +--- a/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java ++++ b/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java +@@ -98,7 +98,7 @@ public class IsIterableContainingInAnyOrder extends TypeSafeDiagnosingMatcher + */ + @SafeVarargs + public static Matcher> containsInAnyOrder(Matcher... itemMatchers) { +- return containsInAnyOrder(Arrays.asList(itemMatchers)); ++ return new IsIterableContainingInAnyOrder(Arrays.asList(itemMatchers)); + } + + /** +diff --git a/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInRelativeOrder.java b/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInRelativeOrder.java +index 0657768..06d6a57 100644 +--- a/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInRelativeOrder.java ++++ b/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInRelativeOrder.java +@@ -99,7 +99,7 @@ public class IsIterableContainingInRelativeOrder extends TypeSafeDiagnosingMa + */ + @SafeVarargs + public static Matcher> containsInRelativeOrder(Matcher... itemMatchers) { +- return containsInRelativeOrder(asList(itemMatchers)); ++ return new IsIterableContainingInRelativeOrder(asList(itemMatchers)); + } + + /** +diff --git a/hamcrest/src/main/java/org/hamcrest/core/AllOf.java b/hamcrest/src/main/java/org/hamcrest/core/AllOf.java +index b8c3faa..f8951bd 100644 +--- a/hamcrest/src/main/java/org/hamcrest/core/AllOf.java ++++ b/hamcrest/src/main/java/org/hamcrest/core/AllOf.java +@@ -56,6 +56,6 @@ public class AllOf extends DiagnosingMatcher { + */ + @SafeVarargs + public static Matcher allOf(Matcher... matchers) { +- return allOf(Arrays.asList(matchers)); ++ return new AllOf(Arrays.asList(matchers)); + } + } +diff --git a/hamcrest/src/main/java/org/hamcrest/core/AnyOf.java b/hamcrest/src/main/java/org/hamcrest/core/AnyOf.java +index 7a22c22..5a63574 100644 +--- a/hamcrest/src/main/java/org/hamcrest/core/AnyOf.java ++++ b/hamcrest/src/main/java/org/hamcrest/core/AnyOf.java +@@ -46,6 +46,6 @@ public class AnyOf extends ShortcutCombination { + */ + @SafeVarargs + public static AnyOf anyOf(Matcher... matchers) { +- return anyOf(Arrays.asList(matchers)); ++ return new AnyOf(Arrays.asList(matchers)); + } + } +diff --git a/hamcrest/src/main/java/org/hamcrest/core/CombinableMatcher.java b/hamcrest/src/main/java/org/hamcrest/core/CombinableMatcher.java +index e37efce..6b44884 100644 +--- a/hamcrest/src/main/java/org/hamcrest/core/CombinableMatcher.java ++++ b/hamcrest/src/main/java/org/hamcrest/core/CombinableMatcher.java +@@ -57,7 +57,7 @@ public class CombinableMatcher extends TypeSafeDiagnosingMatcher { + this.first = matcher; + } + public CombinableMatcher and(Matcher other) { +- return new CombinableMatcher<>(first).and(other); ++ return new CombinableMatcher<>(first).and((Matcher)other); + } + } + +@@ -76,7 +76,7 @@ public class CombinableMatcher extends TypeSafeDiagnosingMatcher { + this.first = matcher; + } + public CombinableMatcher or(Matcher other) { +- return new CombinableMatcher<>(first).or(other); ++ return new CombinableMatcher<>(first).or((Matcher)other); + } + } + } +-- +2.21.0 + diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..1b86902 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,27 @@ +BSD License + +Copyright (c) 2000-2015 www.hamcrest.org +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of +conditions and the following disclaimer. Redistributions in binary form must reproduce +the above copyright notice, this list of conditions and the following disclaimer in +the documentation and/or other materials provided with the distribution. + +Neither the name of Hamcrest nor the names of its contributors may be used to endorse +or promote products derived from this software without specific prior written +permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT +SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY +WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..57fbe8c --- /dev/null +++ b/README.md @@ -0,0 +1,63 @@ +![JavaHamcrest](http://hamcrest.org/images/logo.jpg) + +[![Build Status](https://travis-ci.org/hamcrest/JavaHamcrest.png?branch=master)](https://travis-ci.org/hamcrest/JavaHamcrest) + +Java Hamcrest +============= +Licensed under [BSD License][]. + +What is Hamcrest? +----------------- +Hamcrest is a library of matchers, which can be combined in to create flexible expressions of intent in tests. +They've also been used for other purposes. + +Downloads +--------- +You can obtain Hamcrest binaries from [maven central][]. + +Extensions +---------- + +For Hamcrest extension projects see the [hamcrest extensions page][]. + +Documentation +------------- +Documentation can be found on the [Hamcrest site](http://hamcrest.org). + +Reporting Bugs/Issues +--------------------- +If you find an issue with Java Hamcrest, please report it via the +[GitHub issue tracker](https://github.com/hamcrest/JavaHamcrest/issues), +after first checking that it hasn't been raised already. + +Source +------ +To build, please read BUILDING.txt + +Acknowledgements +---------------- +Developers: + + * Joe Walnes + * Nat Pryce + * Steve Freeman + +Contributors: + + * Robert Chatley + * Tom White + * Neil Dunn + * Dan North + * Magne Rasmussen + * David Saff + * Tom Denley + +Also, thanks to everyone who has worked on DynaMock, nMock, jMock, EasyMock and MiniMock! These libraries inspired Hamcrest. + + +[logo]: http://hamcrest.org/images/logo.jpg +[website]: https://github.com/hamcrest/JavaHamcrest +[BSD License]: http://opensource.org/licenses/BSD-3-Clause +[Maven central]: http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.hamcrest +[hamcrest extensions page]: https://github.com/hamcrest/JavaHamcrest/wiki/Related-Projects +[GitHub issue tracker]: https://github.com/hamcrest/JavaHamcrest/issues diff --git a/_service b/_service new file mode 100644 index 0000000..dfa1cda --- /dev/null +++ b/_service @@ -0,0 +1,19 @@ + + + git + https://github.com/hamcrest/JavaHamcrest.git + hamcrest + v2.2 + v* + @PARENT_TAG@ + v(.*) + hamcrest + *.gradle + + + *.tar + xz + + + + diff --git a/hamcrest-2.2.pom b/hamcrest-2.2.pom new file mode 100644 index 0000000..89489bc --- /dev/null +++ b/hamcrest-2.2.pom @@ -0,0 +1,35 @@ + + + 4.0.0 + org.hamcrest + hamcrest + 2.2 + Hamcrest + Core API and libraries of hamcrest matcher framework. + http://hamcrest.org/JavaHamcrest/ + + + BSD License 3 + http://opensource.org/licenses/BSD-3-Clause + + + + + joewalnes + Joe Walnes + + + npryce + Nat Pryce + + + sf105 + Steve Freeman + + + + git@github.com:hamcrest/JavaHamcrest.git + https://github.com/hamcrest/JavaHamcrest + + diff --git a/hamcrest-2.2.tar.xz b/hamcrest-2.2.tar.xz new file mode 100644 index 0000000..68b939a --- /dev/null +++ b/hamcrest-2.2.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4dc070ac5ca508d33ff80e44b61dfd755764014b119462d5a6e80c22494ce9ce +size 51684 diff --git a/hamcrest-build.xml b/hamcrest-build.xml new file mode 100644 index 0000000..74681b8 --- /dev/null +++ b/hamcrest-build.xml @@ -0,0 +1,210 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + =================================== WARNING =================================== + JUnit is not present in the test classpath or your $ANT_HOME/lib directory. Tests not executed. + =============================================================================== + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hamcrest.changes b/hamcrest.changes new file mode 100644 index 0000000..204ef28 --- /dev/null +++ b/hamcrest.changes @@ -0,0 +1,225 @@ +------------------------------------------------------------------- +Thu Jun 9 16:00:32 UTC 2022 - Fridrich Strba + +- Upgrade to upstream version 2.2 + * After a long hiatus without releases, this version simplifies + the packaging of Hamcrest into a single jar. Other big changes + include Java 9 module compatibility, along with numerous other + improvements and bug fixes. + * Breaking Changes + + Although the class API has not changed since Hamcrest 1.3, the + way that the project is packaged has changed. Refer to the + Hamcrest Distributables documentation for more information, + and in particular the section on Upgrading from Hamcrest 1.x + + The org.hamcrest.Factory annotation has been removed + (it should not be used in client code) + * Improvements + + AllOf/AnyOf: Pass the matchers to constructor using varargs + + Matchers.anyOf: Fix generic bounds compatibility for JDK 11 + + AssertionError message is unhelpful when match fails for byte + type + + Use platform specific line breaks + + Build now checks for consistent use of spaces + * Changes + + Fix compatibility issue for development with Android D8 + + Fix typo in license name + + 1.3 compatible constructors for string matchers + + Fix for split packages with Java 9 modules + + Documentation updates + + Add implementation for CharSequence length matcher + + Fix for TypeSafeDiagnosingMatcher can't detect generic types + for subclass + + Renamed IsCollectionContaining to IsIterableContaining + + Make Hamcrest an OSGI bundle + + Add StringRegularExpression matcher + + Fix StringContainsInOrder to detect if a repeated pattern is + missing + + Add ArrayAsIterableMatcher + + Fix description for IsEqualIgnoringCase + + Fix JavaDoc examples + + Upgraded to Java 7 + + Build with Gradle + + Deprecate IsCollectionContaining and IsArrayContainingXXX + + Removed deprecated methods from previous release + + Improve mismatch description of hasItem/hasItems + + General improvements to mismatch descriptions + + Several JavaDoc improvements and corrections + + Deprecated several matcher factory methods of the for "isXyz" + + Fix address doclint errors reported in JDK 1.8 + + Fix Iterable contains in order is null-safe + + Added equalToObject() (i.e. unchecked) method + + Fix arrayContaining(null, null) cause NullPointerException + * Fix string matching on regular expressions + * Fix isCloseTo() shows wrong delta in mismatch description + * Fix add untyped version of equalTo, named equalToObject + * Implement IsEmptyMap, IsMapWithSize + * Fix IsArray.describeMismatchSafely() should use + Matcher.describeMismatch + * Add Matcher implementation for files + * Fix NPE in IsIterableContainingInOrder +- Removed patches: + * hamcrest-1.3-build.patch + * hamcrest-1.3-fork-javac.patch + * hamcrest-1.3-javadoc.patch + * hamcrest-1.3-javadoc10.patch + * hamcrest-1.3-javadoc9.patch + * hamcrest-1.3-no-jarjar.patch + * hamcrest-1.3-qdox-2.0.patch + * hamcrest-1.3-random-build-crash.patch + * hamcrest-reproducible-builds.patch + + not needed with the new version +- Modified patch: + * hamcrest-matchers.patch -> 0001-Fix-build-with-OpenJDK-11.patch + + adapt to the changed context + +------------------------------------------------------------------- +Fri Mar 18 20:25:15 UTC 2022 - Fridrich Strba + +- Modified patch: + * hamcrest-1.3-build.patch + + Build with source/target levels 8 +- Added patch: + * hamcrest-matchers.patch + + Fix build with jdk17 + +------------------------------------------------------------------- +Tue Jan 5 13:20:25 UTC 2021 - Pedro Monreal + +- Make hamcrest build reproducibly [bsc#1120493] +- Add hamcrest-reproducible-builds.patch + +------------------------------------------------------------------- +Tue Jan 5 13:01:10 UTC 2021 - Pedro Monreal + +- Fix typo in hamcrest-core description [bsc#1179994] + +------------------------------------------------------------------- +Thu Nov 19 12:48:02 UTC 2020 - Pedro Monreal + +- Fix RPM Lint complaint: summary-ended-with-dot + +------------------------------------------------------------------- +Tue Nov 17 17:39:48 UTC 2020 - Pedro Monreal + +- Add obsoletes in core to fix updates. [bsc#1174544] + +------------------------------------------------------------------- +Wed Oct 2 20:24:49 UTC 2019 - Fridrich Strba + +- Remove references to the hamcrest-parent pom and do not + distribute it + * useless since we don't build with maven + * creates problems with gradle connector + +------------------------------------------------------------------- +Tue Jan 15 08:52:39 UTC 2019 - Fridrich Strba + +- Make jmock and easymock integration opt-in (bsc#1121956) + +------------------------------------------------------------------- +Fri Jan 4 16:13:17 UTC 2019 - Fridrich Strba + +- Use sources from github, which are accessible +- Do not build the hamcrest-text empty jar +- Split a core package off the main package +- Added patch: + * hamcrest-1.3-qdox-2.0.patch + + Fix build against QDox 2.0 +- Removed patch: + * hamcrest-1.3-no-integration.patch + + Not needed any more since integration is buildable +- Modified patches: + * hamcrest-1.3-build.patch + * hamcrest-1.3-fork-javac.patch + * hamcrest-1.3-javadoc.patch + * hamcrest-1.3-javadoc10.patch + * hamcrest-1.3-javadoc9.patch + * hamcrest-1.3-no-jarjar.patch + * hamcrest-1.3-random-build-crash.patch + +------------------------------------------------------------------- +Mon Dec 18 06:53:19 UTC 2017 - fstrba@suse.com + +- Added patch: + * hamcrest-1.3-javadoc10.patch + + Fix build with jdk10's javadoc that ends in error when a + link cannot be downloaded + +------------------------------------------------------------------- +Fri Sep 8 06:05:24 UTC 2017 - fstrba@suse.com + +- Modified patch: + * hamcrest-1.3-fork-javac.patch + + Specify java target level 1.6 in order to allow building + with jdk9 +- Specify java source level 1.6 in order to allow building with + jdk9 +- Added patch: + * hamcrest-1.3-javadoc9.patch + + fix javadoc errors that are fatal in jdk9 + +------------------------------------------------------------------- +Mon May 29 16:05:25 UTC 2017 - tchvatal@suse.com + +- Apply patch from fedora: + * hamcrest-1.3-fork-javac.patch + +------------------------------------------------------------------- +Fri May 19 13:11:37 UTC 2017 - tchvatal@suse.com + +- Fix homepage +- Update to build with new javapacakges-tools + +------------------------------------------------------------------- +Wed Mar 18 09:46:07 UTC 2015 - tchvatal@suse.com + +- Fix build with new javapackages-tools + +------------------------------------------------------------------- +Mon Jul 7 15:02:47 UTC 2014 - tchvatal@suse.com + +- Use junit not junit4 + +------------------------------------------------------------------- +Mon Jun 16 12:25:07 UTC 2014 - tchvatal@suse.com + +- Add patch to fix random build errors by enforcing single thread. + * hamcrest-1.3-random-build-crash.patch + +------------------------------------------------------------------- +Tue Oct 29 12:51:11 UTC 2013 - mvyskocil@suse.com + +- drop junit from dependencies, it's not needed and cause a build cycle + +------------------------------------------------------------------- +Mon Oct 21 11:34:31 UTC 2013 - mvyskocil@suse.com + +- Update to 1.3 + bugfix and feature update, see CHANGES.txt for details +- Removed patches + * hamcrest-1.1-build.patch + + renamed to hamcrest-1.3-build.patch + * hamcrest-1.1-no-jarjar.patch + + renamed to hamcrest-1.3-no-jarjar.patch + * hamcrest-1.1-no-integration.patch + + renamed to hamcrest-1.3-no-integration.patch +- Added patches + * hamcrest-1.3-javadoc.patch +- Updated poms and added OSGI manifests from Fedora + +------------------------------------------------------------------- +Mon Sep 9 11:05:43 UTC 2013 - tchvatal@suse.com + +- Move from jpackage-utils to javapackage-tools + +------------------------------------------------------------------- +Tue Sep 3 14:23:47 UTC 2013 - mvyskocil@suse.com + +- use add_maven_depmap from javapackages-tools +- install non-versioned dirs and jars + +------------------------------------------------------------------- +Tue May 5 14:53:21 CEST 2009 - mvyskocil@suse.cz + +- Initial packaging of 1.1 in SUSE (from jpp 5.0) + diff --git a/hamcrest.spec b/hamcrest.spec new file mode 100644 index 0000000..fdee3b9 --- /dev/null +++ b/hamcrest.spec @@ -0,0 +1,99 @@ +# +# spec file for package hamcrest +# +# Copyright (c) 2022 SUSE LLC +# +# 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/ +# + + +%bcond_with tests +Name: hamcrest +Version: 2.2 +Release: 0 +Summary: Library of matchers for building test expressions +License: BSD-3-Clause +Group: Development/Libraries/Java +URL: https://github.com/hamcrest/JavaHamcrest +Source0: %{name}-%{version}.tar.xz +Source1: %{name}-build.xml +Source2: https://repo1.maven.org/maven2/org/hamcrest/%{name}/%{version}/%{name}-%{version}.pom +Source3: https://raw.githubusercontent.com/hamcrest/JavaHamcrest/v2.2/LICENSE.txt +Source4: https://raw.githubusercontent.com/hamcrest/JavaHamcrest/v2.2/README.md +Patch0: 0001-Fix-build-with-OpenJDK-11.patch +BuildRequires: ant +BuildRequires: fdupes +BuildRequires: java-devel >= 1.8 +BuildRequires: javapackages-local +%if %{with tests} +BuildRequires: ant-junit +%endif +Provides: %{name}-core = %{version} +Obsoletes: %{name}-core < %{version} +Obsoletes: %{name}-demo < %{version} +BuildArch: noarch + +%description +Provides a library of matcher objects (also known as constraints or +predicates) allowing 'match' rules to be defined declaratively, to be +used in other frameworks. Typical scenarios include testing frameworks, +mocking libraries and UI validation rules. + +%package javadoc +Summary: Javadoc for %{name} +Group: Documentation/HTML + +%description javadoc +Javadoc for %{name}. + +%prep +%setup -q -n %{name}-%{version} +cp %{SOURCE1} build.xml +cp %{SOURCE3} %{SOURCE4} . + +%patch0 -p2 + +%build +%ant \ +%if %{without tests} + -Dtest.skip=true \ +%endif + jar javadoc + +%install +# jars +install -dm 0755 %{buildroot}%{_javadir}/%{name} +install -pm 0644 target/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}/%{name}.jar +ln -sf %{name}.jar %{buildroot}%{_javadir}/%{name}/all.jar +ln -sf %{name}.jar %{buildroot}%{_javadir}/%{name}/core.jar +ln -sf %{name}.jar %{buildroot}%{_javadir}/%{name}/library.jar + +# poms +install -dm 0755 %{buildroot}%{_mavenpomdir}/%{name} +install -pm 0644 %{SOURCE2} %{buildroot}%{_mavenpomdir}/%{name}/%{name}.pom +%add_maven_depmap %{name}/%{name}.pom %{name}/%{name}.jar -a "org.hamcrest:hamcrest-all,org.hamcrest:hamcrest-core,org.hamcrest:hamcrest-library" + +# javadoc +install -dm 0755 %{buildroot}%{_javadocdir}/%{name} +cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name} +%fdupes -s %{buildroot}%{_javadocdir} + +%files -f .mfiles +%{_javadir}/%{name} +%license LICENSE.txt +%doc README.md + +%files javadoc +%license LICENSE.txt +%{_javadocdir}/%{name} + +%changelog