#
# spec file for package google-gson
#
# Copyright (c) 2022 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/
#
Name: google-gson
Version: 2.8.9
Release: 23.21
Summary: Java lib for conversion of Java objects into JSON representation
License: Apache-2.0
URL: https://github.com/google/gson
Source0: https://github.com/google/gson/archive/gson-parent-%{version}.tar.gz
Patch0: osgi-export-internal.patch
# Remove dependency on unavailable templating-maven-plugin
Patch1: no-template-plugin.patch
%if 0%{?rhel} >= 9
BuildRequires: xmvn-minimal
BuildRequires: xmvn-tools
%endif
BuildRequires: fdupes
BuildRequires: java-devel >= 9
BuildRequires: maven-local
BuildRequires: mvn(javax.annotation:jsr250-api)
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
BuildArch: noarch
%description
Gson is a Java library that can be used to convert a Java object into its
JSON representation. It can also be used to convert a JSON string into an
equivalent Java object. Gson can work with arbitrary Java objects including
pre-existing objects that you do not have source-code of.
%package javadoc
Summary: API documentation for %{name}
%description javadoc
This package contains the API documentation for %{name}.
%prep
%setup -q -n gson-gson-parent-%{version}
%patch0 -p1
%patch1 -p1
# remove unnecessary dependency on parent POM
%pom_remove_parent
# presence of these files breaks builds with Java 8
# find -name "module-info.java" -print -delete
# Use felix maven-bundle-plugin only for OSGi metadata
%pom_remove_plugin :bnd-maven-plugin gson
%pom_remove_plugin :templating-maven-plugin gson
%pom_remove_plugin :copy-rename-maven-plugin gson
%pom_remove_plugin :proguard-maven-plugin gson
%pom_add_plugin "org.apache.felix:maven-bundle-plugin" gson "
<_include>bnd.bnd
create-manifest
process-classes
manifest
"
%pom_xpath_set "pom:plugins/pom:plugin[pom:artifactId[text()='maven-compiler-plugin']]/pom:configuration" "8"
%build
%{mvn_build} -f -j -- -Dsource=8
%install
%mvn_install
%fdupes -s %{buildroot}%{_javadocdir}
%files -f .mfiles
%license LICENSE
%doc README.md CHANGELOG.md UserGuide.md
#%files javadoc -f .mfiles-javadoc
#%license LICENSE
%changelog
* Fri Apr 1 2022 Fridrich Strba
- Build with Java >= 9 in order to produce a modular jar by
compiling the module-info.java sources with all other classes
built with release 8 and still compatible with Java 8
- Removed patch:
* allow-build-with-java8.patch
+ not needed in this setting
* Thu Mar 31 2022 Fridrich Strba
- Upgrade to version 2.8.9 (jsc#SLE-24261)
* Changes
+ Make OSGi bundle's dependency on sun.misc optional.
+ Deprecate Gson.excluder() exposing internal Excluder class.
+ Prevent Java deserialization of internal classes.
+ Improve number strategy implementation.
+ Fix LongSerializationPolicy null handling being inconsistent
with Gson.
+ Support arbitrary Number implementation for Object and Number
deserialization.
+ Bump proguard-maven-plugin from 2.4.0 to 2.5.1.
+ Don't exclude static local classes.
+ Fix RuntimeTypeAdapterFactory depending on internal Streams
class.
+ Improve Maven build.
+ Make dependency on java.sql optional.
* fixes bsc#1199064, CVE-2022-25647
- Removed patch:
* sun-misc.patch
+ integrated upstream
* Tue Mar 22 2022 Fridrich Strba
- Build with source and target levels 8
* Tue Oct 19 2021 Fridrich Strba
- Upgrade to version 2.8.8
* Changes
+ Fixed issue with recursive types.
+ Better behaviour with Java 9+ and Unsafe if there is a
security manager.
+ EnumTypeAdapter now works better when ProGuard has obfuscated
enum fields.
- Removed patch:
* fix-test.patch
+ integrated upstream
- Modified patches:
* no-template-plugin.patch
* osgi-export-internal.patch
+ rediff to changed context
- Added patches:
* allow-build-with-java8.patch
+ lower the unnecessary requirement of Java 9
* sun-misc.patch
+ make import of sun.misc optional since not all versions of
jdk export it
* Fri Nov 1 2019 Fridrich Strba
- Initial packaging of google-gson 2.8.5