From ded4dafefbc67f4bafbbca4788fdeee9bde6e4b6 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Wed, 5 Nov 2025 15:44:17 +0000 Subject: automatic import of telepathy-logger --- .gitignore | 1 + 0001-tools-Fix-the-build-with-Python-3.patch | 430 +++++++++++++++++++++++++++ sources | 1 + telepathy-logger.spec | 119 ++++++++ 4 files changed, 551 insertions(+) create mode 100644 0001-tools-Fix-the-build-with-Python-3.patch create mode 100644 sources create mode 100644 telepathy-logger.spec diff --git a/.gitignore b/.gitignore index e69de29..f171c24 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/telepathy-logger-0.8.2.tar.bz2 diff --git a/0001-tools-Fix-the-build-with-Python-3.patch b/0001-tools-Fix-the-build-with-Python-3.patch new file mode 100644 index 0000000..f6f2b3d --- /dev/null +++ b/0001-tools-Fix-the-build-with-Python-3.patch @@ -0,0 +1,430 @@ +From ffc23c3b3d49d265997b6bb5d55d9463080c1cc8 Mon Sep 17 00:00:00 2001 +From: Debarshi Ray +Date: Mon, 10 Feb 2020 15:20:38 +0100 +Subject: [PATCH] tools: Fix the build with Python 3 + +This is a subset of commit 4a9fdeb64bc87f09 from master. + +https://gitlab.freedesktop.org/telepathy/telepathy-logger/merge_requests/1 +--- + tools/c-constants-gen.py | 12 ++++++------ + tools/glib-client-gen.py | 18 ++++++------------ + tools/glib-client-marshaller-gen.py | 20 ++++++++++---------- + tools/glib-ginterface-gen.py | 22 ++++++++-------------- + tools/glib-gtypes-generator.py | 14 +++++++------- + tools/glib-interfaces-gen.py | 14 +++++++------- + tools/libglibcodegen.py | 4 ++-- + tools/libtpcodegen.py | 22 +++++++++++++++++++++- + tools/xincludator.py | 13 ++++++++++--- + 9 files changed, 77 insertions(+), 62 deletions(-) + +diff --git a/tools/c-constants-gen.py b/tools/c-constants-gen.py +index c7a93d3714e5..a08afee06196 100644 +--- a/tools/c-constants-gen.py ++++ b/tools/c-constants-gen.py +@@ -3,7 +3,7 @@ + from sys import argv, stdout, stderr + import xml.dom.minidom + +-from libtpcodegen import file_set_contents ++from libtpcodegen import file_set_contents, u + from libglibcodegen import NS_TP, get_docstring, \ + get_descendant_text, get_by_path + +@@ -12,7 +12,7 @@ class Generator(object): + self.prefix = prefix + '_' + self.spec = get_by_path(dom, "spec")[0] + +- self.output_base = output_base ++ self.output_base = output_base + self.__header = [] + self.__docs = [] + +@@ -21,14 +21,14 @@ class Generator(object): + self.do_body() + self.do_footer() + +- file_set_contents(self.output_base + '.h', ''.join(self.__header)) +- file_set_contents(self.output_base + '-gtk-doc.h', ''.join(self.__docs)) ++ file_set_contents(self.output_base + '.h', u('').join(self.__header).encode('utf-8')) ++ file_set_contents(self.output_base + '-gtk-doc.h', u('').join(self.__docs).encode('utf-8')) + + def write(self, code): +- self.__header.append(code.encode('utf-8')) ++ self.__header.append(code) + + def d(self, code): +- self.__docs.append(code.encode('utf-8')) ++ self.__docs.append(code) + + # Header + def do_header(self): +diff --git a/tools/glib-client-gen.py b/tools/glib-client-gen.py +index 6b2b97f1d80d..fb083a114314 100644 +--- a/tools/glib-client-gen.py ++++ b/tools/glib-client-gen.py +@@ -27,8 +27,8 @@ import os.path + import xml.dom.minidom + from getopt import gnu_getopt + +-from libtpcodegen import file_set_contents +-from libglibcodegen import Signature, type_to_gtype, cmp_by_name, \ ++from libtpcodegen import file_set_contents, key_by_name, u ++from libglibcodegen import Signature, type_to_gtype, \ + get_docstring, xml_escape, get_deprecated + + +@@ -74,18 +74,12 @@ class Generator(object): + self.guard = opts.get('--guard', None) + + def h(self, s): +- if isinstance(s, unicode): +- s = s.encode('utf-8') + self.__header.append(s) + + def b(self, s): +- if isinstance(s, unicode): +- s = s.encode('utf-8') + self.__body.append(s) + + def d(self, s): +- if isinstance(s, unicode): +- s = s.encode('utf-8') + self.__docs.append(s) + + def get_iface_quark(self): +@@ -1187,7 +1181,7 @@ class Generator(object): + self.b('') + + nodes = self.dom.getElementsByTagName('node') +- nodes.sort(cmp_by_name) ++ nodes.sort(key=key_by_name) + + for node in nodes: + self.do_interface(node) +@@ -1240,9 +1234,9 @@ class Generator(object): + self.h('#endif /* defined (%s) */' % self.guard) + self.h('') + +- file_set_contents(self.basename + '.h', '\n'.join(self.__header)) +- file_set_contents(self.basename + '-body.h', '\n'.join(self.__body)) +- file_set_contents(self.basename + '-gtk-doc.h', '\n'.join(self.__docs)) ++ file_set_contents(self.basename + '.h', u('\n').join(self.__header).encode('utf-8')) ++ file_set_contents(self.basename + '-body.h', u('\n').join(self.__body).encode('utf-8')) ++ file_set_contents(self.basename + '-gtk-doc.h', u('\n').join(self.__docs).encode('utf-8')) + + def types_to_gtypes(types): + return [type_to_gtype(t)[1] for t in types] +diff --git a/tools/glib-client-marshaller-gen.py b/tools/glib-client-marshaller-gen.py +index cb27d638a45d..cd9823bdffb2 100644 +--- a/tools/glib-client-marshaller-gen.py ++++ b/tools/glib-client-marshaller-gen.py +@@ -31,23 +31,23 @@ class Generator(object): + for signal in signals: + self.do_signal(signal) + +- print 'void' +- print '%s_register_dbus_glib_marshallers (void)' % self.prefix +- print '{' ++ print('void') ++ print('%s_register_dbus_glib_marshallers (void)' % self.prefix) ++ print('{') + +- all = self.marshallers.keys() ++ all = list(self.marshallers.keys()) + all.sort() + for marshaller in all: + rhs = self.marshallers[marshaller] + +- print ' dbus_g_object_register_marshaller (' +- print ' g_cclosure_marshal_generic,' +- print ' G_TYPE_NONE, /* return */' ++ print(' dbus_g_object_register_marshaller (') ++ print(' g_cclosure_marshal_generic,') ++ print(' G_TYPE_NONE, /* return */') + for type in rhs: +- print ' G_TYPE_%s,' % type.replace('VOID', 'NONE') +- print ' G_TYPE_INVALID);' ++ print(' G_TYPE_%s,' % type.replace('VOID', 'NONE')) ++ print(' G_TYPE_INVALID);') + +- print '}' ++ print('}') + + + def types_to_gtypes(types): +diff --git a/tools/glib-ginterface-gen.py b/tools/glib-ginterface-gen.py +index 784397738fc2..97369d36fe48 100644 +--- a/tools/glib-ginterface-gen.py ++++ b/tools/glib-ginterface-gen.py +@@ -26,8 +26,8 @@ import sys + import os.path + import xml.dom.minidom + +-from libtpcodegen import file_set_contents +-from libglibcodegen import Signature, type_to_gtype, cmp_by_name, \ ++from libtpcodegen import file_set_contents, key_by_name, u ++from libglibcodegen import Signature, type_to_gtype, \ + NS_TP, dbus_gutils_wincaps_to_uscore + + +@@ -85,18 +85,12 @@ class Generator(object): + self.allow_havoc = allow_havoc + + def h(self, s): +- if isinstance(s, unicode): +- s = s.encode('utf-8') + self.__header.append(s) + + def b(self, s): +- if isinstance(s, unicode): +- s = s.encode('utf-8') + self.__body.append(s) + + def d(self, s): +- if isinstance(s, unicode): +- s = s.encode('utf-8') + self.__docs.append(s) + + def do_node(self, node): +@@ -733,7 +727,7 @@ class Generator(object): + + def __call__(self): + nodes = self.dom.getElementsByTagName('node') +- nodes.sort(cmp_by_name) ++ nodes.sort(key=key_by_name) + + self.h('#include ') + self.h('#include ') +@@ -763,12 +757,12 @@ class Generator(object): + + self.h('') + self.b('') +- file_set_contents(self.basename + '.h', '\n'.join(self.__header)) +- file_set_contents(self.basename + '.c', '\n'.join(self.__body)) +- file_set_contents(self.basename + '-gtk-doc.h', '\n'.join(self.__docs)) ++ file_set_contents(self.basename + '.h', u('\n').join(self.__header).encode('utf-8')) ++ file_set_contents(self.basename + '.c', u('\n').join(self.__body).encode('utf-8')) ++ file_set_contents(self.basename + '-gtk-doc.h', u('\n').join(self.__docs).encode('utf-8')) + + def cmdline_error(): +- print """\ ++ print("""\ + usage: + gen-ginterface [OPTIONS] xmlfile Prefix_ + options: +@@ -788,7 +782,7 @@ options: + void symbol (DBusGMethodInvocation *context) + and return some sort of "not implemented" error via + dbus_g_method_return_error (context, ...) +-""" ++""") + sys.exit(1) + + +diff --git a/tools/glib-gtypes-generator.py b/tools/glib-gtypes-generator.py +index 21dfc6aa78fe..1477bd37bad5 100644 +--- a/tools/glib-gtypes-generator.py ++++ b/tools/glib-gtypes-generator.py +@@ -23,7 +23,7 @@ + import sys + import xml.dom.minidom + +-from libtpcodegen import file_set_contents ++from libtpcodegen import file_set_contents, u + from libglibcodegen import escape_as_identifier, \ + get_docstring, \ + NS_TP, \ +@@ -68,13 +68,13 @@ class GTypesGenerator(object): + self.need_other_arrays = {} + + def h(self, code): +- self.header.append(code.encode("utf-8")) ++ self.header.append(code) + + def c(self, code): +- self.body.append(code.encode("utf-8")) ++ self.body.append(code) + + def d(self, code): +- self.docs.append(code.encode('utf-8')) ++ self.docs.append(code) + + def do_mapping_header(self, mapping): + members = mapping.getElementsByTagNameNS(NS_TP, 'member') +@@ -292,9 +292,9 @@ class GTypesGenerator(object): + self.c(' return t;\n') + self.c('}\n\n') + +- file_set_contents(self.output + '.h', ''.join(self.header)) +- file_set_contents(self.output + '-body.h', ''.join(self.body)) +- file_set_contents(self.output + '-gtk-doc.h', ''.join(self.docs)) ++ file_set_contents(self.output + '.h', u('').join(self.header).encode('utf-8')) ++ file_set_contents(self.output + '-body.h', u('').join(self.body).encode('utf-8')) ++ file_set_contents(self.output + '-gtk-doc.h', u('').join(self.docs).encode('utf-8')) + + if __name__ == '__main__': + argv = sys.argv[1:] +diff --git a/tools/glib-interfaces-gen.py b/tools/glib-interfaces-gen.py +index 410762cdeb11..b67d7b4f0c80 100644 +--- a/tools/glib-interfaces-gen.py ++++ b/tools/glib-interfaces-gen.py +@@ -3,7 +3,7 @@ + from sys import argv, stdout, stderr + import xml.dom.minidom + +-from libtpcodegen import file_set_contents ++from libtpcodegen import file_set_contents, u + from libglibcodegen import NS_TP, get_docstring, \ + get_descendant_text, get_by_path + +@@ -24,22 +24,22 @@ class Generator(object): + self.spec = get_by_path(dom, "spec")[0] + + def h(self, code): +- self.decls.append(code.encode('utf-8')) ++ self.decls.append(code) + + def c(self, code): +- self.impls.append(code.encode('utf-8')) ++ self.impls.append(code) + + def d(self, code): +- self.docs.append(code.encode('utf-8')) ++ self.docs.append(code) + + def __call__(self): + for f in self.h, self.c: + self.do_header(f) + self.do_body() + +- file_set_contents(self.implfile, ''.join(self.impls)) +- file_set_contents(self.declfile, ''.join(self.decls)) +- file_set_contents(self.docfile, ''.join(self.docs)) ++ file_set_contents(self.implfile, u('').join(self.impls).encode('utf-8')) ++ file_set_contents(self.declfile, u('').join(self.decls).encode('utf-8')) ++ file_set_contents(self.docfile, u('').join(self.docs).encode('utf-8')) + + # Header + def do_header(self, f): +diff --git a/tools/libglibcodegen.py b/tools/libglibcodegen.py +index 6a9d21485031..6cd1a6277841 100644 +--- a/tools/libglibcodegen.py ++++ b/tools/libglibcodegen.py +@@ -154,7 +154,7 @@ def type_to_gtype(s): + return ("GHashTable *", "DBUS_TYPE_G_STRING_STRING_HASHTABLE", "BOXED", False) + elif s[:2] == 'a{': #some arbitrary hash tables + if s[2] not in ('y', 'b', 'n', 'q', 'i', 'u', 's', 'o', 'g'): +- raise Exception, "can't index a hashtable off non-basic type " + s ++ raise Exception("can't index a hashtable off non-basic type " + s) + first = type_to_gtype(s[2]) + second = type_to_gtype(s[3:-1]) + return ("GHashTable *", "(dbus_g_type_get_map (\"GHashTable\", " + first[1] + ", " + second[1] + "))", "BOXED", False) +@@ -169,4 +169,4 @@ def type_to_gtype(s): + return ("GValueArray *", gtype, "BOXED", True) + + # we just don't know .. +- raise Exception, "don't know the GType for " + s ++ raise Exception("don't know the GType for " + s) +diff --git a/tools/libtpcodegen.py b/tools/libtpcodegen.py +index 7e9eb9a5078d..99de66340d78 100644 +--- a/tools/libtpcodegen.py ++++ b/tools/libtpcodegen.py +@@ -21,6 +21,7 @@ please make any changes there. + # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + import os ++import sys + from string import ascii_letters, digits + + +@@ -28,6 +29,20 @@ NS_TP = "http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" + + _ASCII_ALNUM = ascii_letters + digits + ++if sys.version_info[0] >= 3: ++ def u(s): ++ """Return s, which must be a str literal with no non-ASCII characters. ++ This is like a more restricted form of the Python 2 u'' syntax. ++ """ ++ return s.encode('ascii').decode('ascii') ++else: ++ def u(s): ++ """Return a Unicode version of s, which must be a str literal ++ (a bytestring) in which each byte is an ASCII character. ++ This is like a more restricted form of the u'' syntax. ++ """ ++ return s.decode('ascii') ++ + def file_set_contents(filename, contents): + try: + os.remove(filename) +@@ -38,13 +53,15 @@ def file_set_contents(filename, contents): + except OSError: + pass + +- open(filename + '.tmp', 'w').write(contents) ++ open(filename + '.tmp', 'wb').write(contents) + os.rename(filename + '.tmp', filename) + + def cmp_by_name(node1, node2): + return cmp(node1.getAttributeNode("name").nodeValue, + node2.getAttributeNode("name").nodeValue) + ++def key_by_name(node): ++ return node.getAttributeNode("name").nodeValue + + def escape_as_identifier(identifier): + """Escape the given string to be a valid D-Bus object path or service +@@ -168,6 +185,9 @@ class _SignatureIter: + self.remaining = string + + def next(self): ++ return self.__next__() ++ ++ def __next__(self): + if self.remaining == '': + raise StopIteration + +diff --git a/tools/xincludator.py b/tools/xincludator.py +index 63e106ace136..f9ed49ce475c 100644 +--- a/tools/xincludator.py ++++ b/tools/xincludator.py +@@ -1,17 +1,19 @@ + #!/usr/bin/python + ++import sys + from sys import argv, stdout, stderr + import codecs, locale + import os + import xml.dom.minidom + +-stdout = codecs.getwriter('utf-8')(stdout) ++if sys.version_info[0] < 3: ++ stdout = codecs.getwriter('utf-8')(stdout) + + NS_XI = 'http://www.w3.org/2001/XInclude' + + def xincludate(dom, base, dropns = []): + remove_attrs = [] +- for i in xrange(dom.documentElement.attributes.length): ++ for i in range(dom.documentElement.attributes.length): + attr = dom.documentElement.attributes.item(i) + if attr.prefix == 'xmlns': + if attr.localName in dropns: +@@ -34,6 +36,11 @@ if __name__ == '__main__': + argv = argv[1:] + dom = xml.dom.minidom.parse(argv[0]) + xincludate(dom, argv[0]) +- xml = dom.toxml() ++ ++ if sys.version_info[0] >= 3: ++ xml = dom.toxml(encoding=None) ++ else: ++ xml = dom.toxml() ++ + stdout.write(xml) + stdout.write('\n') +-- +2.24.1 + diff --git a/sources b/sources new file mode 100644 index 0000000..31012b0 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +c2f6a31c76cbdf8790500cf4f872ba71 telepathy-logger-0.8.2.tar.bz2 diff --git a/telepathy-logger.spec b/telepathy-logger.spec new file mode 100644 index 0000000..b0b1c32 --- /dev/null +++ b/telepathy-logger.spec @@ -0,0 +1,119 @@ +Name: telepathy-logger +Version: 0.8.2 +Release: 15 +Summary: Centralized Logging for the Telepathy Framework + +License: LGPL-2.1-or-later +URL: https://telepathy.freedesktop.org/components/telepathy-logger/ +Source0: https://telepathy.freedesktop.org/releases/telepathy-logger/%{name}-%{version}.tar.bz2 + +Patch0: 0001-tools-Fix-the-build-with-Python-3.patch + +BuildRequires: pkgconfig(dbus-1) >= 1.1.0 +BuildRequires: pkgconfig(dbus-glib-1) >= 0.82 +BuildRequires: pkgconfig(gio-2.0) +BuildRequires: pkgconfig(glib-2.0) >= 2.32 +BuildRequires: pkgconfig(gobject-2.0) +BuildRequires: pkgconfig(libxml-2.0) +BuildRequires: pkgconfig(sqlite3) +BuildRequires: pkgconfig(telepathy-glib) >= 0.21.2 +BuildRequires: gobject-introspection-devel >= 0.9.6 +BuildRequires: gtk-doc >= 1.10 +BuildRequires: intltool >= 0.35.0 +BuildRequires: /usr/bin/dbus-binding-tool +BuildRequires: /usr/bin/python3 +BuildRequires: /usr/bin/xsltproc +BuildRequires: dbus-daemon + +Requires: telepathy-filesystem +Conflicts: %{name}-help < 0.8.2-14 + +%description +telepathy-logger is a daemon that centralizes the logging of all +communication within the Telepathy framework. This prevents the +UIs from having to implement their own solution that would end +up into having multiple incomplete databases. + +%package devel +Summary: Header files for telepathy-logger +Requires: %{name} = %{version}-%{release} + +%description devel +Header files for telepathy-logger + +%package_help + +%prep +%autosetup -n %{name}-%{version} -p1 +%if "%{_libdir}" != "/usr/lib" +sed -i.rpath -e 's|"/lib /usr/lib|"/%{_lib} %{_libdir}|' configure +%endif + +%build +%configure --enable-introspection=yes --disable-static +sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool +%make_build + +%install +%make_install +%delete_la_and_a + +%check +%make_build check + +%files +%doc README +%license COPYING +%{_libdir}/*.so.* +%{_libdir}/girepository-1.0/*.typelib +%{_libexecdir}/telepathy-logger +%{_datadir}/dbus-1/services/*.service +%{_datadir}/telepathy/clients/Logger.client +%{_datadir}/glib-2.0/schemas/*.xml + +%files devel +%{_libdir}/*.so +%{_libdir}/pkgconfig/*.pc +%{_datadir}/gir-1.0/*.gir +%{_includedir}/telepathy-logger-0.2 + +%files help +%doc NEWS +%doc %{_datadir}/gtk-doc/html/telepathy-logger + +%changelog +* Wed Nov 05 2025 Funda Wang - 0.8.2-15 +- move glib schemas into main package + +* Fri Jan 13 2023 Wenlong Zhang - 0.8.2-14 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix build error dbus-daemon: command not found + +* Thu Oct 29 2020 jinzhimin - 0.8.2-13 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix build failed in python3 + +* Fri Feb 28 2020 hexiujun - 0.8.2-12 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC:fix the build with python3 + +* Mon Oct 21 2019 openEuler Buildteam - 0.8.2-11 +- Type:enhancement +- Id:NA +- SUG:NA +- DESC:modify the location of COPYING + +* Wed Oct 16 2019 chengquan - 0.8.2-10 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:remove useless buildrequires + +* Mon Sep 2 2019 openEuler Buildteam - 0.8.2-9 +- Package init -- cgit v1.2.3