%global base_name woodstox
%global core_name %{base_name}-core
Name:                %{core_name}
Version:             6.2.8
Release:             1
Summary:             High-performance XML processor
License:             ASL 2.0 or LGPLv2+ or BSD
URL:                 https://github.com/FasterXML/woodstox
BuildArch:           noarch
Source0:             https://github.com/FasterXML/%{base_name}/archive/%{name}-%{version}.tar.gz
Patch0:              0001-stax2-api.patch
Patch1:              0001-Allow-building-against-OSGi-APIs-newer-than-R4.patch
Patch2:              0002-Patch-out-optional-support-for-msv-and-relax-schema-.patch
BuildRequires:       maven-local mvn(com.fasterxml:oss-parent:pom:) mvn(javax.xml.stream:stax-api)
BuildRequires:       mvn(junit:junit) mvn(net.java.dev.msv:msv-core)
BuildRequires:       mvn(net.java.dev.msv:msv-rngconverter) mvn(net.java.dev.msv:xsdlib)
BuildRequires:       mvn(org.apache.felix:maven-bundle-plugin) mvn(org.apache.felix:org.osgi.core)
BuildRequires:       mvn(org.codehaus.woodstox:stax2-api)
BuildRequires:       mvn(org.apache.maven.plugins:maven-shade-plugin) java-devel >= 1.8
%description
Woodstox is a high-performance validating namespace-aware StAX-compliant
(JSR-173) Open Source XML-processor written in Java.
XML processor means that it handles both input (== parsing)
and output (== writing, serialization)), as well as supporting tasks
such as validation.

%package javadoc
Summary:             API documentation for %{name}
%description javadoc
This package contains the API documentation for %{name}.

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

%pom_remove_plugin :nexus-staging-maven-plugin
%pom_remove_plugin :moditect-maven-plugin
%pom_remove_plugin :jacoco-maven-plugin

%mvn_alias ":{woodstox-core}" :@1-lgpl :@1-asl :wstx-asl :wstx-lgpl \
    org.codehaus.woodstox:@1 org.codehaus.woodstox:@1-asl \
    org.codehaus.woodstox:@1-lgpl org.codehaus.woodstox:wstx-lgpl \
    org.codehaus.woodstox:wstx-asl
%mvn_file : %{name}{,-asl,-lgpl}
rm ./src/test/java/org/codehaus/stax/test/stream/TestNamespaces.java

%build
%mvn_build -f -- -Dsource=8

%install
%mvn_install

%files -f .mfiles
%doc README.md
%license LICENSE

%files javadoc -f .mfiles-javadoc

%changelog
* Fri Nov 10 2023 yaoxin <yao_xin001@hoperun.com> - 6.2.8-1
- Upgrade to 6.2.8

* Thu Jul 23 2020 Jeffery.Gao <gaojianxing@huawei.com> - 5.0.3-1
- Package init
