From: Jakub Bogusz Date: Sat, 24 Sep 2016 08:30:27 +0000 (+0200) Subject: - updated to 0.10.0 (note: new soname and API version) X-Git-Tag: auto/th/gxml-0.10.0-1 X-Git-Url: https://git.pld-linux.org/?p=packages%2Fgxml.git;a=commitdiff_plain;h=d9a0151d76412227d6b016e24b6e7d4ff7362fe5 - updated to 0.10.0 (note: new soname and API version) - added missing patch (missing files from git), bug770449,docs patches (build fixes) --- diff --git a/gxml-bug770449.patch b/gxml-bug770449.patch new file mode 100644 index 0000000..1a3478d --- /dev/null +++ b/gxml-bug770449.patch @@ -0,0 +1,13 @@ +--- gxml-0.10.0/gxml/libxml-NamedAttrMap.vala.orig 2016-02-22 20:23:53.000000000 +0100 ++++ gxml-0.10.0/gxml/libxml-NamedAttrMap.vala 2016-09-23 20:55:54.587484135 +0200 +@@ -32,8 +32,8 @@ + * {@link Gee.Iterable} interfaces. + */ + public abstract class AbstractNamedAttrMap : Object, +- Traversable>, +- Iterable> ++ Traversable, ++ Iterable + { + protected xElement elem; + diff --git a/gxml-docs.patch b/gxml-docs.patch new file mode 100644 index 0000000..327dc53 --- /dev/null +++ b/gxml-docs.patch @@ -0,0 +1,76 @@ +--- gxml-0.10.0/gxml/gxml-init.vala.orig 2015-11-04 20:13:59.000000000 +0100 ++++ gxml-0.10.0/gxml/gxml-init.vala 2016-09-23 21:49:12.100780960 +0200 +@@ -1,4 +1,4 @@ +-/** ++/* + * GXml + * + * Authors: +@@ -6,21 +6,21 @@ + * Daniel Espinosa + * + * +- * Copyright (c) 2015 Daniel Espinosa +- * +- * This library is free software; you can redistribute it and/or +- * modify it under the terms of the GNU Lesser General Public +- * License as published by the Free Software Foundation; either +- * version 3 of the License, or (at your option) any later version. +- * +- * This library is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * Lesser General Public License for more details. +- * +- * You should have received a copy of the GNU Lesser General Public +- * License along with this library; if not, write to the Free Software +- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * Copyright (c) 2015 Daniel Espinosa ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 3 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + namespace GXml { + class Init { +@@ -33,4 +33,4 @@ + } + } + } +-} +\ No newline at the end of file ++} +--- gxml-0.10.0/docs/valadoc/gtk-doc/Makefile.am.orig 2015-11-04 20:13:59.000000000 +0100 ++++ gxml-0.10.0/docs/valadoc/gtk-doc/Makefile.am 2016-09-23 21:38:45.854121445 +0200 +@@ -12,7 +12,8 @@ + --pkg gee-0.8 \ + --vapidir=$(top_srcdir)/gxml \ + --vapidir=$(top_srcdir)/vapi \ +- $(top_srcdir)/vapi/xlibxml-1.0.vapi ++ $(top_srcdir)/vapi/xlibxml-1.0.vapi \ ++ $(top_srcdir)/vapi/config.vapi + + sources= \ + $(top_srcdir)/gxml/*.vala +--- gxml-0.10.0/docs/valadoc/gir-docs/Makefile.am.orig 2015-07-08 20:11:44.000000000 +0200 ++++ gxml-0.10.0/docs/valadoc/gir-docs/Makefile.am 2016-09-23 21:51:31.140779742 +0200 +@@ -12,7 +12,8 @@ + --pkg gee-0.8 \ + --vapidir=$(top_srcdir)/gxml \ + --vapidir=$(top_srcdir)/vapi \ +- $(top_srcdir)/vapi/xlibxml-1.0.vapi ++ $(top_srcdir)/vapi/xlibxml-1.0.vapi \ ++ $(top_srcdir)/vapi/config.vapi + + sources= \ + $(top_srcdir)/gxml/*.vala diff --git a/gxml-missing.patch b/gxml-missing.patch new file mode 100644 index 0000000..8aff0e4 --- /dev/null +++ b/gxml-missing.patch @@ -0,0 +1,125 @@ +--- gxml-0.10.0/docs/mallard/C.orig/gxml-serializable-objectmodel.page 1970-01-01 01:00:00.000000000 +0100 ++++ gxml-0.10.0/docs/mallard/C/gxml-serializable-objectmodel.page 2016-09-23 21:21:52.000799682 +0200 +@@ -0,0 +1,19 @@ ++ ++ ++ ++ ++ ++ Daniel Espinosa ++ esodan@gmail.com ++ ++ ++

