File jtharness.spec of Package jtharness

#
# spec file for package jtharness
#
# 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
# 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/
#


%global harness_version 6.0
%global harness_buildnum 26
Name:           jtharness
Version:        %{harness_version}~%{harness_buildnum}
Release:        0
Summary:        OpenJDK JT Harness
License:        GPL-2.0-only WITH Classpath-exception-2.0
Group:          Development/Libraries/Java
URL:            https://github.com/openjdk/jtharness
Source0:        https://github.com/openjdk/jtharness/archive/refs/tags/jt%{harness_version}-b%{harness_buildnum}.tar.gz
BuildRequires:  ant
BuildRequires:  apache-ivy
BuildRequires:  fdupes
BuildRequires:  glassfish-servlet-api
BuildRequires:  junit
BuildRequires:  objectweb-asm
BuildRequires:  rxtx-java
BuildArch:      noarch

%description
The JT harness is a general purpose, fully-featured,
flexible, and configurable test harness. Originally
developed as a test harness to run TCK test suites,
it has since evolved into a general purpose test platform.

%package examples
Summary:        Examples for %{name}
Group:          Documentation/HTML
Requires:       %{name}

%description examples
This package contains examples for %{name}.

%package doc
Summary:        Documentation for %{name}
Group:          Documentation/HTML
Requires:       %{name}

%description doc
This package contains documentation for %{name}.

%prep
%setup -q -n %{name}-jt%{harness_version}-b%{harness_buildnum}

%build
pushd build
ant \
    -Djavadoc.additionalparam="-notimestamp" \
    -Dasmjar=$(find-jar objectweb-asm/asm) \
    -Dasmcommonsjar=$(find-jar objectweb-asm/asm-commons) \
    -Djunitlib=$(find-jar junit) \
    -Djcommjar=$(find-jar RXTXcomm) \
    -Divylib=$(find-jar ivy) \
    -Dservletjar=$(find-jar glassfish-servlet-api) \
    -Djar.junit.dependencies.present=true \
    -DBUILD_DIR=%{name}-build dist
popd

%install
install -dm 0755 %{buildroot}%{_datadir}/%{name}
cp -rL %{name}-build/binaries/* %{buildroot}%{_datadir}/%{name}/
%fdupes -s %{buildroot}%{_datadir}/%{name}/doc

%files
%{_datadir}/%{name}/lib
%exclude %{_datadir}/%{name}/legal
%exclude %{_datadir}/%{name}/LICENSE
%{_datadir}/%{name}/release
%dir %{_datadir}/%{name}
%doc README.md
%license LICENSE legal/copyright.txt

%files examples
%{_datadir}/%{name}/examples
%license LICENSE legal/copyright.txt

%files doc
%{_datadir}/%{name}/doc
%exclude %{_datadir}/%{name}/index.html
%{_datadir}/%{name}/ReleaseNotes-jtharness.html
%license LICENSE legal/copyright.txt

%changelog
openSUSE Build Service is sponsored by