From d02353b840aecc8f85bf0e6e82235be7443bc6edcc0a271742627bacd369bbd3 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Thu, 23 Mar 2023 17:21:24 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/Java:packages/junit?expand=0&rev=49 --- junit.changes | 6 ++++++ junit.spec | 14 ++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/junit.changes b/junit.changes index 50fc62d..2b89d67 100644 --- a/junit.changes +++ b/junit.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Mar 23 17:18:10 UTC 2023 - Fridrich Strba + +- Conditionalize the spec file so that junit can be built with + both hamcrest 1.3 and 2.2 from the same sources + ------------------------------------------------------------------- Thu Jun 9 18:02:17 UTC 2022 - Fridrich Strba diff --git a/junit.spec b/junit.spec index a665c3b..2609063 100644 --- a/junit.spec +++ b/junit.spec @@ -1,7 +1,7 @@ # # spec file for package junit # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -28,10 +28,10 @@ Source1: build.xml Patch0: 0001-Port-to-hamcrest-2.2.patch BuildRequires: ant BuildRequires: fdupes -BuildRequires: hamcrest >= 2.2 +BuildRequires: hamcrest >= 1.3 BuildRequires: java-devel >= 1.8 BuildRequires: javapackages-local -Requires: mvn(org.hamcrest:hamcrest-core) +%requires_ge hamcrest Provides: %{name}-demo = %{version}-%{release} Obsoletes: %{name}-demo < %{version}-%{release} Provides: %{name}4-demo = %{version}-%{release} @@ -64,15 +64,21 @@ Documentation for %{name}. %prep %setup -q -n %{name}4-r%{version} +%if %{?pkg_vcmp:%pkg_vcmp hamcrest >= 2.0}%{!?pkg_vcmp:0} %patch0 -p1 +%endif cp %{SOURCE1} . find . -type f -name "*.jar" -or -name "*.class" | xargs -t rm -rf +%if %{?pkg_vcmp:%pkg_vcmp hamcrest >= 2.0}%{!?pkg_vcmp:0} ln -s $(build-classpath hamcrest/hamcrest) lib/hamcrest-core-1.3.jar +%else +ln -s $(build-classpath hamcrest/all) lib/hamcrest-core-1.3.jar +%endif %build -export CLASSPATH=$(build-classpath hamcrest/hamcrest) +export CLASSPATH=$(build-classpath hamcrest) ant jars javadoc -Dversion-status= %install