Creative Commons Share Alike 3.0

++
++ Home ++
++ ++ SerializableObjectModel implementation ++

SerializableObjectModel is a class implementing Serializable interface. This implementation consider each object as a XML node, represented in GXml as a GXml.Element and its properties is represented by GXml.Attr. Each property, if it is a Serializable object, is represented as child nodes.

++

If a object's value property must be represented as a XML node content, then it requires to override serialize_use_xml_node_value() and set value at serialized_xml_node_value, as decribed at Node content.

++
+--- gxml-0.10.0/docs/mallard/C.orig/gxml-serializable.page 1970-01-01 01:00:00.000000000 +0100 ++++ gxml-0.10.0/docs/mallard/C/gxml-serializable.page 2016-09-23 21:21:52.000799682 +0200 +@@ -0,0 +1,72 @@ ++ ++ ++ ++ ++ ++ Daniel Espinosa ++ esodan@gmail.com ++ ++ ++

Creative Commons Share Alike 3.0

++
++ ++
++ ++ Serializable Interface ++

Implementors of this interface, could define or override the way you want to represent your class in a XML file.

++
++ Serializable properties ++

You can get control on class's properties to be serialized to XML. Allowing to provide ones, storing runtime information and ones to be stored in XML. By default, all object's properties are serialized. In order to skip properties from serialization process you must add its canonical name as key and its canonical name as value, to ignored_serializable_properties store.

++

Implementator must use ignored_serializable_properties property to check if a property should be serialized. This allows to dynamically remove, on convenience, properties on serialization. You can use list_serializable_properties() method as a convenient function, using its default implementation, or even override it at your convenience to automate dynamic serializable properties at run time; just make sure to skip the unwanted properties.

++

There are more methods to avoid properties serialization, like to override init_properties default implementation. It stores all Serializale's properties to be ignored by default; you must ensure to initialize correctly, by calling default_init_properties() method before any other code in your overrided method.

++
++ Unknown XML elements ++

XML allows great flexibility, providing different ways to represent the same information. This is a problem when you try to deserialize them.

++

In order to deserialize correctly, you must create your XML, both by serializing a Serializable object or by hand writing. By using the former, you can add extra information, like nodes or properties, but most of them could be ignored or lost on deserialization/serialization process. To avoid data lost, you can override get_enable_unknown_serializable_property () method in order to return true, your implementation or the ones in GXml, will store all unknown properties and nodes on deserialization and must serialize again back to the XML file. Even you are allowed to get this unknown objects by iterating on unknown_serializable_property hash table.

++
++
++ Property's name ++

When serialize a class property, by default it uses its name given on class declaration, but is less common to see XML node mproperties with name like your_property, but more common is to use YourProperty. In order to use this kind of names, your implementation should use properties' nick name and override property_use_nick() method to return true. This should instruct your code to use this method to use property's nick name. This is the default in GXml default implementations.

++

In order to set node's name, you should override node_name() method.

++
++
++
++ XML node's content ++

By default GXml's implementations doesn't deseriaze/serialize XML node contents. In order to enable it, you must override serialize_use_xml_node_value() method to return true and store XML node's content to serialized_xml_node_value property.

++

Implementors could set up methods to provide a clean easy to use API to set nodes contents. In most cases, users would like to set a value through a getter or setter or through a property in the class. If you use a property, you should add it to ignored_serializable_properties in order to see its value in a XML node property.

++
++
++ XML node name ++

