Accepting request 1074021 from Java:packages

Conditionalize the spec file a bit

OBS-URL: https://build.opensuse.org/request/show/1074021
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/junit?expand=0&rev=29
This commit is contained in:
Dominique Leuenberger 2023-03-25 17:54:52 +00:00 committed by Git OBS Bridge
commit 42b826a45a
2 changed files with 15 additions and 3 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Mar 23 17:18:10 UTC 2023 - Fridrich Strba <fstrba@suse.com>
- 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 <fstrba@suse.com>

View File

@ -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,7 +28,7 @@ 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)
@ -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