snakeyaml/snakeyaml.spec

117 lines
3.7 KiB
RPMSpec
Raw Normal View History

#
# spec file for package snakeyaml
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 vertag 70abb5efa4c0
%bcond_with spring
Name: snakeyaml
Version: 1.17
Release: 0
Summary: YAML parser and emitter for the Java programming language
License: Apache-2.0
Group: Development/Libraries/Java
URL: https://bitbucket.org/asomov/%{name}/
Source0: https://bitbucket.org/asomov/snakeyaml/get/v%{version}.tar.bz2#/%{name}-%{version}.tar.bz2
# Upstream has forked gdata-java and base64 and refuses [1] to
# consider replacing them by external dependencies. Bundled libraries
# need to be removed and their use replaced by system libraries.
# See rhbz#875777 and http://code.google.com/p/snakeyaml/issues/detail?id=175
#
# Remove use of bundled Base64 implementation
Patch0: 0001-Replace-bundled-base64-implementation.patch
# We don't have gdata-java in Fedora any longer, use commons-codec instead
Patch1: 0002-Replace-bundled-gdata-java-client-classes-with-commo.patch
BuildRequires: fdupes
BuildRequires: maven-local
BuildRequires: mvn(biz.source_code:base64coder)
BuildRequires: mvn(commons-codec:commons-codec)
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-source-plugin)
BuildArch: noarch
%if %{with spring}
BuildRequires: mvn(org.springframework:spring-core)
%endif
%description
SnakeYAML features:
* a complete YAML 1.1 parser. In particular,
SnakeYAML can parse all examples from the specification.
* Unicode support including UTF-8/UTF-16 input/output.
* high-level API for serializing and deserializing
native Java objects.
* support for all types from the YAML types repository.
* relatively sensible error messages.
%package javadoc
Summary: API documentation for %{name}
Group: Documentation/HTML
%description javadoc
This package contains %{summary}.
%prep
%setup -q -n asomov-%{name}-%{vertag}
%patch0 -p1
%patch1 -p1
%{mvn_file} : %{name}
%pom_remove_plugin :cobertura-maven-plugin
%pom_remove_plugin :maven-changes-plugin
%pom_remove_plugin :maven-license-plugin
%pom_remove_plugin :maven-javadoc-plugin
%pom_remove_plugin :maven-site-plugin
sed -i "/<artifactId>spring</s/spring/&-core/" pom.xml
rm -f src/test/java/examples/SpringTest.java
# Replacement for bundled gdata-java-client
%pom_add_dep commons-codec:commons-codec
# Re-add bundled base64coder
%pom_add_dep biz.source_code:base64coder
# remove bundled stuff
rm -rf target
# fails in rpmbuild only due to different locale
rm src/test/java/org/yaml/snakeyaml/issues/issue67/NonAsciiCharsInClassNameTest.java
# fails after unbundling
rm src/test/java/org/yaml/snakeyaml/issues/issue318/ContextClassLoaderTest.java
# convert CR+LF to LF
sed -i 's/\r//g' LICENSE.txt
%if %{without spring}
%pom_remove_dep org.springframework
rm -r src/test/java/org/yaml/snakeyaml/issues/issue9
%endif
%build
%{mvn_build} -f -- -Dsource=6
%install
%mvn_install
%fdupes -s %{buildroot}%{_javadocdir}
%files -f .mfiles
%license LICENSE.txt
%files javadoc -f .mfiles-javadoc
%license LICENSE.txt
%changelog