Commit Diff
4 files changed
+82 -5
a23fec .. 454dc8

file modified
+1

@@ -8,3 +8,4 @@

  /woodstox-core-5.0.2.tar.gz

  /woodstox-core-5.0.3.tar.gz

  /woodstox-core-5.2.1.tar.gz

+ /woodstox-core-6.0.1.tar.gz

@@ -0,0 +1,59 @@

+ From 46dbf7151b5d8b1a854863305297cc7b4a70af44 Mon Sep 17 00:00:00 2001

+ From: Mat Booth <mat.booth@redhat.com>

+ Date: Wed, 18 Sep 2019 16:00:51 +0100

+ Subject: [PATCH] Allow building against OSGi APIs newer than R4

+ 

+ ---

+  .../ctc/wstx/osgi/WstxBundleActivator.java    | 23 ++++++++++++++++---

+  1 file changed, 20 insertions(+), 3 deletions(-)

+ 

+ diff --git a/src/main/java/com/ctc/wstx/osgi/WstxBundleActivator.java b/src/main/java/com/ctc/wstx/osgi/WstxBundleActivator.java

+ index 0ad8402..26b1f0f 100644

+ --- a/src/main/java/com/ctc/wstx/osgi/WstxBundleActivator.java

+ +++ b/src/main/java/com/ctc/wstx/osgi/WstxBundleActivator.java

+ @@ -1,5 +1,9 @@

+  package com.ctc.wstx.osgi;

+  

+ +import java.util.Dictionary;

+ +import java.util.Hashtable;

+ +import java.util.Properties;

+ +

+  import org.osgi.framework.BundleActivator;

+  import org.osgi.framework.BundleContext;

+  

+ @@ -27,16 +31,29 @@ public class WstxBundleActivator

+      public void start(BundleContext ctxt)

+      {

+          InputFactoryProviderImpl inputP = new InputFactoryProviderImpl();

+ -        ctxt.registerService(Stax2InputFactoryProvider.class.getName(), inputP, inputP.getProperties());

+ +        ctxt.registerService(Stax2InputFactoryProvider.class.getName(), inputP, convertPropsToDict(inputP.getProperties()));

+          OutputFactoryProviderImpl outputP = new OutputFactoryProviderImpl();

+ -        ctxt.registerService(Stax2OutputFactoryProvider.class.getName(), outputP, outputP.getProperties());

+ +        ctxt.registerService(Stax2OutputFactoryProvider.class.getName(), outputP, convertPropsToDict(outputP.getProperties()));

+          ValidationSchemaFactoryProviderImpl[] impls = ValidationSchemaFactoryProviderImpl.createAll();

+          for (int i = 0, len = impls.length; i < len; ++i) {

+              ValidationSchemaFactoryProviderImpl impl = impls[i];

+ -            ctxt.registerService(Stax2ValidationSchemaFactoryProvider.class.getName(), impl, impl.getProperties());

+ +            ctxt.registerService(Stax2ValidationSchemaFactoryProvider.class.getName(), impl, convertPropsToDict(impl.getProperties()));

+          }

+      }

+  

+ +    /**

+ +     * A Properties object is a Dictionary<Object,Object> but the OSGi API got

+ +     * more restrictive and requires a Dictionary<String,Object>, so we must do

+ +     * a quick conversion here.

+ +     */

+ +    private Dictionary<String,Object> convertPropsToDict(Properties props) {

+ +		Dictionary<String,Object> dict = new Hashtable<String,Object>();

+ +		for (Object key : props.keySet()) {

+ +			dict.put(key.toString(), props.get(key));

+ +		}

+ +		return dict;

+ +    }

+ +

+      @Override

+      public void stop(BundleContext ctxt) {

+          // Nothing to do here: OSGi automatically de-registers services upon

+ -- 

+ 2.20.1

+ 

file modified
+1 -1

@@ -1,1 +1,1 @@

- SHA512 (woodstox-core-5.2.1.tar.gz) = 4b7b68b94cf5469f3e5fbf8442bec27d541056757f098cb76852f75e0cd05909f60cb4fb3b30fb926eb8c0a2a27f7db9dd8158fc7b9eed992b90fc2b1044fe8a

+ SHA512 (woodstox-core-6.0.1.tar.gz) = 0d0ba0d33a1098b83f33b853c7d4c9add2438ef871468cc4c157b557d80d924501cd77ba444d5e30662e2dc4dfc737d207ffb4d4a504f926b7561efc8abbc3bb

file modified
+21 -4

@@ -2,24 +2,27 @@

  

  Name:           woodstox-core

  Summary:        High-performance XML processor

- Version:        5.2.1

- Release:        1%{?dist}

+ Version:        6.0.1

+ Release:        2%{?dist}

  License:        ASL 2.0 or LGPLv2+ or BSD

  

  URL:            https://github.com/FasterXML/woodstox

  Source0:        %{url}/archive/%{name}-%{version}.tar.gz

  

+ Patch0: 0001-Allow-building-against-OSGi-APIs-newer-than-R4.patch

+ 

  BuildArch:      noarch

  

  BuildRequires:  maven-local

  BuildRequires:  mvn(com.fasterxml:oss-parent:pom:)

  BuildRequires:  mvn(junit:junit)

  BuildRequires:  mvn(net.java.dev.msv:msv-core)

- BuildRequires:  mvn(net.java.dev.msv:msv-rngconverter)

  BuildRequires:  mvn(net.java.dev.msv:xsdlib)

  BuildRequires:  mvn(org.apache.felix:maven-bundle-plugin)

- BuildRequires:  mvn(org.apache.felix:org.osgi.core)

+ BuildRequires:  mvn(org.osgi:osgi.core)

+ BuildRequires:  mvn(org.apache.maven.plugins:maven-shade-plugin)

  BuildRequires:  mvn(org.codehaus.woodstox:stax2-api)

+ BuildRequires:  mvn(relaxngDatatype:relaxngDatatype)

  

  %description

  Woodstox is a high-performance validating namespace-aware StAX-compliant

@@ -39,6 +42,14 @@

  %prep

  %setup -q -n %{base_name}-%{name}-%{version}

  

+ %patch0 -p1

+ 

+ # we don't care about Java 9 modules (yet)

+ %pom_remove_plugin :moditect-maven-plugin

+ 

+ # replace felix-osgi-core with osgi-core

+ %pom_change_dep -r :org.osgi.core org.osgi:osgi.core

+ 

  %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 \

@@ -63,6 +74,12 @@

  

  

  %changelog

+ * Wed Sep 18 2019 Mat Booth <mat.booth@redhat.com> - 6.0.1-2

+ - Port to newer OSGi API

+ 

+ * Wed Sep 18 2019 Fabio Valentini <decathorpe@gmail.com> - 6.0.1-1

+ - Update to version 6.0.1.

+ 

  * Thu Aug 01 2019 Fabio Valentini <decathorpe@gmail.com> - 5.2.1-1

  - Update to version 5.2.1.