%global main_res_dir src/main/resources/META-INF
%global test_com_dir src/test/java/com/fasterxml/jackson/databind

Name:          jackson-databind
Version:       2.9.4
Release:       5
Summary:       General data-binding package for Jackson (2.x)
License:       ASL 2.0 and LGPLv2+
URL:           https://github.com/FasterXML/jackson-databind/
Source0:       https://github.com/FasterXML/jackson-databind/archive/%{name}-%{version}.tar.gz
Patch0:        CVE-2018-7489.patch

BuildRequires:  mvn(org.powermock:powermock-module-junit4)
BuildRequires:  mvn(org.powermock:powermock-api-mockito)
BuildRequires:  mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires:  mvn(com.google.code.maven-replacer-plugin:replacer)
BuildRequires:  mvn(com.fasterxml.jackson:jackson-base:pom:) >= %{version}
BuildRequires:  mvn(com.fasterxml.jackson.core:jackson-core) >= %{version}
BuildRequires:  mvn(com.fasterxml.jackson.core:jackson-annotations) >= %{version}
BuildRequires:  maven-local

BuildArch:      noarch

Provides:       jackson-core-javadoc
Obsoletes:      jackson-core-javadoc

%description
The general-purpose data-binding functionality and tree-model for Jackson Data
Processor. It builds on core streaming parser/generator package, and uses
Jackson Annotations for configuration.

%prep
%autosetup -n %{name}-%{name}-%{version} -p1

%pom_remove_plugin ":maven-enforcer-plugin"

cp -p %{main_res_dir}/LICENSE .
cp -p %{main_res_dir}/NOTICE .
sed -i 's/\r//' LICENSE NOTICE

%pom_remove_dep javax.measure:jsr-275
rm %{test_com_dir}/introspect/NoClassDefFoundWorkaroundTest.java
%pom_xpath_remove pom:classpathDependencyExcludes

rm %{test_com_dir}/type/TestTypeFactoryWithClassLoader.java
rm %{test_com_dir}/ser/jdk/JDKTypeSerializationTest.java
rm %{test_com_dir}/deser/jdk/JDKStringLikeTypesTest.java
rm %{test_com_dir}/TestJDKSerialization.java

%mvn_file : %{name}

%build
%mvn_build -- -Dmaven.test.failure.ignore=true

%install
%mvn_install

%files -f .mfiles
%doc README.md release-notes/*
%doc %{_javadocdir}/%{name}
%license LICENSE NOTICE


%changelog
* Tue Dec 3 2019 huyan <hu.huyan@huawei.com> - 2.9.4-4
- Package Initialization
