Name:          kryo
Version:       4.0.2
Release:       7
Summary:       Object graph serialization framework for Java
License:       ASL 2.0 and BSD
Url:           https://github.com/EsotericSoftware/kryo
BuildRequires: maven-local mvn(com.esotericsoftware:minlog) mvn(com.esotericsoftware:reflectasm)
BuildRequires: mvn(junit:junit) mvn(org.apache.felix:maven-bundle-plugin) mvn(org.objenesis:objenesis)
BuildRequires: mvn(org.sonatype.oss:oss-parent:pom:)
BuildArch:     noarch
Source0:       kryo-%{version}.tar.gz
Source1:       http://www.apache.org/licenses/LICENSE-2.0.txt
Obsoletes:     kryo-javadoc < %{version}-%{release}
Provides:      kryo-javadoc = %{version}-%{release}

%description
Kryo is a fast and efficient object graph serialization framework for Java.

%prep
%setup -q -n kryo-kryo-parent-%{version}
find . -name "*.class" -delete
find . -name "*.jar" -delete

%pom_disable_module pom-shaded.xml
%pom_remove_plugin :maven-assembly-plugin pom-main.xml
%pom_remove_plugin :clirr-maven-plugin pom-main.xml
%pom_remove_plugin :maven-bundle-plugin pom-main.xml
%pom_add_plugin org.apache.felix:maven-bundle-plugin pom-main.xml "
<extensions>true</extensions>
<configuration>
  <instructions>
    <Import-Package>sun.reflect;resolution:=optional,*</Import-Package>
    <Export-Package>com.esotericsoftware.kryo.*</Export-Package>
  </instructions>
</configuration>"
%pom_xpath_remove "pom:dependency[pom:classifier = 'shaded']"

cp -p %{SOURCE1} .
%mvn_file :kryo kryo
%mvn_alias :kryo "com.esotericsoftware.kryo:kryo"

%build
%mvn_build -f

%install
%mvn_install

%files 
%attr(0644,root,root) %{_datadir}/maven-metadata/kryo.xml
%attr(0755,root,root) %dir %{_datadir}/maven-poms/kryo
%attr(0644,root,root) %{_datadir}/maven-poms/kryo/kryo-parent.pom
%attr(0644,root,root) %{_datadir}/java/kryo.jar
%attr(0644,root,root) %{_datadir}/maven-poms/kryo.pom
%doc CHANGES.md README.md
%license license.txt LICENSE-2.0.txt
%{_javadocdir}/%{name}

%changelog
* Thu Dec 7 2019 openEuler Buildteam <buildteam@openeuler.org> - 4.0.2-7
- Package init