On serialization XML node's name could be set to use a prety one. By default, node's name is the class name; becareful because name could be GXmlSerializable, while may you prefer to use just 'Serializable'.

++

In order to set node's name, you should override node_name() method.

++
++
++ Serialize ++

Serializable interface allows you to implement your own serialize() method. Your implementation should take a GXml.Node and serialize over it. Given GXml.Node, could be an GXml.Element or a GXml.Document, your implementaiton should take care about this and return XML nodes representing your class object.

++
++
++ Serialize a property ++

Serializable interface allows you to implement your own serialize_property() method. Your implementation should take a GXml.Element to serialize on your property. Your implementation could detect the property to serialize and get its value, from given GLib.ParamSpec. Your serialization could be add a GXml.Attr or child GXml.Element to the given GXml.Element or set a contents to it; its your choice.

++
++
++ Deserialize ++

Serializable interface allows you to implement your own deserialize() method. Your implementation should take a GXml.Node and deserialize from it. Given GXml.Node, could be an GXml.Element or a GXml.Document, your implementaiton should take care about this and return XML nodes representing your class object.

++

Your implementation could take GXml.Element's name to detect the property to set up or detect the root element in a GXml.Document to use. Then you can iterate over all node's properties and set up your object properties; you can use gvalue_to_string() to transform most common value types from string to the required value's type.

++
++ Supported types ++

Serializable interface support a number of data types to convert from its string representation. These are supported types:

++ ++

integers: int8, int64, uint, long, ulong, char, uchar

++

boolean

++

floats: float, double

++

enumerations

++
++
++

Enumerations have a set of utility methods to better represent on serialisation/deserialization.

++

Enumerations could be converted to string using its definition on GLib.EnumClass, by taking its nick name directly or converting to its camel case representation.

++

Any enumeration value type in a GLib.Object's property could be deserialized from its definition given on GLib.EnumClass (name and nick) or from its camel case representation.

++
++
++
++
+--- gxml-0.10.0/docs/mallard/C.orig/index.page 1970-01-01 01:00:00.000000000 +0100 ++++ gxml-0.10.0/docs/mallard/C/index.page 2016-09-23 21:21:52.000799682 +0200 +@@ -0,0 +1,25 @@ ++ ++ ++ ++ ++ ++ Daniel Espinosa ++ esodan@gmail.com ++ ++ ++

Creative Commons Share Alike 3.0

++
++
++ ++ ++ GXml Serialization Framework Manual ++ ++

++ This guide provides examples and applications of GXml's Serialization Framework. ++

++

GXml Serialization Framework allows GLib.Object objects to be serialized to XML files.

++

It has a Serializable interface to be implemented by a GLib.Object class, allowing great flexibility on how the object must be represented in XML format.

++

Today GXml have two implementations, one of them is SerializableObjectModel, using a model where each object is a XML node and a each object's property is a XML node property.

++

Serialization Framework have containers implementations, allowing to store Serializable objects in arrays, hash tables and multikey stores.

