2013-10-25 09:57:46 +02:00
|
|
|
#
|
|
|
|
# spec file for package junit
|
|
|
|
#
|
2022-03-18 17:38:20 +01:00
|
|
|
# Copyright (c) 2022 SUSE LLC
|
2013-10-25 09:57:46 +02:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2018-10-17 22:01:53 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2013-10-25 09:57:46 +02:00
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
Name: junit
|
2021-12-12 15:40:50 +01:00
|
|
|
Version: 4.13.2
|
2013-10-25 09:57:46 +02:00
|
|
|
Release: 0
|
|
|
|
Summary: Java regression test package
|
2019-02-05 07:28:06 +01:00
|
|
|
License: EPL-1.0
|
2013-10-25 09:57:46 +02:00
|
|
|
Group: Development/Libraries/Java
|
2021-12-12 15:40:50 +01:00
|
|
|
URL: https://junit.org/junit4/
|
|
|
|
Source0: https://github.com/junit-team/junit4/archive/r%{version}.tar.gz
|
2018-12-26 07:32:28 +01:00
|
|
|
Source1: build.xml
|
2022-06-09 20:12:21 +02:00
|
|
|
Patch0: 0001-Port-to-hamcrest-2.2.patch
|
2013-10-25 09:57:46 +02:00
|
|
|
BuildRequires: ant
|
2017-12-18 16:41:23 +01:00
|
|
|
BuildRequires: fdupes
|
2020-04-07 14:41:33 +02:00
|
|
|
BuildRequires: hamcrest >= 1.3
|
2022-03-18 17:38:20 +01:00
|
|
|
BuildRequires: java-devel >= 1.8
|
2017-05-19 12:10:59 +02:00
|
|
|
BuildRequires: javapackages-local
|
2019-02-05 10:29:08 +01:00
|
|
|
Requires: mvn(org.hamcrest:hamcrest-core)
|
2019-02-04 18:16:57 +01:00
|
|
|
Provides: %{name}-demo = %{version}-%{release}
|
|
|
|
Obsoletes: %{name}-demo < %{version}-%{release}
|
|
|
|
Provides: %{name}4-demo = %{version}-%{release}
|
|
|
|
Obsoletes: %{name}4-demo < %{version}-%{release}
|
|
|
|
Provides: %{name}4 = %{version}-%{release}
|
|
|
|
Obsoletes: %{name}4 < %{version}-%{release}
|
2015-03-18 11:07:47 +01:00
|
|
|
BuildArch: noarch
|
2013-10-25 09:57:46 +02:00
|
|
|
|
|
|
|
%description
|
2015-03-18 11:07:47 +01:00
|
|
|
JUnit is a regression testing framework written by Erich Gamma and Kent Beck.
|
2019-01-22 06:47:07 +01:00
|
|
|
It is used by the developer who implements unit tests in Java.
|
2013-10-25 09:57:46 +02:00
|
|
|
|
|
|
|
%package javadoc
|
|
|
|
Summary: Javadoc for %{name}
|
|
|
|
Group: Documentation/HTML
|
2019-02-04 18:16:57 +01:00
|
|
|
Provides: %{name}4-javadoc = %{version}-%{release}
|
|
|
|
Obsoletes: %{name}4-javadoc < %{version}-%{release}
|
2013-10-25 09:57:46 +02:00
|
|
|
|
2018-12-26 07:32:28 +01:00
|
|
|
%description javadoc
|
|
|
|
Javadoc for %{name}.
|
2013-10-25 09:57:46 +02:00
|
|
|
|
2019-02-04 18:16:57 +01:00
|
|
|
%package manual
|
|
|
|
Summary: Manual for %{name}
|
|
|
|
Group: Documentation/Other
|
|
|
|
Provides: %{name}4-manual = %{version}-%{release}
|
|
|
|
Obsoletes: %{name}4-manual < %{version}-%{release}
|
|
|
|
|
|
|
|
%description manual
|
|
|
|
Documentation for %{name}.
|
|
|
|
|
2013-10-25 09:57:46 +02:00
|
|
|
%prep
|
2019-02-04 18:16:57 +01:00
|
|
|
%setup -q -n %{name}4-r%{version}
|
2022-06-09 20:12:21 +02:00
|
|
|
%patch0 -p1
|
2018-12-26 07:32:28 +01:00
|
|
|
cp %{SOURCE1} .
|
2013-10-25 09:57:46 +02:00
|
|
|
|
|
|
|
find . -type f -name "*.jar" -or -name "*.class" | xargs -t rm -rf
|
|
|
|
|
2020-04-07 14:41:33 +02:00
|
|
|
ln -s $(build-classpath hamcrest/all) lib/hamcrest-core-1.3.jar
|
2013-10-25 09:57:46 +02:00
|
|
|
|
|
|
|
%build
|
2020-04-07 14:41:33 +02:00
|
|
|
export CLASSPATH=$(build-classpath hamcrest/all)
|
2018-12-26 07:32:28 +01:00
|
|
|
ant jars javadoc -Dversion-status=
|
2013-10-25 09:57:46 +02:00
|
|
|
|
|
|
|
%install
|
|
|
|
# jars
|
|
|
|
install -d -m 755 %{buildroot}%{_javadir}
|
2021-12-12 16:46:24 +01:00
|
|
|
install -m 644 %{name}%{version}/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
|
2013-10-25 09:57:46 +02:00
|
|
|
# compat symlink
|
2019-02-04 18:16:57 +01:00
|
|
|
ln -sf %{_javadir}/%{name}.jar %{buildroot}%{_javadir}/%{name}4.jar
|
2013-10-25 09:57:46 +02:00
|
|
|
|
|
|
|
# pom
|
|
|
|
install -d -m 755 %{buildroot}%{_mavenpomdir}
|
2019-02-04 18:16:57 +01:00
|
|
|
install -m 644 pom.xml %{buildroot}%{_mavenpomdir}/%{name}.pom
|
|
|
|
%add_maven_depmap %{name}.pom %{name}.jar
|
2013-10-25 09:57:46 +02:00
|
|
|
|
|
|
|
# javadoc
|
|
|
|
install -d -m 755 %{buildroot}%{_javadocdir}/%{name}
|
2021-12-12 16:46:24 +01:00
|
|
|
cp -pr %{name}%{version}/javadoc/* %{buildroot}%{_javadocdir}/%{name}
|
2017-12-18 16:41:23 +01:00
|
|
|
%fdupes -s %{buildroot}%{_javadocdir}/%{name}
|
2013-10-25 09:57:46 +02:00
|
|
|
|
|
|
|
%check
|
|
|
|
|
|
|
|
cat > test.java <<EOF
|
2017-12-18 16:37:54 +01:00
|
|
|
import org.junit.Assert;
|
2013-10-25 09:57:46 +02:00
|
|
|
class test {
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
Assert.fail("Hello world from junit");
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
javac -cp %{buildroot}/%{_javadir}/%{name}.jar test.java
|
2017-12-18 16:37:54 +01:00
|
|
|
java -cp %{buildroot}/%{_javadir}/%{name}.jar: test 2>&1 | \
|
|
|
|
grep 'Exception in thread "main" java.lang.AssertionError: Hello world from junit'
|
2013-10-25 09:57:46 +02:00
|
|
|
|
2019-02-04 18:16:57 +01:00
|
|
|
%files -f .mfiles
|
|
|
|
%license LICENSE-junit.txt
|
|
|
|
%doc CODING_STYLE.txt README.md acknowledgements.txt
|
|
|
|
%{_javadir}/%{name}4.jar
|
2013-10-25 09:57:46 +02:00
|
|
|
|
|
|
|
%files javadoc
|
2019-02-04 18:16:57 +01:00
|
|
|
%license LICENSE-junit.txt
|
2013-10-25 09:57:46 +02:00
|
|
|
%{_javadocdir}/%{name}
|
|
|
|
|
2019-02-04 18:16:57 +01:00
|
|
|
%files manual
|
|
|
|
%license LICENSE-junit.txt
|
|
|
|
%doc doc/*
|
|
|
|
|
2013-10-25 09:57:46 +02:00
|
|
|
%changelog
|