From 8865e0afcf21cf3375e13c08c74f725286df6049e2eabb4bb8950b18c59b34f8 Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Tue, 12 Sep 2017 08:11:14 +0000 Subject: [PATCH] Upgrade to 0.5.2 + fix build on systems where jdk9 is default java OBS-URL: https://build.opensuse.org/package/show/Java:packages/ws-jaxme?expand=0&rev=12 --- ws-jaxme-0.5.1-src.tar.bz2 | 3 - ws-jaxme-0.5.2-src.tar.bz2 | 3 + ws-jaxme-java6.patch | 226 +++++++++++++++++-------------- ws-jaxme-sourcetarget.patch | 72 ++++++++++ ws-jaxme-use-commons-codec.patch | 28 ++++ ws-jaxme.changes | 12 ++ ws-jaxme.spec | 13 +- 7 files changed, 247 insertions(+), 110 deletions(-) delete mode 100644 ws-jaxme-0.5.1-src.tar.bz2 create mode 100644 ws-jaxme-0.5.2-src.tar.bz2 create mode 100644 ws-jaxme-sourcetarget.patch create mode 100644 ws-jaxme-use-commons-codec.patch diff --git a/ws-jaxme-0.5.1-src.tar.bz2 b/ws-jaxme-0.5.1-src.tar.bz2 deleted file mode 100644 index b1a0147..0000000 --- a/ws-jaxme-0.5.1-src.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:39e4a1f6aff304ad70d127988d70234c972eeebda99e2e0c11636144de7f9f6b -size 5204769 diff --git a/ws-jaxme-0.5.2-src.tar.bz2 b/ws-jaxme-0.5.2-src.tar.bz2 new file mode 100644 index 0000000..a97cc2f --- /dev/null +++ b/ws-jaxme-0.5.2-src.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cebd76671407b490176d42ea2ae02224ee599624cec20bf3afcab0a1ceebf4ee +size 5335431 diff --git a/ws-jaxme-java6.patch b/ws-jaxme-java6.patch index 5eacdc8..f4615b3 100644 --- a/ws-jaxme-java6.patch +++ b/ws-jaxme-java6.patch @@ -1,158 +1,176 @@ ---- ant/jm.xml -+++ ant/jm.xml -@@ -127,7 +127,6 @@ - - - - -@@ -184,7 +183,6 @@ - - - - --- src/jaxme/org/apache/ws/jaxme/impl/JMMarshallerImpl.java +++ src/jaxme/org/apache/ws/jaxme/impl/JMMarshallerImpl.java -@@ -428,6 +428,55 @@ - } +@@ -21,16 +21,22 @@ + import java.io.OutputStreamWriter; + import java.io.UnsupportedEncodingException; + import java.io.Writer; ++import java.io.File; + import javax.xml.bind.JAXBException; + import javax.xml.bind.MarshalException; + import javax.xml.bind.Marshaller; + import javax.xml.bind.PropertyException; ++import javax.xml.bind.attachment.AttachmentMarshaller; ++import javax.xml.bind.annotation.adapters.XmlAdapter; + import javax.xml.namespace.QName; + import javax.xml.transform.Result; + import javax.xml.transform.dom.DOMResult; + import javax.xml.transform.sax.SAXResult; + import javax.xml.transform.stream.StreamResult; ++import javax.xml.stream.XMLStreamWriter; ++import javax.xml.stream.XMLEventWriter; ++import javax.xml.validation.Schema; + + import org.apache.ws.jaxme.*; + import org.apache.ws.jaxme.JMElement; +@@ -430,4 +436,55 @@ public Node getNode(java.lang.Object contentTree) throws JAXBException { -- throw new UnsupportedOperationException("JaxMe doesn't support live DOM views"); -+ throw new UnsupportedOperationException("JaxMe doesn't support live DOM views"); + throw new UnsupportedOperationException("JaxMe doesn't support live DOM views"); } + -+ public javax.xml.bind.Marshaller.Listener getListener() { -+ throw new RuntimeException("Not implemented method getListener()"); -+ } + -+ public void setListener(javax.xml.bind.Marshaller.Listener listener) { -+ throw new RuntimeException("Not implemented method setListener()"); -+ } ++// added to support JDK6 + -+ public javax.xml.validation.Schema getSchema() { -+ throw new RuntimeException("Not implemented method getSchema()"); -+ } ++ public void marshal(Object jaxbElement, File output) throws JAXBException { ++ throw new UnsupportedOperationException(); ++ } + -+ public void setSchema(javax.xml.validation.Schema schema) { -+ throw new RuntimeException("Not implemented method setSchema()"); -+ } ++ public void marshal(Object jaxbElement, XMLStreamWriter writer) throws JAXBException { ++ throw new UnsupportedOperationException(); ++ } + -+ public javax.xml.bind.attachment.AttachmentMarshaller getAttachmentMarshaller() { -+ throw new RuntimeException("Not implemented method getAttachmentMarshaller()"); -+ } ++ public void marshal(Object jaxbElement, XMLEventWriter writer) throws JAXBException { ++ throw new UnsupportedOperationException(); ++ } + -+ public void setAttachmentMarshaller(javax.xml.bind.attachment.AttachmentMarshaller am) { -+ throw new RuntimeException("Not implemented method getAttachmentMarshaller()"); -+ } ++ public void setAdapter(XmlAdapter adapter) { ++ throw new UnsupportedOperationException(); ++ } + -+ public A getAdapter(Class type) { -+ throw new RuntimeException("Not implemented method getAdapter()"); -+ } ++ public void setAdapter(Class type, XmlAdapter adapter) { ++ throw new UnsupportedOperationException(); ++ } + -+ public void setAdapter(Class type, A adapter) { -+ throw new RuntimeException("Not implemented method setAdapter()"); -+ } ++ public XmlAdapter getAdapter(Class type) { ++ throw new UnsupportedOperationException(); ++ } + -+ public void setAdapter(javax.xml.bind.annotation.adapters.XmlAdapter adapter) { -+ throw new RuntimeException("Not implemented method setAdapter()"); -+ } ++ public void setAttachmentMarshaller(AttachmentMarshaller am) { ++ throw new UnsupportedOperationException(); ++ } + -+ public void marshal(Object jaxbElement, javax.xml.stream.XMLEventWriter writer) throws JAXBException { -+ throw new RuntimeException("Not implemented method marshal()"); -+ } ++ public AttachmentMarshaller getAttachmentMarshaller() { ++ throw new UnsupportedOperationException(); ++ } + -+ public void marshal(Object jaxbElement, javax.xml.stream.XMLStreamWriter writer) throws JAXBException { -+ throw new RuntimeException("Not implemented method marshal()"); -+ } ++ public void setSchema(Schema schema) { ++ throw new UnsupportedOperationException(); ++ } + -+ public void marshal(Object jaxbElement, java.io.File file) throws JAXBException { -+ throw new RuntimeException("Not implemented method marshal()"); -+ } ++ public Schema getSchema() { ++ throw new UnsupportedOperationException(); ++ } + ++ public void setListener(Listener listener) { ++ throw new UnsupportedOperationException(); ++ } ++ ++ public Listener getListener() { ++ throw new UnsupportedOperationException(); ++ } } --- src/jaxme/org/apache/ws/jaxme/impl/JMUnmarshallerImpl.java +++ src/jaxme/org/apache/ws/jaxme/impl/JMUnmarshallerImpl.java -@@ -170,11 +170,76 @@ - return unmarshal(node); - } else { - throw new IllegalArgumentException("Unknown type of Source: " + pSource.getClass().getName() + -- ", only SAXSource, StreamSource and DOMSource are supported."); -+ ", only SAXSource, StreamSource and DOMSource are supported."); - } - } -- -+ +@@ -26,6 +26,10 @@ + import javax.xml.bind.JAXBException; + import javax.xml.bind.UnmarshalException; + import javax.xml.bind.UnmarshallerHandler; ++import javax.xml.bind.JAXBElement; ++import javax.xml.bind.Unmarshaller; ++import javax.xml.bind.attachment.AttachmentUnmarshaller; ++import javax.xml.bind.annotation.adapters.XmlAdapter; + import javax.xml.parsers.ParserConfigurationException; + import javax.xml.parsers.SAXParser; + import javax.xml.parsers.SAXParserFactory; +@@ -33,6 +37,9 @@ + import javax.xml.transform.dom.DOMSource; + import javax.xml.transform.sax.SAXSource; + import javax.xml.transform.stream.StreamSource; ++import javax.xml.stream.XMLStreamReader; ++import javax.xml.stream.XMLEventReader; ++import javax.xml.validation.Schema; + + import org.apache.ws.jaxme.JMUnmarshaller; + import org.apache.ws.jaxme.util.DOMSerializer; +@@ -177,4 +184,71 @@ public UnmarshallerHandler getUnmarshallerHandler() { return new JMUnmarshallerHandlerImpl(this); } + -+ public javax.xml.bind.Unmarshaller.Listener getListener() { -+ throw new RuntimeException("Not implemented method getListener()"); ++ ++// added to support JDK6 ++ ++ public Object unmarshal(Reader reader) throws JAXBException { ++ throw new UnsupportedOperationException(); + } + -+ public void setListener(javax.xml.bind.Unmarshaller.Listener listener) { -+ throw new RuntimeException("Not implemented method setListener()"); ++ public JAXBElement unmarshal(Node node, Class declaredType) throws JAXBException { ++ throw new UnsupportedOperationException(); + } + -+ public A getAdapter(Class type) { -+ throw new RuntimeException("Not implemented method getAdapter()"); ++ public JAXBElement unmarshal(Source source, Class declaredType) throws JAXBException { ++ throw new UnsupportedOperationException(); + } + -+ public void setAdapter(Class type, A adapter) { -+ throw new RuntimeException("Not implemented method setAdapter()"); ++ public Object unmarshal(XMLStreamReader reader) throws JAXBException { ++ throw new UnsupportedOperationException(); + } + -+ public void setAdapter(javax.xml.bind.annotation.adapters.XmlAdapter adapter) { -+ throw new RuntimeException("Not implemented method setAdapter()"); ++ public JAXBElement unmarshal(XMLStreamReader reader, Class declaredType) throws JAXBException { ++ throw new UnsupportedOperationException(); + } + -+ public javax.xml.validation.Schema getSchema() { -+ throw new RuntimeException("Not implemented method getSchema()"); ++ public Object unmarshal(XMLEventReader reader) throws JAXBException { ++ throw new UnsupportedOperationException(); + } + -+ public void setSchema(javax.xml.validation.Schema schema) { -+ throw new RuntimeException("Not implemented method setSchema()"); ++ public JAXBElement unmarshal(XMLEventReader reader, Class declaredType) throws JAXBException { ++ throw new UnsupportedOperationException(); + } + -+ public javax.xml.bind.JAXBElement unmarshal(javax.xml.stream.XMLEventReader reader, Class declaredType) throws JAXBException { -+ throw new RuntimeException("Not implemented method unmarshal()"); ++ public void setSchema(Schema schema) { ++ throw new UnsupportedOperationException(); + } + -+ public Object unmarshal(javax.xml.stream.XMLEventReader reader) throws JAXBException { -+ throw new RuntimeException("Not implemented method unmarshal()"); -+ } -+ -+ public javax.xml.bind.JAXBElement unmarshal(javax.xml.stream.XMLStreamReader reader, Class declaredType) throws JAXBException { -+ throw new RuntimeException("Not implemented method unmarshal()"); ++ public Schema getSchema() { ++ throw new UnsupportedOperationException(); + } + -+ public Object unmarshal(javax.xml.stream.XMLStreamReader reader) throws JAXBException { -+ throw new RuntimeException("Not implemented method unmarshal()"); ++ public void setAdapter(XmlAdapter adapter) { ++ throw new UnsupportedOperationException(); + } + -+ public javax.xml.bind.JAXBElement unmarshal(org.w3c.dom.Node node, Class declaredType) throws JAXBException { -+ throw new RuntimeException("Not implemented method unmarshal()"); -+ } -+ -+ public Object unmarshal(java.io.Reader reader) throws JAXBException { -+ throw new RuntimeException("Not implemented method unmarshal()"); ++ public void setAdapter(Class type, XmlAdapter adapter) { ++ throw new UnsupportedOperationException(); + } + -+ public javax.xml.bind.JAXBElement unmarshal(javax.xml.transform.Source source, Class declaredType) { -+ throw new RuntimeException("Not implemented method unmarshal()"); ++ public XmlAdapter getAdapter(Class type) { ++ throw new UnsupportedOperationException(); + } + -+ public javax.xml.bind.attachment.AttachmentUnmarshaller getAttachmentUnmarshaller() { -+ throw new RuntimeException("Not implemented method getAttachmentUnmarshaller()"); ++ public void setAttachmentUnmarshaller(AttachmentUnmarshaller au) { ++ throw new UnsupportedOperationException(); + } + -+ public void setAttachmentUnmarshaller(javax.xml.bind.attachment.AttachmentUnmarshaller foo) { -+ throw new RuntimeException("Not implemented method setAttachmentUnmarshaller()"); ++ public AttachmentUnmarshaller getAttachmentUnmarshaller() { ++ throw new UnsupportedOperationException(); + } + ++ public void setListener(Listener listener) { ++ throw new UnsupportedOperationException(); ++ } ++ ++ public Listener getListener() { ++ throw new UnsupportedOperationException(); ++ } } diff --git a/ws-jaxme-sourcetarget.patch b/ws-jaxme-sourcetarget.patch new file mode 100644 index 0000000..919a821 --- /dev/null +++ b/ws-jaxme-sourcetarget.patch @@ -0,0 +1,72 @@ +--- ws-jaxme-0.5.2/ant/jm.xml 2012-07-27 12:18:59.000000000 +0200 ++++ ws-jaxme-0.5.2/ant/jm.xml 2012-07-27 16:07:58.924849227 +0200 +@@ -128,7 +128,7 @@ + + + + +@@ -185,7 +185,7 @@ + + + + +--- ws-jaxme-0.5.2/ant/js.xml 2012-07-27 12:18:59.000000000 +0200 ++++ ws-jaxme-0.5.2/ant/js.xml 2012-07-27 16:08:26.538504008 +0200 +@@ -71,7 +71,7 @@ + + + + + +@@ -160,7 +160,7 @@ + + + +--- ws-jaxme-0.5.2/ant/macros.xml 2005-07-14 20:32:17.000000000 +0200 ++++ ws-jaxme-0.5.2/ant/macros.xml 2012-07-27 16:08:37.033372804 +0200 +@@ -54,7 +54,7 @@ + + ++ excludes="@{excludes}" source="1.6" target="1.6"> + + + +diff -up ws-jaxme-0.5.2/ant/pm.xml ws-jaxme-0.5.2/ant/pm.xml +--- ws-jaxme-0.5.2/ant/pm.xml 2012-07-27 12:18:59.000000000 +0200 ++++ ws-jaxme-0.5.2/ant/pm.xml 2012-07-27 16:08:42.912299308 +0200 +@@ -70,7 +70,7 @@ + + + + +@@ -112,7 +112,7 @@ + + + + + diff --git a/ws-jaxme-use-commons-codec.patch b/ws-jaxme-use-commons-codec.patch new file mode 100644 index 0000000..f3d6da8 --- /dev/null +++ b/ws-jaxme-use-commons-codec.patch @@ -0,0 +1,28 @@ +--- ./src/jaxme/org/apache/ws/jaxme/util/Base64Binary.java.sav 2007-02-12 12:33:45.000000000 -0500 ++++ ./src/jaxme/org/apache/ws/jaxme/util/Base64Binary.java 2007-02-12 12:35:20.000000000 -0500 +@@ -18,8 +18,7 @@ + + import java.io.IOException; + +-import sun.misc.BASE64Decoder; +-import sun.misc.BASE64Encoder; ++import org.apache.commons.codec.binary.Base64; + + + /** A utility class for working with base64 encoding. +@@ -37,13 +36,13 @@ + * base64 encoded byte array. + */ + public static byte[] decode(String pValue) throws IOException { +- return (new BASE64Decoder()).decodeBuffer(pValue); ++ return (new Base64()).decode(pValue.getBytes()); + } + + /** Converts the base64 encoded byte array pValue + * into a string. + */ + public static String encode(byte[] pValue) { +- return (new BASE64Encoder()).encode(pValue); ++ return new String((new Base64()).encodeBase64(pValue)); + } + } diff --git a/ws-jaxme.changes b/ws-jaxme.changes index 8f6f1d0..bc939d4 100644 --- a/ws-jaxme.changes +++ b/ws-jaxme.changes @@ -1,8 +1,20 @@ ------------------------------------------------------------------- Tue Sep 12 06:58:17 UTC 2017 - fstrba@suse.com +- Upgrade to 0.5.2 - BuildConflict with java-devel >= 1.9, since this package cannot be built with jdk9 +- BuildRequire java-devel >= 1.6 +- Specify java source and target level 1.6 +- Modified patch: + * ws-jaxme-java6.patch + - Adapt to the new context +- Added patches: + * ws-jaxme-sourcetarget.patch + - Build with java source and target level 1.6 + * ws-jaxme-use-commons-codec.patch + - Use apache-commons-codec for base64 functionality instead + or private APIs that can disapear any time ------------------------------------------------------------------- Fri Jul 11 14:06:18 UTC 2014 - tchvatal@suse.com diff --git a/ws-jaxme.spec b/ws-jaxme.spec index ff8e26c..7b3b7b0 100644 --- a/ws-jaxme.spec +++ b/ws-jaxme.spec @@ -18,7 +18,7 @@ %define base_name jaxme Name: ws-jaxme -Version: 0.5.1 +Version: 0.5.2 Release: 0 Summary: Open source implementation of JAXB License: Apache-2.0 @@ -28,11 +28,15 @@ Source0: ws-jaxme-%{version}-src.tar.bz2 Patch0: ws-jaxme-docs_xml.patch Patch1: ws-jaxme-catalog.patch Patch2: ws-jaxme-java6.patch +Patch3: ws-jaxme-sourcetarget.patch +Patch4: ws-jaxme-use-commons-codec.patch BuildRequires: ant >= 1.6 BuildRequires: ant-apache-resolver BuildRequires: antlr +BuildRequires: apache-commons-codec BuildRequires: docbook-xsl-stylesheets BuildRequires: hsqldb +BuildRequires: java-devel >= 1.6 BuildRequires: javapackages-tools BuildRequires: jaxp_transform_impl BuildRequires: junit >= 3.8.1 @@ -96,16 +100,19 @@ A Java/XML binding compiler takes as input a schema description (in document. %prep -%setup -q -n %{name} +%setup -q find . -name "*.jar" | xargs rm %patch0 -b .sav %patch1 -b .sav %patch2 -b .java6 +%patch3 -p1 +%patch4 -p1 %build export OPT_JAR_LIST="ant/ant-trax jaxp_transform_impl ant/ant-apache-resolver" export CLASSPATH=$(build-classpath \ antlr \ + apache-commons-codec \ hsqldb \ log4j \ xalan-j2 \ @@ -116,7 +123,7 @@ export CLASSPATH=$(build-classpath \ xml-commons-resolver \ junit) ant all Docs.all \ - -Dant.build.javac.source=1.5 -Dant.build.javac.target=1.5 \ + -Dant.build.javac.source=1.6 -Dant.build.javac.target=1.6 \ -Dbuild.sysclasspath=first \ -Ddocbook.home=%{_datadir}/xml/docbook \ -Ddocbookxsl.home=%{_datadir}/xml/docbook/stylesheet/nwalsh/current