File immutables.spec of Package immutables

#
# spec file for package immutables
#
# 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 base_name immutables
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "bootstrap"
%bcond_without bootstrap
%else
%bcond_with bootstrap
%endif
%if %{with bootstrap}
%global name %{base_name}-%{flavor}
%else
%global name %{base_name}
%endif
Name:           %{name}
Version:        2.9.3
Release:        0
Summary:        Annotation processor to create immutable objects and builders
License:        Apache-2.0
Group:          Development/Libraries/Java
URL:            http://immutables.org/
BuildRequires:  maven-local
BuildArch:      noarch
%if %{with bootstrap}
Source0:        https://repo1.maven.org/maven2/org/%{base_name}/value/%{version}/value-%{version}.jar
Source1:        https://repo1.maven.org/maven2/org/%{base_name}/value/%{version}/value-%{version}.pom
Source2:        https://repo1.maven.org/maven2/org/%{base_name}/value-processor/%{version}/value-processor-%{version}.jar
Source3:        https://repo1.maven.org/maven2/org/%{base_name}/value-processor/%{version}/value-processor-%{version}.pom
Source4:        https://repo1.maven.org/maven2/org/%{base_name}/metainf/%{version}/metainf-%{version}.jar
Source5:        https://repo1.maven.org/maven2/org/%{base_name}/metainf/%{version}/metainf-%{version}.pom
Source6:        https://repo1.maven.org/maven2/org/%{base_name}/trees/%{version}/trees-%{version}.jar
Source7:        https://repo1.maven.org/maven2/org/%{base_name}/trees/%{version}/trees-%{version}.pom
Source8:        https://repo1.maven.org/maven2/org/%{base_name}/mirror/%{version}/mirror-%{version}.jar
Source9:        https://repo1.maven.org/maven2/org/%{base_name}/mirror/%{version}/mirror-%{version}.pom
%else
Source0:        https://github.com/%{base_name}/%{base_name}/archive/refs/tags/%{version}.tar.gz#/%{base_name}-%{version}.tar.gz
%endif
%if %{without bootstrap}
BuildRequires:  %{base_name}-bootstrap
BuildRequires:  mvn(com.fasterxml.jackson.core:jackson-databind)
BuildRequires:  mvn(com.google.code.gson:gson)
BuildRequires:  mvn(javax.ws.rs:javax.ws.rs-api)
BuildRequires:  mvn(org.apache.maven.plugins:maven-enforcer-plugin)
BuildRequires:  mvn(org.codehaus.mojo:build-helper-maven-plugin)
BuildRequires:  mvn(org.eclipse.jdt:ecj)
BuildRequires:  mvn(org.junit.jupiter:junit-jupiter-api)
BuildRequires:  mvn(org.mockito:mockito-core)
BuildRequires:  mvn(org.parboiled:parboiled-java)
BuildRequires:  mvn(org.reactivestreams:reactive-streams)
%endif

%description
Annotation processor to create immutable objects and builders. Feels like
Guava’s immutable collections but for regular value objects. JSON, Jackson,
Gson, JAX-RS integrations included.

%package javadoc
Summary:        API documentation for %{name}
Group:          Documentation/HTML

%description javadoc
API documentation for %{name}.

%prep
%if "%{flavor}" != "bootstrap"
%setup -q -n %{base_name}-%{version}

%pom_remove_dep -r com.google.errorprone:javac

%pom_remove_plugin -r org.immutables.tools:maven-shade-plugin
%pom_remove_plugin -r :maven-source-plugin

%pom_xpath_remove 'pom:dependency[pom:classifier="annotations"]' value-processor

%pom_disable_module common criteria
%pom_disable_module inmemory criteria
%pom_disable_module mongo criteria
%pom_disable_module elasticsearch criteria
%pom_disable_module geode criteria
%pom_disable_module sql criteria
%pom_disable_module rxjava2 criteria
%pom_disable_module reactor criteria
%pom_disable_module mongo
%pom_disable_module processor-testlib
%pom_disable_module value-fixture

%endif

%build
%if %{with bootstrap}
%{mvn_artifact} --skip-dependencies %{SOURCE1} %{SOURCE0}
%{mvn_artifact} --skip-dependencies %{SOURCE3} %{SOURCE2}
%{mvn_artifact} --skip-dependencies %{SOURCE5} %{SOURCE4}
%{mvn_artifact} --skip-dependencies %{SOURCE7} %{SOURCE6}
%{mvn_artifact} --skip-dependencies %{SOURCE9} %{SOURCE8}
%else
%{mvn_build} -f
%endif

%install
%mvn_install

%files -f .mfiles
%if %{without bootstrap}
%license LICENSE
%doc README.md
%endif

%if %{without bootstrap}
%files javadoc -f .mfiles-javadoc
%license LICENSE
%endif

%changelog
openSUSE Build Service is sponsored by