++
diff --git a/gxml.spec b/gxml.spec index fac9dd3..31d7eee 100644 --- a/gxml.spec +++ b/gxml.spec @@ -1,17 +1,20 @@ # # Conditional build: -%bcond_with apidocs # API documentation [doesn't build up to 0.8.0 release] +%bcond_without apidocs # API documentation %bcond_without static_libs # static library Summary: GXml - GObject API that wraps around libxml2 Summary(pl.UTF-8): GXml - API GObject obudowujące libxml2 Name: gxml -Version: 0.8.2 -Release: 2 +Version: 0.10.0 +Release: 1 License: LGPL v2.1+ Group: Libraries -Source0: http://ftp.gnome.org/pub/GNOME/sources/gxml/0.8/%{name}-%{version}.tar.xz -# Source0-md5: 77af0fb4e1e178b60fc898b8beeaabfe +Source0: http://ftp.gnome.org/pub/GNOME/sources/gxml/0.10/%{name}-%{version}.tar.xz +# Source0-md5: a268a60a6bc9fbad3f0fd580a0a93538 +Patch0: %{name}-bug770449.patch +Patch1: %{name}-missing.patch +Patch2: %{name}-docs.patch URL: https://github.com/GNOME/gxml BuildRequires: autoconf >= 2.65 BuildRequires: automake >= 1:1.11 @@ -82,8 +85,22 @@ Vala API for GXml library. %description -n vala-gxml -l pl.UTF-8 API języka Vala dla biblioteki GXml. +%package apidocs +Summary: API documentation for GXml library +Summary(pl.UTF-8): Dokumentacja API biblioteki GXml +Group: Documentation + +%description apidocs +API documentation for GXml library. + +%description apidocs -l pl.UTF-8 +Dokumentacja API biblioteki GXml. + %prep %setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 %build %{__intltoolize} @@ -93,25 +110,31 @@ API języka Vala dla biblioteki GXml. %{__autoheader} %{__automake} %configure \ - --enable-gi-system-install \ --disable-silent-rules \ %{?with_static_libs:--enable-static} \ %{?with_apidocs:--enable-docs --enable-gtk-docs --enable-valadoc} -# --enable-gir-docs --enable-devhelp-docs ??? +# --enable-devhelp-docs is almost the same as gtk-docs html, but built with valadoc(?) and installed to devhelp dirs +# --enable-gir-docs ??? %{__make} %install rm -rf $RPM_BUILD_ROOT %{__make} install \ - DESTDIR=$RPM_BUILD_ROOT + DESTDIR=$RPM_BUILD_ROOT \ + gxmlgtkdocdir=%{_gtkdocdir}/gxml # obsoleted by pkg-config -%{__rm} $RPM_BUILD_ROOT%{_libdir}/libgxml-0.6.la +%{__rm} $RPM_BUILD_ROOT%{_libdir}/libgxml-0.10.la # packaged as %doc %{__rm} -r $RPM_BUILD_ROOT%{_prefix}/doc -%find_lang GXml +# what a mess... gtk-doc XML intermediate files are installed to html dir... +%{__rm} -r $RPM_BUILD_ROOT%{_gtkdocdir}/gxml/*.{bottom,top,stamp,txt,types,xml} +cp -p docs/valadoc/gtk-doc/gtk-doc/gxml/html/* $RPM_BUILD_ROOT%{_gtkdocdir}/gxml + +# "GXml" gettext domain, "gxml" gnome help +%find_lang GXml --with-gnome --all-name %clean rm -rf $RPM_BUILD_ROOT @@ -122,24 +145,30 @@ rm -rf $RPM_BUILD_ROOT %files -f GXml.lang %defattr(644,root,root,755) %doc AUTHORS ChangeLog NEWS README -%attr(755,root,root) %{_libdir}/libgxml-0.6.so.*.*.* -%attr(755,root,root) %ghost %{_libdir}/libgxml-0.6.so.8 -%{_libdir}/girepository-1.0/GXml-0.6.typelib +%attr(755,root,root) %{_libdir}/libgxml-0.10.so.*.*.* +%attr(755,root,root) %ghost %{_libdir}/libgxml-0.10.so.10 +%{_libdir}/girepository-1.0/GXml-0.10.typelib %files devel %defattr(644,root,root,755) -%attr(755,root,root) %{_libdir}/libgxml-0.6.so -%{_includedir}/gxml-0.6 -%{_datadir}/gir-1.0/GXml-0.6.gir -%{_pkgconfigdir}/gxml-0.6.pc +%attr(755,root,root) %{_libdir}/libgxml-0.10.so +%{_includedir}/gxml-0.10 +%{_datadir}/gir-1.0/GXml-0.10.gir +%{_pkgconfigdir}/gxml-0.10.pc %if %{with static_libs} %files static %defattr(644,root,root,755) -%{_libdir}/libgxml-0.6.a +%{_libdir}/libgxml-0.10.a %endif %files -n vala-gxml %defattr(644,root,root,755) -%{_datadir}/vala/vapi/gxml-0.6.deps -%{_datadir}/vala/vapi/gxml-0.6.vapi +%{_datadir}/vala/vapi/gxml-0.10.deps +%{_datadir}/vala/vapi/gxml-0.10.vapi + +%if %{with apidocs} +%files apidocs +%defattr(644,root,root,755) +%{_gtkdocdir}/gxml +%endif