--- yum-metadata-parser-1.1.4.orig/debian/changelog
+++ yum-metadata-parser-1.1.4/debian/changelog
@@ -0,0 +1,57 @@
+yum-metadata-parser (1.1.4-99) unstable; urgency=low
+
+  * Port code from python2.x to python3.x.
+
+ -- Biao Wang <biao716.wang@samsung.com>  Thu, 04 Aug 2022 14:27:01 +0200
+
+yum-metadata-parser (1.1.4-1) unstable; urgency=low
+
+  * New upstream release.
+  * New maintainer. (Closes: #673978) Thanks to Adam for his work.
+  * Drop patches no longer needed:
+    - 000-Fix_CFLAGS_handling.dpatch: Do not clear default CFLAGS.
+    - 001-Use_pysqlite2.dpatch: No need, sqlite3 has long been standard.
+  * Drop alternative Depends on python-pysqlite2, sqlite3 has long been
+    standard.
+  * Drop Build-Depends on dpatch and update source format to 3.0 (quilt).
+    Thanks to Jari Aalto. (Closes: #664297)
+  * Bump debhelper compatibility level to 9.
+  * Update packaging to current Python Policy recommendations:
+    - debian/rules: Switch to using dh --with python2.
+    - Bump Build-Depends on python-all-dev to (>= 2.6.6-3~) for switch to
+      building with dh_python2.
+    - Drop Build-Depends on python-all, it is pulled in via python-all-dev.
+    - Drop Build-Depends on deprecated python-support, now using dh_python2.
+    - Add X-Python-Version control field.
+  * Drop obsolete debian/pyversions.
+  * debian/control:
+    - Update package description.
+    - Add Homepage control field. (Closes: #615396)
+    - Add Vcs-Git and Vcs-Browser fields.
+    - Bump Standards-Version to 3.9.4. No further changes needed.
+  * debian/copyright: Convert to machine-readable format 1.0.
+  * debian/watch: Update to correct upstream URL.
+
+ -- Mike Miller <mtmiller@ieee.org>  Sun, 02 Jun 2013 11:55:17 -0400
+
+yum-metadata-parser (1.1.2-1) unstable; urgency=low
+
+  * New upstream release.
+  * Add debian/watch files, thanks to Piotr Ożarowski.
+  * Drop useless debian/dirs.
+
+ -- Adam Cécile (Le_Vert) <gandalf@le-vert.net>  Thu, 04 Oct 2007 14:27:01 +0200
+
+yum-metadata-parser (1.1.1-2) unstable; urgency=low
+
+  * Add missing runtime dependency on python-pysqlite2 (or python > 2.5).
+  * Use pysqlite2 instead of python-sqlite (001-Use_pysqlite2 patch),
+    suggested by Piotr Ożarowski.
+
+ -- Adam Cécile (Le_Vert) <gandalf@le-vert.net>  Mon, 27 Aug 2007 10:32:17 +0200
+
+yum-metadata-parser (1.1.1-1) unstable; urgency=low
+
+  * Initial release (Closes: #435879).
+
+ -- Adam Cécile (Le_Vert) <gandalf@le-vert.net>  Fri, 03 Aug 2007 22:52:22 +0200
--- yum-metadata-parser-1.1.4.orig/debian/compat
+++ yum-metadata-parser-1.1.4/debian/compat
@@ -0,0 +1 @@
+7
--- yum-metadata-parser-1.1.4.orig/debian/control
+++ yum-metadata-parser-1.1.4/debian/control
@@ -0,0 +1,19 @@
+Source: yum-metadata-parser
+Section: python
+Priority: extra
+Maintainer: Mike Miller <mtmiller@ieee.org>
+Build-Depends: debhelper (>= 9), dh-python, python3-dev, python3-all-dev, pkg-config, libglib2.0-dev, libsqlite3-dev, libxml2-dev
+Standards-Version: 3.9.4
+X-Python-Version: >= 3.1
+Homepage: http://yum.baseurl.org/
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=users/mtmiller-guest/yum-metadata-parser.git
+Vcs-Git: git://anonscm.debian.org/users/mtmiller-guest/yum-metadata-parser.git
+
+Package: python3-sqlitecachec
+Architecture: any
+Depends: ${shlibs:Depends}, ${python3:Depends}, ${misc:Depends}
+Provides: ${python3:Provides}
+Description: Fast metadata parser for yum
+ Python module providing a fast metadata parser for yum implemented in C.
+ The sqlitecachec module is used by createrepo and the yum package manager
+ to update and query local caches of RPM package repositories.
--- yum-metadata-parser-1.1.4.orig/debian/docs
+++ yum-metadata-parser-1.1.4/debian/docs
@@ -0,0 +1 @@
+README
--- yum-metadata-parser-1.1.4.orig/debian/rules
+++ yum-metadata-parser-1.1.4/debian/rules
@@ -0,0 +1,4 @@
+#!/usr/bin/make -f
+
+%:
+	dh $@ --with python3 --buildsystem=pybuild
--- yum-metadata-parser-1.1.4.orig/packaging/yum-metadata-parser.changes
+++ yum-metadata-parser-1.1.4/packaging/yum-metadata-parser.changes
@@ -0,0 +1,3 @@
+* Tue Feb 19 2013 Anas Nashif <anas.nashif@intel.com> upstream/1.1.4@39a3c74
+- Initial packaging
+
--- yum-metadata-parser-1.1.4.orig/packaging/yum-metadata-parser.spec
+++ yum-metadata-parser-1.1.4/packaging/yum-metadata-parser.spec
@@ -0,0 +1,38 @@
+
+Name:           yum-metadata-parser
+Version:        1.1.4
+Release:        0
+License:        GPL-2.0
+Summary:        A fast metadata parser for yum
+Url:            http://devel.linux.duke.edu/cgi-bin/viewcvs.cgi/yum-metadata-parser/
+Group:          Development/Libraries
+Source0:        %{name}-%{version}.tar.bz2
+BuildRequires:  pkgconfig
+BuildRequires:  sqlite-devel
+BuildRequires:  glib2-devel
+BuildRequires:  libxml2-devel
+BuildRequires:  python3-devel
+BuildRoot:      %{_tmppath}/%{name}-%{version}-build
+#!BuildIgnore: post-build-checks
+
+%description
+Fast metadata parser for yum implemented in C.
+
+%prep
+%setup -q
+
+%build
+export CFLAGS="$RPM_OPT_FLAGS"
+python3 setup.py build
+
+%install
+python3 setup.py install -O1 --prefix="%{_prefix}" --root="$RPM_BUILD_ROOT"
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root,-)
+%{python3_sitearch}/*
+
+%changelog
--- yum-metadata-parser-1.1.4.orig/setup.py
+++ yum-metadata-parser-1.1.4/setup.py
@@ -2,15 +2,15 @@
 from distutils.core import setup, Extension
 
 pc = os.popen("pkg-config --cflags-only-I glib-2.0 libxml-2.0 sqlite3", "r")
-includes = map(lambda x:x[2:], string.split(pc.readline()))
+includes = [x[2:] for x in pc.readline().split()]
 pc.close()
 
 pc = os.popen("pkg-config --libs-only-l glib-2.0 libxml-2.0 sqlite3", "r")
-libs = map(lambda x:x[2:], string.split(pc.readline()))
+libs = [x[2:] for x in pc.readline().split()]
 pc.close()
 
 pc = os.popen("pkg-config --libs-only-L glib-2.0 libxml-2.0 sqlite3", "r")
-libdirs = map(lambda x:x[2:], string.split(pc.readline()))
+libdirs = [x[2:] for x in pc.readline().split()]
 pc.close()
 
 module = Extension('_sqlitecache',
@@ -27,3 +27,4 @@
        description = 'A fast YUM meta-data parser',
 	   py_modules = ['sqlitecachec'],
        ext_modules = [module])
+
--- yum-metadata-parser-1.1.4.orig/sqlitecache.c
+++ yum-metadata-parser-1.1.4/sqlitecache.c
@@ -347,8 +347,8 @@
     Py_INCREF(repoid);
    
     args = PyTuple_New (3);
-    PyTuple_SET_ITEM (args, 0, PyInt_FromLong (update_info->packages_seen));
-    PyTuple_SET_ITEM (args, 1, PyInt_FromLong (update_info->count_from_md));
+    PyTuple_SET_ITEM (args, 0, PyLong_FromLong (update_info->packages_seen));
+    PyTuple_SET_ITEM (args, 1, PyLong_FromLong (update_info->count_from_md));
     PyTuple_SET_ITEM (args, 2, repoid);
 
     result = PyEval_CallObject (progress, args);
@@ -517,8 +517,8 @@
         break;
     }
 
-    PyTuple_SET_ITEM (args, 0, PyInt_FromLong (level));
-    PyTuple_SET_ITEM (args, 1, PyString_FromString (message));
+    PyTuple_SET_ITEM (args, 0, PyLong_FromLong (level));
+    PyTuple_SET_ITEM (args, 1, PyUnicode_FromString (message));
 
     result = PyEval_CallObject (callback, args);
     Py_DECREF (args);
@@ -552,7 +552,7 @@
     g_log_remove_handler (NULL, log_id);
 
     if (db_filename) {
-        ret = PyString_FromString (db_filename);
+        ret = PyUnicode_FromString (db_filename);
         g_free (db_filename);
     } else {
         PyErr_SetString (PyExc_TypeError, err->message);
@@ -621,13 +621,29 @@
     {NULL, NULL, 0, NULL}
 };
 
-PyMODINIT_FUNC
-init_sqlitecache (void)
+static struct PyModuleDef moduledef = {
+    PyModuleDef_HEAD_INIT,
+    "_sqlitecache",            /* m_name */
+    NULL,              /* m_doc */
+    0,                 /* m_size */
+    SqliteMethods,     /* m_methods */
+    NULL,              /* m_reload */
+    NULL,
+    NULL,
+    NULL               /* m_free */
+};
+
+PyObject * PyInit__sqlitecache(void);
+PyObject * PyInit__sqlitecache(void)
 {
     PyObject * m, * d;
 
-    m = Py_InitModule ("_sqlitecache", SqliteMethods);
-
+    m = PyModule_Create (&moduledef);
+    if (m == NULL) {
+        return NULL;
+    }
     d = PyModule_GetDict(m);
-    PyDict_SetItemString(d, "DBVERSION", PyInt_FromLong(YUM_SQLITE_CACHE_DBVERSION));
+    PyDict_SetItemString(d, "DBVERSION", PyLong_FromLong(YUM_SQLITE_CACHE_DBVERSION));
+
+    return m;
 }
