Name:          jackson
Version:       1.9.11
Release:       16
Summary:       Jackson Java JSON-processor
License:       ASL2.0 and LGPLv2
URL:           https://github.com/codehaus/jackson
Source0:       http://apt.linuxfans.org/magic/3.0/sources/SOURCES.j/jackson/jackson-src-1.9.11.tar.gz
Patch0001:     jackson-build-plain-jars-instead-of-osgi-bundles.patch
Patch0002:     jackson-dont-require-repackaged-asm.patch
Patch0003:     jackson-1.9.11-to-1.9.13.patch
Patch0004:     jackson-1.9.11-javadoc.patch
Patch0005:     CVE-2019-10172-1.patch
Patch0006:     CVE-2019-10172-2.patch
BuildArch:     noarch
Requires:      joda-time >= 1.6.2 stax2-api >= 3.1.1 jsr-311 >= 1.1.1 objectweb-asm3 >= 3.3
BuildRequires: javapackages-local ant >= 1.8.2 joda-time >= 1.6.2 stax2-api >= 3.1.1
BuildRequires: jsr-311 >= 1.1.1 objectweb-asm3 >= 3.3 cglib >= 2.2 groovy18 >= 1.8.5

%description
JSON processor written in Java., it also offers full node-based Tree
Model, as well as full Object/Json Mapper data binding functionality.

%package       help
Summary:       Documentation for jackson package
Provides:      jackson-javadoc = %{version}-%{release}
Obsoletes:     jackson-javadoc < %{version}-%{release}

%description   help
Documentation for jackson package.

%prep
%autosetup -n jackson-src-%{version} -p1

find . -type f -name '*.jar' |xargs rm -f
find . -type f -name 'TestHibernate.java' |xargs rm -f
find . -type f -name 'TestJsonPerf.java' |xargs rm -f
find . -type f -name 'TestGoogleCollections.java' |xargs rm -f

ln -s $(build-classpath joda-time) lib/ext/joda-time.jar
ln -s $(build-classpath stax2-api) lib/xml/sta2-api.jar
ln -s $(build-classpath jsr-311) lib/jaxrs/jsr-311.jar
ln -s $(build-classpath objectweb-asm3/asm) lib/ext/asm/asm.jar
ln -s $(build-classpath objectweb-asm3/asm) lib/repackaged/jackson-asm.jar
ln -s $(build-classpath cglib/cglib) lib/ext/cglib/cglib-nodep.jar
ln -s $(build-classpath groovy18-1.8) lib/ext/groovy/groovy.jar
ln -s $(build-classpath junit) lib/junit/junit.jar

sed -i "s/59 Temple Place/51 Franklin Street/" release-notes/lgpl/LGPL2.1
sed -i "s/Suite 330/Fifth Floor/" release-notes/lgpl/LGPL2.1
sed -i "s/02111-1307/02110-1301/" release-notes/lgpl/LGPL2.1

native2ascii -encoding UTF8 src/test/org/codehaus/jackson/jaxrs/TestUntouchables.java \
 src/test/org/codehaus/jackson/jaxrs/TestUntouchables.java

%build
ant dist

%install
%mvn_artifact dist/jackson-core-asl-%{version}.pom dist/jackson-core-asl-%{version}.jar
%mvn_artifact dist/jackson-mapper-asl-%{version}.pom dist/jackson-mapper-asl-%{version}.jar
%mvn_artifact dist/jackson-xc-%{version}.pom dist/jackson-xc-%{version}.jar
%mvn_artifact dist/jackson-smile-%{version}.pom dist/jackson-smile-%{version}.jar
%mvn_artifact dist/jackson-mrbean-%{version}.pom dist/jackson-mrbean-%{version}.jar
%mvn_artifact dist/jackson-jaxrs-%{version}.pom dist/jackson-jaxrs-%{version}.jar
%mvn_install -J dist/javadoc/

%files -f .mfiles
%doc release-notes

%files help -f .mfiles-javadoc
%doc README.txt

%changelog
* Mon Sep 13 2021 yaoxin <yaoxin30@huawei.com> 1.9.11-16
- Fix CVE-2019-10172

* Fri Dec 20 2019 zhujunhao <zhujunhao5@huawei.com> 1.9.11-15
- Package init
