--- librpm-tizen-4.14.1.1.tizen20230628.orig/Makefile.am
+++ librpm-tizen-4.14.1.1.tizen20230628/Makefile.am
@@ -209,7 +209,7 @@
 
 bin_PROGRAMS +=		rpmqpack
 rpmqpack_SOURCES =      rpmqpack.c
-rpmqpack_LDADD =        lib/librpm.la
+rpmqpack_LDADD =        lib/librpm.la @WITH_DB_LIB@
 rpmqpack_CFLAGS =       $(CFLAGS) -fPIE
 rpmqpack_LDFLAGS =      $(LDFLAGS) -pie
 
--- librpm-tizen-4.14.1.1.tizen20230628.orig/build/parsePreamble.c
+++ librpm-tizen-4.14.1.1.tizen20230628/build/parsePreamble.c
@@ -1193,16 +1193,16 @@
 			rpmlog(RPMLOG_ERR, _("Binary rpm package found. Expected spec file!\n"));
 			goto exit;
 		    }
-		    rpmlog(RPMLOG_ERR, _("line %d: Unknown tag: %s\n"),
+		    rpmlog(RPMLOG_INFO, _("line %d: Unknown tag: %s\n"),
 				spec->lineNum, spec->line);
-		    goto exit;
-		}
-		if (handlePreambleTag(spec, pkg, tag, macro, lang)) {
-		    goto exit;
-		}
-		if (spec->BANames && !spec->recursing) {
-		    res = PART_BUILDARCHITECTURES;
-		    goto exit;
+		} else {
+                    if (handlePreambleTag(spec, pkg, tag, macro, lang)) {
+                        goto exit;
+                    }
+                    if (spec->BANames && !spec->recursing) {
+                        res = PART_BUILDARCHITECTURES;
+                        goto exit;
+                    }
 		}
 	    }
 	    if ((rc =
--- librpm-tizen-4.14.1.1.tizen20230628.orig/build/parseReqs.c
+++ librpm-tizen-4.14.1.1.tizen20230628/build/parseReqs.c
@@ -49,8 +49,11 @@
      * the spec's encoding so we only check what we can: plain ascii.
      */
     if (isascii(N[0]) && !(risalnum(N[0]) || N[0] == '_' || N[0] == '/')) {
-        rasprintf(emsg, _("Dependency tokens must begin with alpha-numeric, '_' or '/'"));
-        return RPMRC_FAIL;
+        //rasprintf(emsg, _("Dependency tokens must begin with alpha-numeric, '_' or '/'"));
+	rpmlog(RPMLOG_INFO,
+                   _("line %d: Dependency tokens must begin with alpha-numeric, '_' or '/': %s\n"),
+                   spec->lineNum, spec->line);
+        //return RPMRC_FAIL;
     }
     if (EVR) {
         if (N[0] == '/') {
--- librpm-tizen-4.14.1.1.tizen20230628.orig/build/parseSpec.c
+++ librpm-tizen-4.14.1.1.tizen20230628/build/parseSpec.c
@@ -417,9 +417,9 @@
         match = parseExpressionBoolean(s);
 	if (match < 0) {
 	    rpmlog(RPMLOG_ERR,
-			_("%s:%d: bad %%if condition\n"),
+			_("%s:%d: bad %%if condition, continuing nevertheless\n"),
 			ofi->fileName, ofi->lineNum);
-	    return PART_ERROR;
+	    match = 0;
 	}
     } else if (ISMACRO(s, "%else")) {
 	if (! spec->readStack->next) {
--- librpm-tizen-4.14.1.1.tizen20230628.orig/configure.ac
+++ librpm-tizen-4.14.1.1.tizen20230628/configure.ac
@@ -529,12 +529,13 @@
 	#error Berkeley DB too old
 	#endif
       ])
-    ],[ WITH_DB_LIB=-ldb ], 
+    ],[ WITH_DB_LIB=-ldb ],
       [ AC_MSG_ERROR([Berkeley DB version >= 4.5 required])
     ])
   ],[
     AC_MSG_ERROR([missing required header db.h])
   ])
+  AC_DEFINE(WITH_EXTERNAL_DB, 1, [Use external db?])
   ;;
 no|maybe )
   # Try internal database first, then fall back to external
@@ -802,7 +803,7 @@
 
 WITH_PYTHON_SUBPACKAGE=0
 AS_IF([test "$enable_python" = yes],[
-  AM_PATH_PYTHON([2.6],[
+  AM_PATH_PYTHON([3.2],[
     PKG_CHECK_MODULES([PYTHON], [python-${PYTHON_VERSION}], [WITH_PYTHON_SUBPACKAGE=1])
     AC_SUBST(PYTHON_CFLAGS)
     AC_SUBST(PYTHON_LIB)
@@ -1023,9 +1024,12 @@
             [],
             [with_lua=yes])
 
+if test X"$LUA_PKGCONFIG_NAME" = X ; then
+    LUA_PKGCONFIG_NAME=lua
+fi
 AS_IF([test "$with_lua" != no],[
   PKG_CHECK_MODULES([LUA],
-    [lua >= 5.1],
+    [${LUA_PKGCONFIG_NAME} >= 5.1],
     [AC_DEFINE(WITH_LUA, 1, [Build with lua support?])],
     [AC_MSG_ERROR([lua not present (--without-lua to disable)])])
   AC_SUBST(LUA_CFLAGS)
@@ -1151,8 +1155,7 @@
             [AS_HELP_STRING([--with-rpmconfigdir],
               [Set up rpm config not into /usr/lib/rpm @<:@default=check@:>@])],
             [RPMCONFIGDIR=$withval],
-            [RPMCONFIGDIR="`echo ${usrprefix}/lib/rpm`"])
-
+            [RPMCONFIGDIR="`echo ${libdir}/rpm`"])
 AC_SUBST(RPMCONFIGDIR)
 
 AC_SUBST(OBJDUMP)
@@ -1165,6 +1168,13 @@
 AM_CONDITIONAL([DOXYGEN],[test "$DOXYGEN" != no])
 AM_CONDITIONAL([HACKINGDOCS],[test "$with_hackingdocs" = yes])
 
+AC_ARG_VAR([PYTHON_MODULENAME], [Name of the rpm python module. Defaults to 'rpm'])
+if test X"$PYTHON_MODULENAME" = X ; then
+    PYTHON_MODULENAME="$PACKAGE"
+fi
+AC_DEFINE_UNQUOTED(PYTHON_MODULENAME, ["$PYTHON_MODULENAME"],[python module name])
+AC_SUBST(PYTHON_MODULENAME)
+
 AC_PATH_PROG(AUTOM4TE,autom4te,:)
 
 AC_SUBST([dirstamp],[\${am__leading_dot}dirstamp])
@@ -1172,9 +1182,11 @@
 AC_CONFIG_FILES([Makefile
 	rpmio/Makefile lib/Makefile build/Makefile sign/Makefile
 	po/Makefile.in scripts/Makefile fileattrs/Makefile
-	misc/Makefile 
+	misc/Makefile
 	doc/Makefile
 	python/Makefile
+	python/rpm/__init__.py
+	python/rpm/transaction.py
  	luaext/Makefile
  	tests/Makefile
  	plugins/Makefile
--- librpm-tizen-4.14.1.1.tizen20230628.orig/debian/changelog
+++ librpm-tizen-4.14.1.1.tizen20230628/debian/changelog
@@ -0,0 +1,65 @@
+librpm-tizen (4.14.1.1.tizen20230628-20230828) unstable; urgency=low
+
+  * Rebase on latest Tizen
+
+ -- Xu Huayong <huayong.xu@samsung.com>  Tue, 05 Sep 2023 14:21:46 +0300
+
+librpm-tizen (4.11.0.1.tizen20140530-tizen20140723) unstable; urgency=low
+
+  * Rebase on latest Tizen 3.0
+
+ -- Markus Lehtonen <markus.lehtonen@linux.intel.com>  Wed, 23 Jul 2014 19:50:46 +0300
+
+librpm-tizen (4.11.0.1.tizen20130618-tizen20140306) unstable; urgency=low
+
+  [ Markus Lehtonen ]
+  * Fix build against Lua 5.2
+
+ -- Markus Lehtonen <markus.lehtonen@linux.intel.com>  Thu, 06 Mar 2014 12:43:43 +0200
+
+librpm-tizen (4.11.0.1.tizen20130618-tizen20131001) unstable; urgency=low
+
+  * Ignore bad expressions in %if conditionals
+  * lua: Enable Lua
+  * lua: fall through failed lua scripts
+
+ -- Markus Lehtonen <markus.lehtonen@linux.intel.com>  Tue, 01 Oct 2013 12:12:43 +0300
+
+librpm-tizen (4.11.0.1.tizen20130618-tizen20130821) unstable; urgency=low
+
+  [ Zhang Qiang ]
+  * fix segmentation fault error while parsing spec
+
+  [ Markus Lehtonen ]
+  * Prevent execution of arbitrary scripts
+  * Bump the log level of "unexpanded script" msg
+
+ -- Markus Lehtonen <markus.lehtonen@linux.intel.com>  Wed, 21 Aug 2013 14:31:24 +0300
+
+librpm-tizen (4.11.0.1.tizen20130618-tizen20130619) unstable; urgency=low
+
+  * Version bump to latest from Tizen 3.0
+
+ -- Markus Lehtonen <markus.lehtonen@linux.intel.com>  Tue, 18 Jun 2013 14:07:13 +0300
+
+librpm-tizen (4.11.0.1.tizen20130304-tizen20130307) unstable; urgency=low
+
+  * Version bump to latest from Tizen
+
+ -- Markus Lehtonen <markus.lehtonen@linux.intel.com>  Thu, 07 Mar 2013 09:27:00 +0200
+
+librpm-tizen (4.10.91.tizen20121215-tizen20130226) unstable; urgency=low
+
+  * Enable lua
+  * Add a provide tag to make gbs depend on new changes
+  * Install Tizen macros
+  * Ignore unknown internal scripts
+
+ -- Markus Lehtonen <markus.lehtonen@linux.intel.com>  Wed, 27 Feb 2013 10:12:00 +0200
+
+librpm-tizen (4.10.91.tizen20121215-tizen20130226) unstable; urgency=low
+
+  * Initial packaging
+
+ -- Markus Lehtonen <markus.lehtonen@linux.intel.com>  Tue, 17 Dec 2012 13:22:00 +0200
+
--- librpm-tizen-4.14.1.1.tizen20230628.orig/debian/compat
+++ librpm-tizen-4.14.1.1.tizen20230628/debian/compat
@@ -0,0 +1 @@
+7
--- librpm-tizen-4.14.1.1.tizen20230628.orig/debian/control
+++ librpm-tizen-4.14.1.1.tizen20230628/debian/control
@@ -0,0 +1,50 @@
+Source: librpm-tizen
+Section: vcs
+Priority: optional
+Build-Depends: debhelper,
+               dh-python,
+               dpkg-dev,
+               dh-autoreconf,
+               libtool,
+               autoconf,
+               automake,
+               autotools-dev,
+               autopoint,
+               zlib1g-dev,
+               libarchive-dev,
+               libpopt-dev,
+               libxml2-dev,
+               libreadline-dev,
+               libsqlite3-dev,
+               python3-all-dev,
+               python3,
+               pkg-config,
+               libnspr4-dev,
+               libnss3-dev,
+               liblzma-dev,
+               libmagic-dev,
+               libelf-dev,
+               libdw-dev,
+               libdb-dev,
+               liblua5.1-dev
+Maintainer: Markus Lehtonen <markus.lehtonen@linux.intel.com>
+Standards-Version: 3.9.3
+Homepage: http://rpm.org/
+X-Python-Version: >= 3
+
+Package: librpm-tizen
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${python3:Depends}
+Description:  The RPM libraries for git-buildpackage
+ RPM Package Manager is the main tool for managing the software packages
+ of Tizen.
+ .
+ RPM can be used to install and remove software packages. With rpm, it
+ is easy to update packages.  RPM keeps track of all these manipulations
+ in a central database.»·This way it is possible to get an overview of
+ all installed packages.  RPM also supports database queries.
+ .
+ This is a special stripped-down version of RPM, only intended to be used by the
+ git-buildpackage tool. Doesn't interfere with the RPM libraries of the host system.
+ This package only contains rpmlib and rpm-python.
+
--- librpm-tizen-4.14.1.1.tizen20230628.orig/debian/librpm-tizen.install
+++ librpm-tizen-4.14.1.1.tizen20230628/debian/librpm-tizen.install
@@ -0,0 +1,4 @@
+usr/lib*/*/*.so.*
+usr/lib*/*/rpm/*
+usr/lib/python*/*packages/*/*.so
+usr/lib/python*/*packages/*/*.py*
--- librpm-tizen-4.14.1.1.tizen20230628.orig/debian/rules
+++ librpm-tizen-4.14.1.1.tizen20230628/debian/rules
@@ -0,0 +1,29 @@
+#!/usr/bin/make -f
+
+python_mod_name := rpm_tizen
+
+CPPFLAGS += $(shell pkg-config --cflags nss)
+
+%:
+	dh $@ --with python3,autoreconf,autotools_dev
+
+override_dh_auto_configure:
+	dh_auto_configure -- --disable-dependency-tracking \
+			--libdir=/usr/lib/librpm-tizen \
+			--with-lua \
+			--without-acl \
+			--without-cap \
+			--enable-shared \
+			--enable-python \
+			--with-external-db \
+			--build=${DEB_BUILD_GNU_CPU}-tizen-linux \
+			PYTHON_MODULENAME=$(python_mod_name) \
+			LUA_PKGCONFIG_NAME=lua5.1 \
+			CPPFLAGS="$(CPPFLAGS)"
+
+override_dh_auto_install:
+	dh_auto_install --destdir=debian/tmp
+	# Install extra sources
+	install -m644 packaging/rpm-tizen_macros debian/tmp/usr/lib/librpm-tizen/rpm/tizen_macros
+	install -d debian/tmp/usr/lib/librpm-tizen/rpm/tizen
+	ln -s ../tizen_macros debian/tmp/usr/lib/librpm-tizen/rpm/tizen/macros
--- librpm-tizen-4.14.1.1.tizen20230628.orig/lib/backend/dbconfig.c
+++ librpm-tizen-4.14.1.1.tizen20230628/lib/backend/dbconfig.c
@@ -71,8 +71,10 @@
 	NULL, NULL },
  { "lockdbfd",	0,POPT_ARG_NONE,	&staticdbi.dbi_lockdbfd, 0,
 	NULL, NULL },
+ #ifndef WITH_EXTERNAL_DB
  { "nofsync",	0,POPT_BIT_SET,		&staticdbi.dbi_oflags, DB_NOFSYNC,
 	NULL, NULL },
+#endif
 
     POPT_TABLEEND
 };
--- librpm-tizen-4.14.1.1.tizen20230628.orig/packaging/db-4.8.30-integration.dif
+++ librpm-tizen-4.14.1.1.tizen20230628/packaging/db-4.8.30-integration.dif
@@ -0,0 +1,82 @@
+--- db/db/db.c.orig	2010-04-12 20:25:22.000000000 +0000
++++ db/db/db.c	2011-05-12 11:38:59.000000000 +0000
+@@ -646,6 +646,8 @@ __env_mpool(dbp, fname, flags)
+ 			MAKE_INMEM(dbp);
+ 		return (ret);
+ 	}
++	if (LF_ISSET(DB_NOFSYNC) && mpf->mfp)
++	    F_SET(mpf->mfp, MP_NOFSYNC);
+ 
+ 	/*
+ 	 * Set the open flag.  We use it to mean that the dbp has gone
+--- db/db/db_iface.c.orig	2010-04-12 20:25:22.000000000 +0000
++++ db/db/db_iface.c	2011-05-12 11:21:32.000000000 +0000
+@@ -1230,6 +1230,7 @@ __db_open_arg(dbp, txn, fname, dname, ty
+ #define	OKFLAGS								\
+ 	(DB_AUTO_COMMIT | DB_CREATE | DB_EXCL | DB_FCNTL_LOCKING |	\
+ 	DB_MULTIVERSION | DB_NOMMAP | DB_NO_AUTO_COMMIT | DB_RDONLY |	\
++	DB_NOFSYNC |							\
+ 	DB_RDWRMASTER | DB_READ_UNCOMMITTED | DB_THREAD | DB_TRUNCATE)
+ 	if ((ret = __db_fchk(env, "DB->open", flags, OKFLAGS)) != 0)
+ 		return (ret);
+--- db/dbinc/mp.h.orig	2010-04-12 20:25:22.000000000 +0000
++++ db/dbinc/mp.h	2011-05-12 12:01:32.000000000 +0000
+@@ -467,6 +467,7 @@ struct __mpoolfile {
+ #define	MP_FAKE_UOC		0x080	/* Unlink_on_close field: fake flag. */
+ #define	MP_NOT_DURABLE		0x100	/* File is not durable. */
+ #define	MP_TEMP			0x200	/* Backing file is a temporary. */
++#define	MP_NOFSYNC		0x400	/* Don't fsync */
+ 	u_int32_t  flags;
+ };
+ 
+--- db/dbinc_auto/api_flags.in.orig	2011-05-12 11:40:57.000000000 +0000
++++ db/dbinc_auto/api_flags.in	2011-05-12 11:55:10.000000000 +0000
+@@ -83,6 +83,7 @@
+ #define	DB_NOORDERCHK				0x00000002
+ #define	DB_NOPANIC				0x00000800
+ #define	DB_NO_AUTO_COMMIT			0x00001000
++#define	DB_NOFSYNC				0x00040000
+ #define	DB_ODDFILESIZE				0x00000080
+ #define	DB_ORDERCHKONLY				0x00000004
+ #define	DB_OVERWRITE				0x00001000
+--- db/dist/s_config.orig	2010-04-12 20:25:23.000000000 +0000
++++ db/dist/s_config	2011-05-12 12:00:34.000000000 +0000
+@@ -8,7 +8,8 @@ trap 'rm -f aclocal.m4 ; exit 0' 0 1 2 3
+ . ./RELEASE
+ 
+ echo "autoconf: building aclocal.m4..."
+-cat aclocal/*.m4 aclocal_java/*.m4 > aclocal.m4
++cat aclocal/*.m4 aclocal_java/*.m4 > acinclude.m4
++aclocal
+ 
+ echo "autoconf: running autoheader to build config.hin..."
+ rm -f config.hin
+--- db/mp/mp_sync.c.orig	2010-04-12 20:25:34.000000000 +0000
++++ db/mp/mp_sync.c	2011-05-12 11:36:58.000000000 +0000
+@@ -578,7 +578,7 @@ done:	/*
+ 	if (ret == 0 && required_write) {
+ 		if (dbmfp == NULL)
+ 			ret = __memp_sync_files(env);
+-		else
++		else if (!F_ISSET(dbmfp->mfp, MP_NOFSYNC))
+ 			ret = __os_fsync(env, dbmfp->fhp);
+ 	}
+ 
+@@ -665,7 +665,7 @@ __memp_sync_file(env, mfp, argp, countp,
+ 			    "%s: unable to flush", (char *)
+ 			    R_ADDR(dbmp->reginfo, mfp->path_off));
+ 		}
+-	} else
++	} else if (!F_ISSET(dbmfp->mfp, MP_NOFSYNC))
+ 		ret = __os_fsync(env, dbmfp->fhp);
+ 
+ 	/*
+@@ -801,6 +801,8 @@ __memp_mf_sync(dbmp, mfp, locked)
+ 	COMPQUIET(hp, NULL);
+ 	env = dbmp->env;
+ 
++	if (F_ISSET(mfp, MP_NOFSYNC))
++	    return 0;
+ 	/*
+ 	 * We need to be holding the hash lock: we're using the path name
+ 	 * and __memp_nameop might try and rename the file.
--- librpm-tizen-4.14.1.1.tizen20230628.orig/packaging/device-sec-policy
+++ librpm-tizen-4.14.1.1.tizen20230628/packaging/device-sec-policy
@@ -0,0 +1,46 @@
+<config>
+  <sw_source name="root" rankkey="/10020/10000.root">
+    <origin>
+      <keyinfo>

+tRrR5cbqmVr8tkFjS/QK6TWfNMM=
+</keyinfo>
+    </origin>
+    <package name="unknown-sw-source"/>
+    <package name="ac-domain-system">
+      <provide>
+        <ac_domain name="_" policy="shared"/>
+        <ac_domain name="Isolated"/>
+      </provide>
+    </package>
+    <package name="root"/>
+    <sw_source name="_default_" rankkey="/10020/11000/10000._default_">
+      <allow>
+        <ac_domain match="*"/>
+      </allow>
+    </sw_source>
+  </sw_source>
+</config>
--- librpm-tizen-4.14.1.1.tizen20230628.orig/packaging/find-docs.sh
+++ librpm-tizen-4.14.1.1.tizen20230628/packaging/find-docs.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+usage () {
+cat << EOF
+Usage: $0 TOP_DIR
+
+EOF
+exit 1
+}
+
+if [ -z "$1" ] ; then usage
+elif [ $1 = / ] ; then echo $0: expects non-/ argument for '$1' 1>&2
+elif [ ! -d $1 ] ; then
+ echo $0: $1: no such directory
+ exit 1
+else TOP_DIR="`echo $1|sed -e 's:/$::'`"
+fi
+shift
+
+DOC_NAME=documentation.list
+touch $DOC_NAME
+
+find $TOP_DIR -type f -o -type l | sed '
+s:'"$TOP_DIR"'::
+s:\(.*/man/man./.*\.[0-9]\):%doc \1:
+s:\(.*/man/*/man./.*\.[0-9]\):%doc \1:
+s:\(.*/gtk-doc/html/.*\):%doc \1:
+s:\(.*/info/.*\info.*\):%doc \1:
+s:^\([^%].*\)::
+/^$/d' >> $DOC_NAME
+
+
+exit 0
--- librpm-tizen-4.14.1.1.tizen20230628.orig/packaging/find-provides.ksyms
+++ librpm-tizen-4.14.1.1.tizen20230628/packaging/find-provides.ksyms
@@ -0,0 +1,41 @@
+#! /bin/sh
+
+IFS=$'\n'
+
+case "$1" in
+kernel-module-*)    ;; # Fedora kernel module package names start with
+		       # kernel-module.
+kernel*)	    kernel_flavor=${1#kernel-} ;;
+esac
+
+trap 'rm -f "$tmp"' EXIT
+tmp=$(mktemp)
+while read f; do
+    test -e "$f" || continue
+    case "$f" in
+    *.debug)
+        continue
+        ;;
+    */lib/modules/*/*.ko | */lib/modules/*/*.ko.gz | */boot/vmlinu[xz]*)
+        ;;
+    *)
+        continue
+    esac
+    unzip=false
+    case "$f" in
+    *.gz | */boot/vmlinuz*)
+        unzip=true
+    esac
+    if $unzip && gzip -cd "$f" >"$tmp"; then
+        f=$tmp
+    fi
+    flavor=$(/usr/sbin/modinfo -F vermagic "$f")
+    flavor=${flavor%% *}
+    flavor=${flavor##*-}
+    if test -z "$flavor"; then
+        flavor=$kernel_flavor
+    fi
+    nm "$f" \
+    | sed -r -ne "s/^0*([0-9a-f]+) A __crc_(.+)/ksym($flavor:\\2) = \\1/p"
+done \
+| sort -u
--- librpm-tizen-4.14.1.1.tizen20230628.orig/packaging/librpm-tizen.changes
+++ librpm-tizen-4.14.1.1.tizen20230628/packaging/librpm-tizen.changes
@@ -0,0 +1,42 @@
+* Wed Jul 23 2014 Markus Lehtonen <markus.lehtonen@linux.intel.com> tizen-tools/4.11.0.1.tizen20140530-20140723
+- Rebase on latest Tizen 3.0
+- packaging: enable lua 5.2 for openSUSE
+- rpm-packaging: enable customized autoreq
+
+* Thu Mar 06 2014 Markus Lehtonen <markus.lehtonen@linux.intel.com> tizen-tools/4.11.0.1.tizen20130618-20140306
+- Fix build against Lua 5.2
+
+* Tue Oct 01 2013 Markus Lehtonen <markus.lehtonen@linux.intel.com> 4.11.0.1.tizen20130618
+- lua: fall through failed lua scripts
+- lua: Enable Lua
+- Ignore bad expressions in %if conditionals
+
+* Wed Aug 21 2013 Markus Lehtonen <markus.lehtonen@linux.intel.com> 4.11.0.1.tizen20130618
+- fix segmentation fault error while parsing spec
+- Bump the log level of "unexpanded script" msg
+- Prevent execution of arbitrary scripts
+
+* Tue Jun 18 2013 Markus Lehtonen <markus.lehtonen@linux.intel.com> 4.11.0.1.tizen20130618
+- Version bump to latest from Tizen 3.0
+
+* Thu Mar 07 2013 Markus Lehtonen <markus.lehtonen@linux.intel.com> 4.11.0.1.tizen20130304
+- Version bump to latest from Tizen
+
+* Wed Feb 27 2013 Markus Lehtonen <markus.lehtonen@linux.intel.com> 4.10.91.tizen20121215
+- Enable lua
+- update package Provide info
+- Add a provide tag to make gbs depend on new changes
+- packaging: fix Makefile
+- Install Tizen macros
+
+* Mon Feb 25 2013 Markus Lehtonen <markus.lehtonen@linux.intel.com> 4.10.91.tizen20121215
+- packaging: Disable autoreq, too
+- Ignore unknown internal scripts
+
+* Thu Feb 22 2013 Qiang Zhang <qiang.z.zhang@intel.com> 4.10.91.tizen20121215
+- packaging: fix build for CentOS
+
+* Thu Feb 21 2013 Markus Lehtonen <markus.lehtonen@linux.intel.com> 4.10.91.tizen20121215
+- packaging: Drop bdb sources
+- packaging: fix build for Fedora (18)
+- packaging: disable autoprov
--- librpm-tizen-4.14.1.1.tizen20230628.orig/packaging/librpm-tizen.spec
+++ librpm-tizen-4.14.1.1.tizen20230628/packaging/librpm-tizen.spec
@@ -0,0 +1,173 @@
+# Use custom autoreq script for filtering out all librpm* stuff
+# (basically everything that the package would auto-provide) in order to make
+# the package installable
+%define _use_internal_dependency_generator 0
+%define __find_requires bash -c "/usr/lib/rpm/find-requires | grep -v librpm"
+
+%define rpmlibdir %{_prefix}/lib
+%define rpmhome %{rpmlibdir}/rpm
+
+Name:           librpm-tizen
+Summary:        The RPM libraries for git-buildpackage
+License:        GPL-2.0+
+Group:          Development/Tools/Building
+Version:        4.14.1.1.tizen20230628
+Release:        0
+Url:            http://www.rpm.org
+BuildRequires:  binutils
+BuildRequires:  bzip2
+BuildRequires:  file-devel
+BuildRequires:  findutils
+BuildRequires:  gcc
+BuildRequires:  glibc-devel
+BuildRequires:  gzip
+BuildRequires:  libacl-devel
+BuildRequires:  pkgconfig(libcap)
+BuildRequires:  libelf-devel
+BuildRequires:  libtool
+%if 0%{?suse_version}
+BuildRequires:  pkgconfig(lua)
+%else
+BuildRequires:  lua-devel
+%endif
+BuildRequires:  make
+BuildRequires:  pkgconfig(ncurses)
+BuildRequires:  patch
+%if 0%{?fedora} || 0%{?centos_ver} || 0%{?centos_version}
+BuildRequires:  popt-devel
+%else
+BuildRequires:  pkgconfig(popt)
+%endif
+BuildRequires:  pkgconfig(zlib)
+BuildRequires:  pkgconfig(nss)
+BuildRequires:  pkg-config
+%if 0%{?centos_ver} || 0%{?centos_version}
+BuildRequires:  python-devel
+%else
+BuildRequires:  pkgconfig(python3)
+%endif
+# Disable security
+%if 0
+BuildRequires:  uthash-devel
+BuildRequires:  pkgconfig(libxml-2.0)
+BuildRequires:  pkgconfig(libsmack)
+%endif
+BuildRequires:  libarchive-devel
+%if 0%{?suse_version}
+BuildRequires:  fdupes
+%endif
+%if 0%{?fedora} || 0%{?centos_ver} >= 7
+BuildRequires:  libdb-devel
+%else
+BuildRequires:  db-devel
+%endif
+BuildRequires:  pkgconfig(libzstd)
+
+Source4:       rpm-tizen_macros
+Source8:       rpmconfigcheck
+Source13:      find-docs.sh
+Source22:      device-sec-policy
+Source23:      find-provides.ksyms
+Source1001:    rpm.manifest
+Source0:       rpm-%{version}.tar.gz
+AutoProv:      No
+
+Provides:      rpm-tizen = %{version}-tizen20230628
+#
+# avoid bootstrapping problem
+%define _binary_payload w9.bzdio
+#
+# Python module name
+%define python_mod_name rpm_tizen
+
+%description
+RPM Package Manager is the main tool for managing the software packages
+of Tizen.
+
+RPM can be used to install and remove software packages. With rpm, it
+is easy to update packages.  RPM keeps track of all these manipulations
+in a central database.	This way it is possible to get an overview of
+all installed packages.  RPM also supports database queries.
+
+This is a special stripped-down version of RPM, only intended to be used by the
+git-buildpackage tool. This package doesn't interfere with the RPM libraries of
+the host system and it only contains rpmlib and rpm-python.
+
+%prep
+%setup -q -n rpm-%{version}
+cp %{SOURCE1001} .
+rm -rf sqlite
+if [ -s %{_sysconfdir}/rpm/tizen_macros ]; then
+    cp -a %{_sysconfdir}/rpm/tizen_macros %{SOURCE4}
+fi
+cp -a %{SOURCE4} tizen_macros
+rm -f m4/libtool.m4
+rm -f m4/lt*.m4
+
+%build
+CPPFLAGS="$CPPFLAGS `pkg-config --cflags nss`"
+export CPPFLAGS
+export CFLAGS="%{optflags} -ffunction-sections -fstack-protector-strong -Wl,-z,relro -D_FORTIFY_SOURCE=2 -fPIE"
+export LDFLAGS="${LDFLAGS} -pie -Wl,-Bsymbolic-functions -ffunction-sections"
+%ifarch armv5tel
+export CFLAGS="-g -O0 -fno-strict-aliasing -ffunction-sections"
+%endif
+
+%{?hwasan_build:
+export CPPFLAGS="$CPPFLAGS -DHWASAN_BUILD"
+}
+
+autoreconf -i -f
+
+%configure \
+    --libdir=%{_libdir}/%{name} \
+    --disable-dependency-tracking \
+    --with-lua \
+    --with-acl \
+    --with-cap \
+    --enable-shared \
+    --enable-python \
+    --with-vendor=tizen \
+    --without-msm \
+    --enable-zstd \
+    --with-external-db \
+    PYTHON_MODULENAME=%{python_mod_name}
+
+make %{?_smp_mflags}
+
+%install
+# Install into a temporary location
+make install DESTDIR="`pwd`/tmp_install"
+
+# And only copy the files that we want
+install -d %{buildroot}%{_libdir}/%{name}
+install -d %{buildroot}%{python3_sitearch}
+cp -ax tmp_install/%{_libdir}/%{name}  %{buildroot}%{_libdir}/
+cp -ax tmp_install/%{python3_sitearch}/%{python_mod_name} %{buildroot}%{python3_sitearch}/
+
+# Install extra sources
+install -m644 %{SOURCE4} %{buildroot}%{_libdir}/%{name}/rpm/tizen_macros
+install -d %{buildroot}%{_libdir}/%{name}/rpm/tizen
+ln -s ../tizen_macros %{buildroot}%{_libdir}/%{name}/rpm/tizen/macros
+
+# Delete unwanted development files etc.
+find %{buildroot} -name "*.la" | xargs rm -f --
+find %{buildroot}/%{_libdir}/%{name} -name "*.so" | xargs rm -f --
+rm -rf "%{buildroot}%{_libdir}/%{name}/pkgconfig"
+rm -rf "%{buildroot}%{_libdir}/%{name}/rpm-plugins"
+
+# Compile python modules (Fedora does this automatically) and find duplicates
+%if 0%{?suse_version}
+%py3_compile %{buildroot}/%{python3_sitearch}/%{python_mod_name}/
+%py3_compile -O %{buildroot}/%{python3_sitearch}/%{python_mod_name}/
+
+%fdupes %{buildroot}/%{python3_sitearch}/
+%endif
+
+%files
+%defattr(-,root,root,-)
+%dir %{_libdir}/%{name}
+%dir %{python3_sitearch}/%{python_mod_name}/
+%{_libdir}/%{name}/*.so.*
+%{_libdir}/%{name}/rpm
+%{python3_sitearch}/%{python_mod_name}/*
--- librpm-tizen-4.14.1.1.tizen20230628.orig/packaging/rpm-tizen_macros
+++ librpm-tizen-4.14.1.1.tizen20230628/packaging/rpm-tizen_macros
@@ -0,0 +1,305 @@
+# directories
+%_infodir               %{_prefix}/share/info
+%_mandir                %{_prefix}/share/man
+%_sysconfdir            /etc
+%_localstatedir         /var
+%_defaultdocdir         %{_usr}/share/doc/packages
+%_unitdir_user /usr/lib/systemd/user
+%_unitdir /usr/lib/systemd/system
+
+# package build macros
+# %make_install           make install DESTDIR=%{?buildroot}
+# %makeinstall            make DESTDIR=%{?buildroot:%{buildroot}} install
+%rb_arch                %(echo %{_host_cpu}-linux | sed -e "s/i686/i586/" -e "s/armv5tel/armv4l/" -e "s/hppa2.0/hppa/")
+%rb_ver                 %(/usr/bin/ruby -e 'puts VERSION.sub(/\\\.\\\d$/, "")')
+
+# external kernel module helper macro(s)
+%kernel_devel_uname_r %(/bin/rpm -q --provides $(/bin/rpm -q --whatprovides kernel-devel-uname-r) | sed -ne 's,kernel-devel-uname-r = ,, p')
+%kernel_release %(/bin/rpm -q --queryformat '%{RPMTAG_VERSION}-%{RPMTAG_RELEASE}' $(/bin/rpm -q --whatprovides kernel))
+%kernel_name    %(/bin/rpm -q --queryformat '%{RPMTAG_NAME}' $(/bin/rpm -q --whatprovides kernel))
+
+# this script calls all scripts in /usr/lib/rpm/brp-tizen.d
+%__os_install_post  \
+	/usr/lib/rpm/brp-compress \
+	/usr/lib/rpm/brp-tizen  \
+	%{!?disable_docs_package:/usr/lib/rpm/tizen/find-docs.sh %{buildroot}} \
+%{nil}
+
+# macro: %configure_kernel_source
+#
+#
+%configure_kernel_source() \
+	if test -d /usr/src/linux ; then \
+	    pushd /usr/src/linux \
+	    test -f .config || cp arch/%_arch/defconfig.default .config \
+	    yes "" | make oldconfig \
+	    make dep \
+	    popd \
+	fi \
+	%nil
+
+%install_info(:-:) \
+    ALL_ARGS=(%{**}) \
+    NUM_ARGS=${#ALL_ARGS[@]} \
+    if test -x /sbin/install-info ; then \
+	if test -e "${ALL_ARGS[$((NUM_ARGS-1))]}" ; then \
+	    /sbin/install-info "${ALL_ARGS[@]}" \
+	fi \
+    fi ; 
+
+%install_info_delete(:-:) \
+    ALL_ARGS=(%{**}) \
+    NUM_ARGS=${#ALL_ARGS[@]} \
+    if test -x /sbin/install-info ; then \
+	if ! test -e "${ALL_ARGS[$((NUM_ARGS-1))]}" ; then \
+	    /sbin/install-info --quiet --delete "${ALL_ARGS[@]}" \
+	fi ; \
+    fi ; 
+
+# find-supplements.ksyms parses this macro directly out of the spec file:
+%supplements_kernel_module() \
+    %{expand:%(if ! rpm -q kernel-syms > /dev/null; then echo "%fail Please add the kernel-syms package to BuildRequires"; fi)}
+
+%do_profiling 1
+%cflags_profile_generate -fprofile-generate
+%cflags_profile_feedback -fprofile-use
+
+
+
+# Tizen
+#
+%configure \
+  CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
+  CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
+  FFLAGS="${FFLAGS:-%optflags -I%_fmoddir}" ; export FFLAGS ; \
+  ./configure --build=%{_build} --host=%{_host} \\\
+        --program-prefix=%{?_program_prefix} \\\
+        --prefix=%{_prefix} \\\
+        --exec-prefix=%{_exec_prefix} \\\
+        --bindir=%{_bindir} \\\
+        --sbindir=%{_sbindir} \\\
+        --sysconfdir=%{_sysconfdir} \\\
+        --datadir=%{_datadir} \\\
+        --includedir=%{_includedir} \\\
+        --libdir=%{_libdir} \\\
+        --libexecdir=%{_libexecdir} \\\
+        --localstatedir=%{_localstatedir} \\\
+        --sharedstatedir=%{_sharedstatedir} \\\
+        --mandir=%{_mandir} \\\
+        --infodir=%{_infodir}
+
+
+%reconfigure \
+  CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
+  CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
+  FFLAGS="${FFLAGS:-%optflags -I%_fmoddir}" ; export FFLAGS ; \
+  autoreconf -v --install --force || exit 1 \
+  ./configure --build=%{_build} --host=%{_host} \\\
+        --program-prefix=%{?_program_prefix} \\\
+        --prefix=%{_prefix} \\\
+        --exec-prefix=%{_exec_prefix} \\\
+        --bindir=%{_bindir} \\\
+        --sbindir=%{_sbindir} \\\
+        --sysconfdir=%{_sysconfdir} \\\
+        --datadir=%{_datadir} \\\
+        --includedir=%{_includedir} \\\
+        --libdir=%{_libdir} \\\
+        --libexecdir=%{_libexecdir} \\\
+        --localstatedir=%{_localstatedir} \\\
+        --sharedstatedir=%{_sharedstatedir} \\\
+        --mandir=%{_mandir} \\\
+        --infodir=%{_infodir}
+
+%autogen \
+  CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
+  CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
+  FFLAGS="${FFLAGS:-%optflags -I%_fmoddir}" ; export FFLAGS ; \
+  ./autogen.sh --build=%{_build} --host=%{_host} \\\
+        --program-prefix=%{?_program_prefix} \\\
+        --prefix=%{_prefix} \\\
+        --exec-prefix=%{_exec_prefix} \\\
+        --bindir=%{_bindir} \\\
+        --sbindir=%{_sbindir} \\\
+        --sysconfdir=%{_sysconfdir} \\\
+        --datadir=%{_datadir} \\\
+        --includedir=%{_includedir} \\\
+        --libdir=%{_libdir} \\\
+        --libexecdir=%{_libexecdir} \\\
+        --localstatedir=%{_localstatedir} \\\
+        --sharedstatedir=%{_sharedstatedir} \\\
+        --mandir=%{_mandir} \\\
+        --infodir=%{_infodir}
+
+
+%makeinstall \
+  %{__make} \\\
+        prefix=%{?buildroot:%{buildroot}}%{_prefix} \\\
+        exec_prefix=%{?buildroot:%{buildroot}}%{_exec_prefix} \\\
+        bindir=%{?buildroot:%{buildroot}}%{_bindir} \\\
+        sbindir=%{?buildroot:%{buildroot}}%{_sbindir} \\\
+        sysconfdir=%{?buildroot:%{buildroot}}%{_sysconfdir} \\\
+        datadir=%{?buildroot:%{buildroot}}%{_datadir} \\\
+        includedir=%{?buildroot:%{buildroot}}%{_includedir} \\\
+        libdir=%{?buildroot:%{buildroot}}%{_libdir} \\\
+        libexecdir=%{?buildroot:%{buildroot}}%{_libexecdir} \\\
+        localstatedir=%{?buildroot:%{buildroot}}%{_localstatedir} \\\
+        sharedstatedir=%{?buildroot:%{buildroot}}%{_sharedstatedir} \\\
+        mandir=%{?buildroot:%{buildroot}}%{_mandir} \\\
+        infodir=%{?buildroot:%{buildroot}}%{_infodir} \\\
+  install
+
+
+%make_install \
+  %{__make} \\\
+        DESTDIR=%{?buildroot:%{buildroot}} \\\
+        INSTALL_ROOT=%{?buildroot:%{buildroot}} \\\
+  install  \
+  rm -f %{?buildroot:%{buildroot}}%{_infodir}/dir \
+  find %{?buildroot:%{buildroot}} -regex ".*\\.la$" | xargs rm -f -- \
+  %{!?keepstatic:find %{?buildroot:%{buildroot}} -regex ".*\\.a$" | xargs rm -f --}
+
+%_smp_mflags %([ -z "$RPM_BUILD_NCPUS" ] \\\
+        && RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\
+        [ "$RPM_BUILD_NCPUS" -gt 1 ] && echo "-j$RPM_BUILD_NCPUS")
+
+%lang_package(n:f:) \
+%package %{-n:-n %{-n*}-}locale \
+Summary: Translations and Locale for package %{name}\
+Group: System/Localization\
+Requires: %{-n:%{-n*}}%{!-n:%{name}} = %{version} \
+Provides: %{-n:%{-n*}}%{!-n:%{name}}-lang-all = %{version} \
+BuildArch:  noarch \
+%description %{-n:-n %{-n*}-}locale\
+This package provides translations for package %{name}.\
+%files %{-n:-n %{-n*}-}locale -f %{-f:%{-f*}.lang} %{!-f:%{name}.lang}\
+%defattr(-,root,root,-)\
+%{nil}
+
+%docs_package \
+%package docs \
+Summary: Documentation for package %{name}\
+Group: Documentation\
+AutoReqProv: 0\
+%description docs\
+This package provides documentation for package %{name}.\
+%files docs -f documentation.list\
+%defattr(-,root,root,-)\
+%{nil}
+
+# Bad hack to set $LANG to C during all RPM builds
+%prep \
+%%prep\
+LANG=C\
+export LANG\
+unset DISPLAY\
+%{nil}
+
+%build %%build\
+LANG=C\
+export LANG\
+unset DISPLAY\
+CFLAGS="%optflags" ; export CFLAGS ; \
+CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \
+FFLAGS="${FFLAGS:-%optflags -I%_fmoddir}" ; export FFLAGS ; \
+LD_AS_NEEDED=1; export LD_AS_NEEDED ; \
+%{nil}
+
+%install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package}}}\
+%%install\
+LANG=C\
+export LANG\
+unset DISPLAY\
+rm -rf %{?buildroot:%{buildroot}} \
+mkdir -p %{?buildroot:%{buildroot}} \
+%{nil}
+
+
+%clean %%clean\
+rm -rf %{?buildroot:%{buildroot}} \
+%{nil}
+
+%find_lang      /usr/lib/rpm/find-lang.sh %{buildroot}
+%find_docs      /usr/lib/rpm/tizen/find-docs.sh %{buildroot}
+
+
+
+#==============================================================================
+# ---- default .desktop directories per the desktop-entry freedesktop.org spec
+
+%_desktopdir    %{_datadir}/applications
+
+#==============================================================================
+# ---- Generic auto req/prov filtering macros
+#
+# http://fedoraproject.org/wiki/PackagingDrafts/AutoProvidesAndRequiresFiltering
+
+# prevent anything matching from being scanned for provides
+%filter_provides_in(P) %{expand: \
+%global __filter_prov_cmd %{?__filter_prov_cmd} %{__grep} -v %{-P} '%*' | \
+}
+
+# prevent anything matching from being scanned for requires
+%filter_requires_in(P) %{expand: \
+%global __filter_req_cmd %{?__filter_req_cmd} %{__grep} -v %{-P} '%*' | \
+}
+
+# filter anything matching out of the provides stream
+%filter_from_provides() %{expand: \
+%global __filter_from_prov %{?__filter_from_prov} | %{__sed} -e '%*' \
+}
+
+# filter anything matching out of the requires stream
+%filter_from_requires() %{expand: \
+%global __filter_from_req %{?__filter_from_req} | %{__sed} -e '%*' \
+}
+
+# actually set up the filtering bits
+%filter_setup %{expand: \
+%global _use_internal_dependency_generator 0 \
+%global __deploop() while read FILE; do /usr/lib/rpm/rpmdeps -%{1} ${FILE}; done | /bin/sort -u \
+%global __find_provides /bin/sh -c "%{?__filter_prov_cmd} %{__deploop P} %{?__filter_from_prov}" \
+%global __find_requires /bin/sh -c "%{?__filter_req_cmd}  %{__deploop R} %{?__filter_from_req}" \
+}
+
+%remove_docs \
+  rm -rf %{?buildroot:%{buildroot}}%{_infodir} \
+  rm -rf %{?buildroot:%{buildroot}}%{_defaultdocdir} \
+  rm -rf %{?buildroot:%{buildroot}}%{_datadir}/doc/%{name} \
+  rm -rf %{?buildroot:%{buildroot}}%{_datadir}/doc/%{name}-%{version} \
+  rm -rf %{?buildroot:%{buildroot}}%{_datadir}/gtk-doc \
+  rm -rf %{?buildroot:%{buildroot}}%{_datadir}/doc \
+  rm -rf %{?buildroot:%{buildroot}}%{_datadir}/man \
+  find %{?buildroot:%{buildroot}} -regex ".*/man/man./.*\.[0-9]" | xargs rm -f -- \
+  find %{?buildroot:%{buildroot}} -regex ".*/man/../man./.*\.[0-9]" | xargs rm -f -- \
+  find %{?buildroot:%{buildroot}} -regex ".*/man/man./.*\.[0-9]pm" | xargs rm -f --
+
+
+%install_service() \
+mkdir -p %{buildroot}/%{_unitdir}/%{1} \
+ln -s ../%{2}  %{buildroot}/%{_unitdir}/%{1}/%{2}  \
+%{nil}
+
+
+%_fontsdir               %{_usr}/share/fonts
+%_ttfontsdir             %{_fontsdir}/truetype
+%_miscfontsdir           %{_fontsdir}/misc
+%_fontsconfdir           %{_sysconfdir}/fonts
+%_fontsconfddir          %{_fontsconfdir}/conf.d
+%_fontsconfavaildir      %{_datadir}/%{name}/conf.avail
+
+%devel_package \
+%package devel \
+Summary: Development files for package %{name}\
+Group: Development\
+%description devel\
+This package provides header files and other developer releated files for package %{name}.\
+%files devel \
+%{_includedir}/*\
+%{_libdir}/pkgconfig/*.pc\
+%{_libdir}/*.so\
+%{nil}
+
+%devel_desc This package contains all necessary include files and libraries needed \
+to develop applications that require %{name}.\
+%{nil}
+
--- librpm-tizen-4.14.1.1.tizen20230628.orig/packaging/rpm.changes
+++ librpm-tizen-4.14.1.1.tizen20230628/packaging/rpm.changes
@@ -0,0 +1,102 @@
+* Wed Jan 29 2014 Patrick McCarty <patrick.mccarty@linux.intel.com> 940f59b
+- Add three new RPM macros to use in packages with build dependencies on a
+  platform's kernel and/or kernel-devel package. The macros are
+  '%kernel_devel_uname_r', '%kernel_release', and '%kernel_name'.
+
+* Fri Jan 17 2014 Mikko Ylinen <mikko.ylinen@intel.com> accepted/tizen/generic/20140106.135159@e9e247d
+- MSM: fix access type length and validation
+- Security plugin: change policy to advisory
+- Security plugin: adding support for l access type
+
+* Tue Dec 03 2013 Rusty Lynch <rusty.lynch@intel.com> accepted/tizen/20131115.212447@d460069
+- Security plugin: removing exec label restriction
+
+* Fri Nov 15 2013 Rusty Lynch <rusty.lynch@intel.com> accepted/tizen/20131108.201843@93d4902
+- Fix rpmlint error
+- PTREL-155: fix build python-rpm
+- armv7l:fix faulty line in rpmrc.in
+- msm: check libxml/{xmlreader,tree}.h
+- Security plugin: Removing definition of System domain from default device policy
+
+* Wed Sep 25 2013 Jacek Bukarewicz <j.bukarewicz@samsung.com> accepted/tizen/20130916.211819@a771cdf
+- Introduction of -locale and -docs subpackages. Moved package to another group
+- update changes
+
+* Mon Sep 16 2013 Anas Nashif <anas.nashif@intel.com> accepted/tizen/20130913.024734@b487cf5
+- remove --target from %configure macros
+
+* Mon Sep 02 2013 Anas Nashif <anas.nashif@intel.com> submit/tizen/20130820.223822@6ebf41a
+- Security plugin: adding checking of return code for dbus policy verification
+
+* Wed Aug 21 2013 Anas Nashif <anas.nashif@intel.com> submit/tizen/20130820.223822@6ec9c11
+- Security plugin: small fixes
+- Security plugin: removing disable-dchecks option
+- update changes and release
+
+* Mon Aug 05 2013 Anas Nashif <anas.nashif@intel.com> accepted/tizen/20130710.214747@675aeea
+- Security plugin: support for --root option
+- Security plugin: pkg_name allocation in conflict
+- Security plugin: allowing multiple domains definition
+- resetting manifest requested domain to floor
+- update changelog
+
+* Wed Jun 12 2013 Anas Nashif <anas.nashif@intel.com> accepted/tizen/20130520.094313@a3c78e0
+- update macros from project conf
+- Security plugin: Adding configuration option --disable-dchecks
+- Security-plugin: Fix the null pointer comparison  possibility in msmXattrSupport
+- Set license using %license
+- Fix 32bit kernel builds by not using eu-strip
+- Cleaning up code identation
+- Fix the missing path prefix for Plugin init hook
+- Fixes to rpm security plugin  - stricter control over smack64exec label assigment  - strciter control over dbus interface labels
+- Add VCS tag into .src.rpm
+- add find-provides.ksyms
+
+* Fri Mar 29 2013 Anas Nashif <anas.nashif@intel.com> submit/trunk/20130322.180734@fcbf4ed
+- find-provides.ksyms added for kernel packages and symbols
+
+* Fri Mar 29 2013 Anas Nashif <anas.nashif@intel.com> submit/trunk/20130322.180734@fcbf4ed
+- init message test [Elena Reshetova]
+- Adding Isolated domain to policy [Elena Reshetova]
+- Changing smack load path [Elena Reshetova]
+
+* Fri Mar 22 2013 Anas Nashif <anas.nashif@intel.com> submit/trunk/20130318.200853@1a584da
+- Fixed package groups
+
+* Mon Mar 18 2013 Anas Nashif <anas.nashif@intel.com> accepted/trunk/20130309.052847@1a584da
+- Adding a new attribute tag to manifest [Elena Reshetova]
+
+* Mon Mar 04 2013 Anas Nashif <anas.nashif@intel.com> submit/trunk/20130207.030314@31fe202
+- Fixed package groups
+- add macro no_lang_C
+- update find-lang
+- Call ldconfig
+- Include %{VCS} in rpm -q --info output
+
+* Wed Feb 06 2013 Anas Nashif <anas.nashif@intel.com> submit/trunk/20130206.154747@e2d13a6
+- Call ldconfig
+
+* Wed Feb 06 2013 Anas Nashif <anas.nashif@intel.com> submit/trunk/20130203.005409@caedd28
+- Move libs back to main package
+
+* Sat Feb 02 2013 Anas Nashif <anas.nashif@intel.com> rpm-4.11.0-release@531803c
+- Update to 4.11.0.1
+
+* Tue Jan 29 2013 Markus Lehtonen <markus.lehtonen@linux.intel.com> accepted/trunk/20130119.012137@c917b46
+- Temporally making loading of a configured plugin optional [Elena Reshetova]
+
+* Thu Jan 17 2013 Anas Nashif <anas.nashif@intel.com> submit/trunk/20130117.002510@77a88bd
+- fixing error in cleanup if magic db can't be loaded [Elena Reshetova]
+
+* Wed Jan 16 2013 Anas Nashif <anas.nashif@intel.com> accepted/trunk/20130114.165627@8999b08
+- Enable security plugin/Smack
+
+* Mon Jan 14 2013 Anas Nashif <anas.nashif@intel.com> accepted/trunk/20121215.193208@ed3861a
+- Move build related files to rpm-build
+
+* Sat Dec 15 2012 Anas Nashif <anas.nashif@intel.com> submit/trunk/20121215.171010@735e3f1
+- cleanup macros
+
+* Sat Dec 15 2012 Anas Nashif <anas.nashif@intel.com> rpm-4.11.0-beta1@be4c7d8
+- Update to 4.11 beta1
+
--- librpm-tizen-4.14.1.1.tizen20230628.orig/packaging/rpm.manifest
+++ librpm-tizen-4.14.1.1.tizen20230628/packaging/rpm.manifest
@@ -0,0 +1,5 @@
+<manifest>
+ <request>
+    <domain name="_"/>
+ </request>
+</manifest>
--- librpm-tizen-4.14.1.1.tizen20230628.orig/packaging/rpmconfigcheck
+++ librpm-tizen-4.14.1.1.tizen20230628/packaging/rpmconfigcheck
@@ -0,0 +1,80 @@
+#! /bin/bash
+# Copyright (c) 2002 SuSE GmbH Nuernberg, Germany.
+#
+# Author: Michael Schroeder <feedback@suse.de>
+#
+# /etc/init.d/rpmconfigcheck
+# /usr/sbin/rcrpmconfigcheck
+#
+# Script to scan for unresolved .rpmnew, .rpmorig, and .rpmsave files
+#
+### BEGIN INIT INFO
+# Provides: rpmconfigcheck
+# Required-Start: $remote_fs
+# Required-Stop: $null
+# Default-Start: 2 3 5
+# Default-Stop:
+# Description: rpm config file scan
+### END INIT INFO
+
+. /etc/rc.status
+
+# First reset status of this service
+rc_reset
+
+configcheckfile=/var/adm/rpmconfigcheck
+packages=/var/lib/rpm/Packages
+
+test -z "$1" && set start
+
+case "$1" in
+    start|restart|try-restart|reload|force-reload)
+	if test -s $packages -a \( ! -e $configcheckfile -o -s $configcheckfile -o ! $packages -ot $configcheckfile \) ; then
+	    echo -n "Searching for unresolved configuration files"
+	    if test ! -e $configcheckfile -o ! $packages -ot $configcheckfile ; then
+		test -e $configcheckfile && mv -f $configcheckfile $configcheckfile.old
+		rpm -qalc | sort | perl -lne '-e "$_.rpmnew" and print "$_.rpmnew"; -e "$_.rpmorig" and print "$_.rpmorig"; -e "$_.rpmsave" and print "$_.rpmsave"' > $configcheckfile
+	    else
+		mv -f $configcheckfile $configcheckfile.old
+		while read l; do
+		    test -e $l && echo $l
+		done < $configcheckfile.old > $configcheckfile
+		true
+	    fi
+	    rc_status -v
+	    if test -s $configcheckfile; then
+		echo "Please check the following files (see /var/adm/rpmconfigcheck):"
+		sed -e 's/^/    /' < $configcheckfile
+		touch $configcheckfile.old
+		cat $configcheckfile $configcheckfile.old | sort | uniq -d > $configcheckfile.dup
+		cat $configcheckfile $configcheckfile.dup | sort | uniq -u > $configcheckfile.new
+		if test -s $configcheckfile.new ; then
+		    (
+		    echo "----------------------------------------------------------------------"
+		    echo "----------------------------------------------------------------------"
+		    echo "rpmconfigcheck"
+		    date
+		    echo "----------------------------------------"
+		    echo "This is a warning message."
+		    echo "rpmconfigcheck has found the following new unresolved config files"
+		    echo "(all files are listed in /var/adm/rpmconfigcheck):"
+		    cat $configcheckfile.new
+		    echo "----------------------------------------"
+		    ) >> /var/log/update-messages
+		fi
+	    fi
+	    rm -f $configcheckfile.old $configcheckfile.dup $configcheckfile.new
+	fi
+	;;
+    stop)
+	;;
+    status)
+	rc_failed 4
+	rc_status -v
+	;;
+     *)
+	echo "Usage: $0 {start}"
+	exit 1
+	;;
+esac
+rc_exit
--- librpm-tizen-4.14.1.1.tizen20230628.orig/python/Makefile.am
+++ librpm-tizen-4.14.1.1.tizen20230628/python/Makefile.am
@@ -7,18 +7,21 @@
 
 AM_CPPFLAGS = -I$(top_builddir)/include/
 AM_CPPFLAGS += -I$(top_srcdir)/python
-AM_CPPFLAGS += @PYTHON_CFLAGS@
+AM_CPPFLAGS += @PYTHON_CFLAGS@ -DPYTHON_MODULENAME=\"@PYTHON_MODULENAME@\"
 
-pkgpyexec_LTLIBRARIES = _rpmmodule.la _rpmbmodule.la _rpmsmodule.la
+pkgpyexec_LTLIBRARIES = _rpm.la
 pkgpyexec_DATA = rpm/__init__.py rpm/transaction.py
+pkgpyexecdir = @pyexecdir@/@PYTHON_MODULENAME@
 
-_rpmmodule_la_LDFLAGS = -module -avoid-version -shared
-_rpmmodule_la_LIBADD = \
+_rpm_la_LDFLAGS = -module -avoid-version -shared
+_rpm_la_LIBADD = \
 	$(top_builddir)/lib/librpm.la \
 	$(top_builddir)/rpmio/librpmio.la \
+	$(top_builddir)/build/librpmbuild.la \
+	$(top_builddir)/sign/librpmsign.la \
 	@PYTHON_LIBS@
 
-_rpmmodule_la_SOURCES = rpmmodule.c rpmsystem-py.h \
+_rpm_la_SOURCES = rpmmodule.c rpmsystem-py.h \
 	header-py.c header-py.h \
 	rpmarchive-py.c rpmarchive-py.h \
 	rpmds-py.c rpmds-py.h \
@@ -33,24 +36,5 @@
 	rpmstrpool-py.c rpmstrpool-py.h \
 	rpmtd-py.c rpmtd-py.h \
 	rpmte-py.c rpmte-py.h \
-	rpmts-py.c rpmts-py.h
-
-_rpmbmodule_la_LDFLAGS = -module -avoid-version -shared
-_rpmbmodule_la_LIBADD = \
-	$(top_builddir)/build/librpmbuild.la \
-	$(top_builddir)/lib/librpm.la \
-	$(top_builddir)/rpmio/librpmio.la \
-	@PYTHON_LIBS@
-
-_rpmbmodule_la_SOURCES = rpmbmodule.c rpmsystem-py.h \
+	rpmts-py.c rpmts-py.h \
 	spec-py.c spec-py.h
-
-_rpmsmodule_la_LDFLAGS = -module -avoid-version -shared
-_rpmsmodule_la_LIBADD = \
-        $(top_builddir)/sign/librpmsign.la \
-        $(top_builddir)/lib/librpm.la \
-        $(top_builddir)/rpmio/librpmio.la \
-	@PYTHON_LIBS@
-
-_rpmsmodule_la_SOURCES = rpmsmodule.c rpmsystem-py.h
-
--- librpm-tizen-4.14.1.1.tizen20230628.orig/python/header-py.c
+++ librpm-tizen-4.14.1.1.tizen20230628/python/header-py.c
@@ -143,7 +143,7 @@
 
     hi = headerInitIterator(s->h);
     while ((tag = headerNextTag(hi)) != RPMTAG_NOT_FOUND) {
-	PyObject *to = PyInt_FromLong(tag);
+	PyObject *to = PyLong_FromLong(tag);
         if (!to) {
             headerFreeIterator(hi);
             Py_DECREF(keys);
@@ -231,7 +231,7 @@
 	return NULL;
     }
 
-    result = Py_BuildValue("s", r);
+    result = utf8FromString(r);
     free(r);
 
     return result;
@@ -377,7 +377,7 @@
     if (obj == NULL) {
 	h = headerNew();
     } else if (CAPSULE_CHECK(obj)) {
-	h = CAPSULE_EXTRACT(obj, "rpm._C_Header");
+	h = CAPSULE_EXTRACT(obj, PYTHON_MODULENAME"._C_Header");
 	headerLink(h);
     } else if (hdrObject_Check(obj)) {
 	h = headerCopy(((hdrObject*) obj)->h);
@@ -415,7 +415,7 @@
     if (s->hi == NULL) s->hi = headerInitIterator(s->h);
 
     if ((tag = headerNextTag(s->hi)) != RPMTAG_NOT_FOUND) {
-	res = PyInt_FromLong(tag);
+	res = PyLong_FromLong(tag);
     } else {
 	s->hi = headerFreeIterator(s->hi);
     }
@@ -442,9 +442,9 @@
     rpmTagVal tag = RPMTAG_NOT_FOUND;
     PyObject *str = NULL;
 
-    if (PyInt_Check(item)) {
+    if (PyLong_Check(item)) {
 	/* XXX we should probably validate tag numbers too */
-	tag = PyInt_AsLong(item);
+	tag = PyLong_AsLong(item);
     } else if (utf8FromPyObject(item, &str)) {
 	tag = rpmTagGetValue(PyBytes_AsString(str));
 	Py_DECREF(str);
@@ -483,7 +483,7 @@
 
     switch (tclass) {
     case RPM_NUMERIC_CLASS:
-	rc = (PyLong_Check(item) || PyInt_Check(item));
+	rc = (PyLong_Check(item) || PyLong_Check(item));
 	break;
     case RPM_STRING_CLASS:
 	rc = (PyBytes_Check(item) || PyUnicode_Check(item));
@@ -532,7 +532,7 @@
     case RPM_STRING_TYPE:
     case RPM_STRING_ARRAY_TYPE: {
 	PyObject *str = NULL;
-	if (utf8FromPyObject(item, &str)) 
+	if (utf8FromPyObject(item, &str))
 	    rc = headerPutString(h, tag, PyBytes_AsString(str));
 	Py_XDECREF(str);
 	} break;
@@ -542,20 +542,20 @@
 	rc = headerPutBin(h, tag, val, len);
 	} break;
     case RPM_INT64_TYPE: {
-	uint64_t val = PyInt_AsUnsignedLongLongMask(item);
+	uint64_t val = PyLong_AsUnsignedLongLongMask(item);
 	rc = headerPutUint64(h, tag, &val, 1);
 	} break;
     case RPM_INT32_TYPE: {
-	uint32_t val = PyInt_AsUnsignedLongMask(item);
+	uint32_t val = PyLong_AsUnsignedLongMask(item);
 	rc = headerPutUint32(h, tag, &val, 1);
 	} break;
     case RPM_INT16_TYPE: {
-	uint16_t val = PyInt_AsUnsignedLongMask(item);
+	uint16_t val = PyLong_AsUnsignedLongMask(item);
 	rc = headerPutUint16(h, tag, &val, 1);
 	} break;
     case RPM_INT8_TYPE:
     case RPM_CHAR_TYPE: {
-	uint8_t val = PyInt_AsUnsignedLongMask(item);
+	uint8_t val = PyLong_AsUnsignedLongMask(item);
 	rc = headerPutUint8(h, tag, &val, 1);
 	} break;
     default:
@@ -718,7 +718,7 @@
 
 PyTypeObject hdr_Type = {
 	PyVarObject_HEAD_INIT(&PyType_Type, 0)
-	"rpm.hdr",			/* tp_name */
+	PYTHON_MODULENAME".hdr",	/* tp_name */
 	sizeof(hdrObject),		/* tp_size */
 	0,				/* tp_itemsize */
 	(destructor) hdr_dealloc, 	/* tp_dealloc */
--- librpm-tizen-4.14.1.1.tizen20230628.orig/python/rpm/__init__.py.in
+++ librpm-tizen-4.14.1.1.tizen20230628/python/rpm/__init__.py.in
@@ -0,0 +1,116 @@
+r"""RPM Module
+
+This module enables you to manipulate rpms and the rpm database.
+
+The rpm base module provides the main starting point for
+accessing RPM from Python. For most usage, call
+the TransactionSet method to get a transaction set (rpmts).
+
+For example:
+	import rpm
+	ts = rpm.TransactionSet()
+
+The transaction set will open the RPM database as needed, so
+in most cases, you do not need to explicitly open the
+database. The transaction set is the workhorse of RPM.
+
+You can open another RPM database, such as one that holds
+all packages for a given Linux distribution, to provide
+packages used to solve dependencies. To do this, use
+the following code:
+
+rpm.addMacro('_dbpath', '/path/to/alternate/database')
+solvets = rpm.TransactionSet()
+solvets.openDB()
+rpm.delMacro('_dbpath')
+
+# Open default database
+ts = rpm.TransactionSet()
+
+This code gives you access to two RPM databases through
+two transaction sets (rpmts): ts is a transaction set
+associated with the default RPM database and solvets
+is a transaction set tied to an alternate database, which
+is very useful for resolving dependencies.
+"""
+
+import warnings
+from @PYTHON_MODULENAME@._rpm import *
+from @PYTHON_MODULENAME@.transaction import *
+import @PYTHON_MODULENAME@._rpm as _rpm
+_RPMVSF_NODIGESTS = _rpm._RPMVSF_NODIGESTS
+_RPMVSF_NOHEADER = _rpm._RPMVSF_NOHEADER
+_RPMVSF_NOPAYLOAD = _rpm._RPMVSF_NOPAYLOAD
+_RPMVSF_NOSIGNATURES = _rpm._RPMVSF_NOSIGNATURES
+
+__version__ = _rpm.__version__
+__version_info__ = tuple(__version__.split('.'))
+
+# backwards compatibility + give the same class both ways
+ts = TransactionSet
+
+
+def headerLoad(*args, **kwds):
+    """DEPRECATED! Use rpm.hdr() instead."""
+    warnings.warn("Use rpm.hdr() instead.", DeprecationWarning, stacklevel=2)
+    return hdr(*args, **kwds)
+
+
+def _doHeaderListFromFD(rpm_fd, retrofit):
+    hlist = []
+    while 1:
+        try:
+            h = hdr(rpm_fd)
+            if retrofit:
+                h.convert(HEADERCONV_RETROFIT_V3)
+            hlist.append(h)
+        except _rpm.error:
+            break
+
+    return hlist
+
+
+def readHeaderListFromFD(file_desc, retrofit=True):
+    if not isinstance(file_desc, fd):
+        file_desc = fd(file_desc)
+    return _doHeaderListFromFD(file_desc, retrofit)
+
+
+def readHeaderListFromFile(path, retrofit=True):
+    f = fd(path)
+    hlist = _doHeaderListFromFD(f, retrofit)
+    f.close()
+    return hlist
+
+
+def readHeaderFromFD(file_desc):
+    """Return (header, pos_before_hdr)"""
+    if not isinstance(file_desc, fd):
+        file_desc = fd(file_desc)
+    try:
+        offset = file_desc.tell()
+        h = hdr(file_desc)
+    except (_rpm.error, IOError):
+        offset = None
+        h = None
+
+    return (h, offset)
+
+
+def signalsCaught(siglist):
+    """Returns list of signals that were caught."""
+    caught = []
+    for sig in siglist:
+        if signalCaught(sig):
+            caught.append(sig)
+
+    return caught
+
+
+def dsSingle(TagN, N, EVR="", Flags=RPMSENSE_ANY):
+    """
+    Creates a single entry dependency set (ds)
+
+    dsSingle(RPMTAG_CONFLICTNAME, "rpm") corresponds to "Conflicts: rpm"
+    """
+    return ds((N, Flags, EVR), TagN)
--- librpm-tizen-4.14.1.1.tizen20230628.orig/python/rpm/transaction.py.in
+++ librpm-tizen-4.14.1.1.tizen20230628/python/rpm/transaction.py.in
@@ -0,0 +1,175 @@
+from __future__ import with_statement
+
+import sys
+import @PYTHON_MODULENAME@ as rpm
+from @PYTHON_MODULENAME@._rpm import ts as TransactionSetCore
+
+if sys.version_info[0] == 3:
+    _string_types = str,
+else:
+    _string_types = basestring,
+
+
+# TODO: migrate relevant documentation from C-side
+class TransactionSet(TransactionSetCore):
+    _probFilter = 0
+
+    def _wrapSetGet(self, attr, val):
+        oval = getattr(self, attr)
+        setattr(self, attr, val)
+        return oval
+
+    def setVSFlags(self, flags):
+        return self._wrapSetGet('_vsflags', flags)
+
+    def getVSFlags(self):
+        return self._vsflags
+
+    def setColor(self, color):
+        return self._wrapSetGet('_color', color)
+
+    def setPrefColor(self, color):
+        return self._wrapSetGet('_prefcolor', color)
+
+    def setFlags(self, flags):
+        return self._wrapSetGet('_flags', flags)
+
+    def setProbFilter(self, ignoreSet):
+        return self._wrapSetGet('_probFilter', ignoreSet)
+
+    def parseSpec(self, specfile):
+        return rpm.spec(specfile)
+
+    def getKeys(self):
+        keys = []
+        for te in self:
+            keys.append(te.Key())
+        # Backwards compatibility goo - WTH does this return a *tuple* ?!
+        if not keys:
+            return None
+        else:
+            return tuple(keys)
+
+    def _f2hdr(self, item):
+        if isinstance(item, _string_types):
+            with open(item) as f:
+                header = self.hdrFromFdno(f)
+        elif isinstance(item, rpm.hdr):
+            header = item
+        else:
+            header = self.hdrFromFdno(item)
+        return header
+
+    def addInstall(self, item, key, how="u"):
+        header = self._f2hdr(item)
+
+        if how not in ['u', 'i']:
+            raise ValueError('how argument must be "u" or "i"')
+        upgrade = (how == "u")
+
+        if not TransactionSetCore.addInstall(self, header, key, upgrade):
+            raise rpm.error("adding package to transaction failed")
+
+    def addReinstall(self, item, key):
+        header = self._f2hdr(item)
+
+        if not TransactionSetCore.addReinstall(self, header, key):
+            raise rpm.error("adding package to transaction failed")
+
+    def addErase(self, item):
+        hdrs = []
+        if isinstance(item, rpm.hdr):
+            hdrs = [item]
+        elif isinstance(item, rpm.mi):
+            hdrs = item
+        elif isinstance(item, int):
+            hdrs = self.dbMatch(rpm.RPMDBI_PACKAGES, item)
+        elif isinstance(item, _string_types):
+            hdrs = self.dbMatch(rpm.RPMDBI_LABEL, item)
+        else:
+            raise TypeError("invalid type %s" % type(item))
+
+        for h in hdrs:
+            if not TransactionSetCore.addErase(self, h):
+                raise rpm.error("package not installed")
+
+        # garbage collection should take care but just in case...
+        if isinstance(hdrs, rpm.mi):
+            del hdrs
+
+    def run(self, callback, data):
+        rc = TransactionSetCore.run(self, callback, data, self._probFilter)
+
+        # crazy backwards compatibility goo: None for ok, list of problems
+        # if transaction didn't complete and empty list if it completed
+        # with errors
+        if rc == 0:
+            return None
+
+        res = []
+        if rc > 0:
+            for prob in self.problems():
+                item = ("%s" % prob, (prob.type, prob._str, prob._num))
+                res.append(item)
+        return res
+
+    def check(self, *args, **kwds):
+        TransactionSetCore.check(self, *args, **kwds)
+
+        # compatibility: munge problem strings into dependency tuples of doom
+        res = []
+        for p in self.problems():
+            # is it anything we need to care about?
+            if p.type == rpm.RPMPROB_CONFLICT:
+                sense = rpm.RPMDEP_SENSE_CONFLICTS
+            elif p.type == rpm.RPMPROB_REQUIRES:
+                sense = rpm.RPMDEP_SENSE_REQUIRES
+            else:
+                continue
+
+            # strip arch, split to name, version, release
+            nevr = p.altNEVR.rsplit('.', 1)[0]
+            n, v, r = nevr.rsplit('-', 2)
+
+            # extract the dependency information
+            needs = p._str.split()
+            needname = needs[0]
+            needflags = rpm.RPMSENSE_ANY
+            if len(needs) == 3:
+                needop = needs[1]
+                if '<' in needop:
+                    needflags |= rpm.RPMSENSE_LESS
+                if '=' in needop:
+                    needflags |= rpm.RPMSENSE_EQUAL
+                if '>' in needop:
+                    needflags |= rpm.RPMSENSE_GREATER
+                needver = needs[2]
+            else:
+                needver = ""
+
+            res.append(((n, v, r),
+                        (needname, needver), needflags, sense, p.key))
+
+        return res
+
+    def hdrCheck(self, blob):
+        res, msg = TransactionSetCore.hdrCheck(self, blob)
+        # generate backwards compatibly broken exceptions
+        if res == rpm.RPMRC_NOKEY:
+            raise rpm.error("public key not available")
+        elif res == rpm.RPMRC_NOTTRUSTED:
+            raise rpm.error("public key not trusted")
+        elif res != rpm.RPMRC_OK:
+            raise rpm.error(msg)
+
+    def hdrFromFdno(self, fd):
+        res, h = TransactionSetCore.hdrFromFdno(self, fd)
+        # generate backwards compatibly broken exceptions
+        if res == rpm.RPMRC_NOKEY:
+            raise rpm.error("public key not available")
+        elif res == rpm.RPMRC_NOTTRUSTED:
+            raise rpm.error("public key not trusted")
+        elif res != rpm.RPMRC_OK:
+            raise rpm.error("error reading package header")
+
+        return h
--- librpm-tizen-4.14.1.1.tizen20230628.orig/python/rpmds-py.c
+++ librpm-tizen-4.14.1.1.tizen20230628/python/rpmds-py.c
@@ -31,19 +31,19 @@
 static PyObject *
 rpmds_DNEVR(rpmdsObject * s)
 {
-    return Py_BuildValue("s", rpmdsDNEVR(s->ds));
+    return utf8FromString(rpmdsDNEVR(s->ds));
 }
 
 static PyObject *
 rpmds_N(rpmdsObject * s)
 {
-    return Py_BuildValue("s", rpmdsN(s->ds));
+    return utf8FromString(rpmdsN(s->ds));
 }
 
 static PyObject *
 rpmds_EVR(rpmdsObject * s)
 {
-    return Py_BuildValue("s", rpmdsEVR(s->ds));
+    return utf8FromString(rpmdsEVR(s->ds));
 }
 
 static PyObject *
@@ -230,14 +230,14 @@
 {
     int ix;
 
-    if (!PyInt_Check(key)) {
+    if (!PyLong_Check(key)) {
 	PyErr_SetString(PyExc_TypeError, "integer expected");
 	return NULL;
     }
 
-    ix = (int) PyInt_AsLong(key);
+    ix = (int) PyLong_AsLong(key);
     rpmdsSetIx(s->ds, ix);
-    return Py_BuildValue("s", rpmdsDNEVR(s->ds));
+    return utf8FromString(rpmdsDNEVR(s->ds));
 }
 
 static PyMappingMethods rpmds_as_mapping = {
@@ -258,9 +258,9 @@
     PyObject *str = NULL;
     rpmsenseFlags flags = RPMSENSE_ANY;
 
-    if (PyInt_Check(o)) {
+    if (PyLong_Check(o)) {
 	ok = 1;
-	flags = PyInt_AsLong(o);
+	flags = PyLong_AsLong(o);
     } else if (utf8FromPyObject(o, &str)) {
 	ok = 1;
 	for (const char *s = PyBytes_AsString(str); *s; s++) {
@@ -339,7 +339,7 @@
 
 PyTypeObject rpmds_Type = {
 	PyVarObject_HEAD_INIT(&PyType_Type, 0)
-	"rpm.ds",			/* tp_name */
+	PYTHON_MODULENAME".ds",		/* tp_name */
 	sizeof(rpmdsObject),		/* tp_basicsize */
 	0,				/* tp_itemsize */
 	/* methods */
--- librpm-tizen-4.14.1.1.tizen20230628.orig/python/rpmfd-py.c
+++ librpm-tizen-4.14.1.1.tizen20230628/python/rpmfd-py.c
@@ -327,17 +327,17 @@
 static PyObject *rpmfd_get_name(rpmfdObject *s)
 {
     /* XXX: rpm returns non-paths with [mumble], python files use <mumble> */
-    return Py_BuildValue("s", Fdescr(s->fd));
+    return utf8FromString(Fdescr(s->fd));
 }
 
 static PyObject *rpmfd_get_mode(rpmfdObject *s)
 {
-    return Py_BuildValue("s", s->mode);
+    return utf8FromString(s->mode);
 }
 
 static PyObject *rpmfd_get_flags(rpmfdObject *s)
 {
-    return Py_BuildValue("s", s->flags);
+    return utf8FromString(s->flags);
 }
 
 static PyGetSetDef rpmfd_getseters[] = {
@@ -350,7 +350,7 @@
 
 PyTypeObject rpmfd_Type = {
 	PyVarObject_HEAD_INIT(&PyType_Type, 0)
-	"rpm.fd",			/* tp_name */
+	PYTHON_MODULENAME".fd",		/* tp_name */
 	sizeof(rpmfdObject),		/* tp_size */
 	0,				/* tp_itemsize */
 	/* methods */
--- librpm-tizen-4.14.1.1.tizen20230628.orig/python/rpmfi-py.c
+++ librpm-tizen-4.14.1.1.tizen20230628/python/rpmfi-py.c
@@ -41,19 +41,19 @@
 static PyObject *
 rpmfi_BN(rpmfiObject * s, PyObject * unused)
 {
-    return Py_BuildValue("s", rpmfiBN(s->fi));
+    return utf8FromString(rpmfiBN(s->fi));
 }
 
 static PyObject *
 rpmfi_DN(rpmfiObject * s, PyObject * unused)
 {
-    return Py_BuildValue("s", rpmfiDN(s->fi));
+    return utf8FromString(rpmfiDN(s->fi));
 }
 
 static PyObject *
 rpmfi_FN(rpmfiObject * s, PyObject * unused)
 {
-    return Py_BuildValue("s", rpmfiFN(s->fi));
+    return utf8FromString(rpmfiFN(s->fi));
 }
 
 static PyObject *
@@ -98,7 +98,7 @@
 {
     char *digest = rpmfiFDigestHex(s->fi, NULL);
     if (digest) {
-	PyObject *dig = Py_BuildValue("s", digest);
+	PyObject *dig = utf8FromString(digest);
 	free(digest);
 	return dig;
     } else {
@@ -109,7 +109,7 @@
 static PyObject *
 rpmfi_FLink(rpmfiObject * s, PyObject * unused)
 {
-    return Py_BuildValue("s", rpmfiFLink(s->fi));
+    return utf8FromString(rpmfiFLink(s->fi));
 }
 
 static PyObject *
@@ -133,13 +133,13 @@
 static PyObject *
 rpmfi_FUser(rpmfiObject * s, PyObject * unused)
 {
-    return Py_BuildValue("s", rpmfiFUser(s->fi));
+    return utf8FromString(rpmfiFUser(s->fi));
 }
 
 static PyObject *
 rpmfi_FGroup(rpmfiObject * s, PyObject * unused)
 {
-    return Py_BuildValue("s", rpmfiFGroup(s->fi));
+    return utf8FromString(rpmfiFGroup(s->fi));
 }
 
 static PyObject *
@@ -155,7 +155,7 @@
 
     if ((FClass = rpmfiFClass(s->fi)) == NULL)
 	FClass = "";
-    return Py_BuildValue("s", FClass);
+    return utf8FromString(FClass);
 }
 
 static PyObject *
@@ -172,7 +172,7 @@
 
     result = PyTuple_New(nlinks);
     for (uint32_t i=0; i<nlinks; i++) {
-	PyTuple_SET_ITEM(result,  i, PyInt_FromLong(files[i]));
+	PyTuple_SET_ITEM(result,  i, PyLong_FromLong(files[i]));
     }
     return result;
 }
@@ -208,26 +208,26 @@
 	    Py_INCREF(Py_None);
 	    PyTuple_SET_ITEM(result, 0, Py_None);
 	} else
-	    PyTuple_SET_ITEM(result,  0, Py_BuildValue("s", FN));
+	    PyTuple_SET_ITEM(result,  0, utf8FromString(FN));
 	PyTuple_SET_ITEM(result,  1, PyLong_FromLongLong(FSize));
-	PyTuple_SET_ITEM(result,  2, PyInt_FromLong(FMode));
-	PyTuple_SET_ITEM(result,  3, PyInt_FromLong(FMtime));
-	PyTuple_SET_ITEM(result,  4, PyInt_FromLong(FFlags));
-	PyTuple_SET_ITEM(result,  5, PyInt_FromLong(FRdev));
-	PyTuple_SET_ITEM(result,  6, PyInt_FromLong(FInode));
-	PyTuple_SET_ITEM(result,  7, PyInt_FromLong(FNlink));
-	PyTuple_SET_ITEM(result,  8, PyInt_FromLong(FState));
-	PyTuple_SET_ITEM(result,  9, PyInt_FromLong(VFlags));
+	PyTuple_SET_ITEM(result,  2, PyLong_FromLong(FMode));
+	PyTuple_SET_ITEM(result,  3, PyLong_FromLong(FMtime));
+	PyTuple_SET_ITEM(result,  4, PyLong_FromLong(FFlags));
+	PyTuple_SET_ITEM(result,  5, PyLong_FromLong(FRdev));
+	PyTuple_SET_ITEM(result,  6, PyLong_FromLong(FInode));
+	PyTuple_SET_ITEM(result,  7, PyLong_FromLong(FNlink));
+	PyTuple_SET_ITEM(result,  8, PyLong_FromLong(FState));
+	PyTuple_SET_ITEM(result,  9, PyLong_FromLong(VFlags));
 	if (FUser == NULL) {
 	    Py_INCREF(Py_None);
 	    PyTuple_SET_ITEM(result, 10, Py_None);
 	} else
-	    PyTuple_SET_ITEM(result, 10, Py_BuildValue("s", FUser));
+	    PyTuple_SET_ITEM(result, 10, utf8FromString(FUser));
 	if (FGroup == NULL) {
 	    Py_INCREF(Py_None);
 	    PyTuple_SET_ITEM(result, 11, Py_None);
 	} else
-	    PyTuple_SET_ITEM(result, 11, Py_BuildValue("s", FGroup));
+	    PyTuple_SET_ITEM(result, 11, utf8FromString(FGroup));
 	PyTuple_SET_ITEM(result, 12, rpmfi_Digest(s, NULL));
 
     } else
@@ -306,14 +306,14 @@
 {
     int ix;
 
-    if (!PyInt_Check(key)) {
+    if (!PyLong_Check(key)) {
 	PyErr_SetString(PyExc_TypeError, "integer expected");
 	return NULL;
     }
 
-    ix = (int) PyInt_AsLong(key);
+    ix = (int) PyLong_AsLong(key);
     rpmfiSetFX(s->fi, ix);
-    return Py_BuildValue("s", rpmfiFN(s->fi));
+    return utf8FromString(rpmfiFN(s->fi));
 }
 
 static PyMappingMethods rpmfi_as_mapping = {
@@ -362,7 +362,7 @@
 
 PyTypeObject rpmfi_Type = {
 	PyVarObject_HEAD_INIT(&PyType_Type, 0)
-	"rpm.fi",			/* tp_name */
+	PYTHON_MODULENAME".fi",		/* tp_name */
 	sizeof(rpmfiObject),		/* tp_basicsize */
 	0,				/* tp_itemsize */
 	/* methods */
--- librpm-tizen-4.14.1.1.tizen20230628.orig/python/rpmfiles-py.c
+++ librpm-tizen-4.14.1.1.tizen20230628/python/rpmfiles-py.c
@@ -41,37 +41,37 @@
 static PyObject *rpmfile_name(rpmfileObject *s)
 {
     char * fn = rpmfilesFN(s->files, s->ix);
-    PyObject *o = Py_BuildValue("s", fn);
+    PyObject *o = utf8FromString(fn);
     free(fn);
     return o;
 }
 
 static PyObject *rpmfile_basename(rpmfileObject *s)
 {
-    return Py_BuildValue("s", rpmfilesBN(s->files, s->ix));
+    return utf8FromString(rpmfilesBN(s->files, s->ix));
 }
 
 static PyObject *rpmfile_dirname(rpmfileObject *s)
 {
-    return Py_BuildValue("s", rpmfilesDN(s->files, rpmfilesDI(s->files, s->ix)));
+    return utf8FromString(rpmfilesDN(s->files, rpmfilesDI(s->files, s->ix)));
 }
 
 static PyObject *rpmfile_orig_name(rpmfileObject *s)
 {
     char * fn = rpmfilesOFN(s->files, s->ix);
-    PyObject *o = Py_BuildValue("s", fn);
+    PyObject *o = utf8FromString(fn);
     free(fn);
     return o;
 }
 
 static PyObject *rpmfile_orig_basename(rpmfileObject *s)
 {
-    return Py_BuildValue("s", rpmfilesOBN(s->files, s->ix));
+    return utf8FromString(rpmfilesOBN(s->files, s->ix));
 }
 
 static PyObject *rpmfile_orig_dirname(rpmfileObject *s)
 {
-    return Py_BuildValue("s", rpmfilesODN(s->files, rpmfilesODI(s->files, s->ix)));
+    return utf8FromString(rpmfilesODN(s->files, rpmfilesODI(s->files, s->ix)));
 }
 static PyObject *rpmfile_mode(rpmfileObject *s)
 {
@@ -105,17 +105,17 @@
 
 static PyObject *rpmfile_linkto(rpmfileObject *s)
 {
-    return Py_BuildValue("s", rpmfilesFLink(s->files, s->ix));
+    return utf8FromString(rpmfilesFLink(s->files, s->ix));
 }
 
 static PyObject *rpmfile_user(rpmfileObject *s)
 {
-    return Py_BuildValue("s", rpmfilesFUser(s->files, s->ix));
+    return utf8FromString(rpmfilesFUser(s->files, s->ix));
 }
 
 static PyObject *rpmfile_group(rpmfileObject *s)
 {
-    return Py_BuildValue("s", rpmfilesFGroup(s->files, s->ix));
+    return utf8FromString(rpmfilesFGroup(s->files, s->ix));
 }
 
 static PyObject *rpmfile_fflags(rpmfileObject *s)
@@ -145,7 +145,7 @@
 						  NULL, &diglen);
     if (digest) {
 	char * hex = pgpHexStr(digest, diglen);
-	PyObject *o = Py_BuildValue("s", hex);
+	PyObject *o = utf8FromString(hex);
 	free(hex);
 	return o;
     }
@@ -154,17 +154,17 @@
 
 static PyObject *rpmfile_class(rpmfileObject *s)
 {
-    return Py_BuildValue("s", rpmfilesFClass(s->files, s->ix));
+    return utf8FromString(rpmfilesFClass(s->files, s->ix));
 }
 
 static PyObject *rpmfile_caps(rpmfileObject *s)
 {
-    return Py_BuildValue("s", rpmfilesFCaps(s->files, s->ix));
+    return utf8FromString(rpmfilesFCaps(s->files, s->ix));
 }
 
 static PyObject *rpmfile_langs(rpmfileObject *s)
 {
-    return Py_BuildValue("s", rpmfilesFLangs(s->files, s->ix));
+    return utf8FromString(rpmfilesFLangs(s->files, s->ix));
 }
 
 static PyObject *rpmfile_links(rpmfileObject *s)
@@ -468,8 +468,8 @@
     PyObject *str = NULL;
 
     /* treat numbers as sequence accesses */
-    if (PyInt_Check(item)) {
-	return rpmfiles_getitem(s, PyInt_AsSsize_t(item));
+    if (PyLong_Check(item)) {
+	return rpmfiles_getitem(s, PyLong_AsSsize_t(item));
     } else if (PyLong_Check(item)) {
 	return rpmfiles_getitem(s, PyLong_AsSsize_t(item));
     }
@@ -478,7 +478,7 @@
     if (PySlice_Check(item)) {
 	Py_ssize_t start, stop, step, slicelength, i, cur;
 	PyObject * result;
-	
+
 	if (PySlice_GetIndicesEx(
 #if PY_MAJOR_VERSION < 3
 				 (PySliceObject*)
--- librpm-tizen-4.14.1.1.tizen20230628.orig/python/rpmii-py.c
+++ librpm-tizen-4.14.1.1.tizen20230628/python/rpmii-py.c
@@ -68,9 +68,9 @@
     for (int i = 0; i < entries; i++) {
         tuple = PyTuple_New(2);
         PyTuple_SET_ITEM(tuple, 0,
-                         PyInt_FromLong(rpmdbIndexIteratorPkgOffset(s->ii, i)));
+                         PyLong_FromLong(rpmdbIndexIteratorPkgOffset(s->ii, i)));
         PyTuple_SET_ITEM(tuple, 1,
-                         PyInt_FromLong(rpmdbIndexIteratorTagNum(s->ii, i)));
+                         PyLong_FromLong(rpmdbIndexIteratorTagNum(s->ii, i)));
 	PyList_SET_ITEM(list, i, tuple);
     }
     return list;
@@ -115,7 +115,7 @@
 
 PyTypeObject rpmii_Type = {
 	PyVarObject_HEAD_INIT(&PyType_Type, 0)
-	"rpm.ii",			/* tp_name */
+	PYTHON_MODULENAME".ii",		/* tp_name */
 	sizeof(rpmiiObject),		/* tp_size */
 	0,				/* tp_itemsize */
 	(destructor) rpmii_dealloc, 	/* tp_dealloc */
--- librpm-tizen-4.14.1.1.tizen20230628.orig/python/rpmkeyring-py.c
+++ librpm-tizen-4.14.1.1.tizen20230628/python/rpmkeyring-py.c
@@ -38,7 +38,7 @@
 static PyObject * rpmPubkey_Base64(rpmPubkeyObject *s)
 {
     char *b64 = rpmPubkeyBase64(s->pubkey);
-    PyObject *res = Py_BuildValue("s", b64);
+    PyObject *res = utf8FromString(b64);
     free(b64);
     return res;
 }
@@ -52,7 +52,7 @@
 
 PyTypeObject rpmPubkey_Type = {
 	PyVarObject_HEAD_INIT(&PyType_Type, 0)
-	"rpm.pubkey",			/* tp_name */
+	PYTHON_MODULENAME".pubkey",	/* tp_name */
 	sizeof(rpmPubkeyObject),	/* tp_size */
 	0,				/* tp_itemsize */
 	(destructor) rpmPubkey_dealloc,/* tp_dealloc */
@@ -133,7 +133,7 @@
 
 PyTypeObject rpmKeyring_Type = {
 	PyVarObject_HEAD_INIT(&PyType_Type, 0)
-	"rpm.keyring",			/* tp_name */
+	PYTHON_MODULENAME".keyring",	/* tp_name */
 	sizeof(rpmKeyringObject),	/* tp_size */
 	0,				/* tp_itemsize */
 	(destructor) rpmKeyring_dealloc,/* tp_dealloc */
--- librpm-tizen-4.14.1.1.tizen20230628.orig/python/rpmmacro-py.c
+++ librpm-tizen-4.14.1.1.tizen20230628/python/rpmmacro-py.c
@@ -52,7 +52,7 @@
 	if (rpmExpandMacros(NULL, macro, &str, 0) < 0)
 	    PyErr_SetString(pyrpmError, "error expanding macro");
 	else
-	    res = Py_BuildValue("s", str);
+	    res = utf8FromString(str);
 	free(str);
     }
     return res;
--- librpm-tizen-4.14.1.1.tizen20230628.orig/python/rpmmi-py.c
+++ librpm-tizen-4.14.1.1.tizen20230628/python/rpmmi-py.c
@@ -201,7 +201,7 @@
 
 PyTypeObject rpmmi_Type = {
 	PyVarObject_HEAD_INIT(&PyType_Type, 0)
-	"rpm.mi",			/* tp_name */
+	PYTHON_MODULENAME".mi",		/* tp_name */
 	sizeof(rpmmiObject),		/* tp_size */
 	0,				/* tp_itemsize */
 	(destructor) rpmmi_dealloc, 	/* tp_dealloc */
--- librpm-tizen-4.14.1.1.tizen20230628.orig/python/rpmmodule.c
+++ librpm-tizen-4.14.1.1.tizen20230628/python/rpmmodule.c
@@ -6,6 +6,7 @@
 #include <rpm/rpmsq.h>
 #include <rpm/rpmlog.h>
 #include <rpm/rpmmacro.h>
+#include <rpm/rpmsign.h>
 
 #include "header-py.h"
 #include "rpmarchive-py.h"
@@ -22,6 +23,7 @@
 #include "rpmtd-py.h"
 #include "rpmte-py.h"
 #include "rpmts-py.h"
+#include "spec-py.h"
 
 /** \ingroup python
  * \name Module: rpm
@@ -156,6 +158,38 @@
     Py_RETURN_NONE;
 }
 
+static int parseSignArgs(PyObject * args, PyObject *kwds,
+			const char **path, struct rpmSignArgs *sargs)
+{
+    char * kwlist[] = { "path", "keyid", "hashalgo", NULL };
+
+    memset(sargs, 0, sizeof(*sargs));
+    return PyArg_ParseTupleAndKeywords(args, kwds, "s|si", kwlist,
+				    path, &sargs->keyid, &sargs->hashalgo);
+}
+
+static PyObject * addSign(PyObject * self, PyObject * args, PyObject *kwds)
+{
+    const char *path = NULL;
+    struct rpmSignArgs sargs;
+
+    if (!parseSignArgs(args, kwds, &path, &sargs))
+	return NULL;
+
+    return PyBool_FromLong(rpmPkgSign(path, &sargs) == 0);
+}
+
+static PyObject * delSign(PyObject * self, PyObject * args, PyObject *kwds)
+{
+    const char *path = NULL;
+    struct rpmSignArgs sargs;
+
+    if (!parseSignArgs(args, kwds, &path, &sargs))
+	return NULL;
+
+    return PyBool_FromLong(rpmPkgDelSign(path, &sargs) == 0);
+}
+
 static PyMethodDef rpmModuleMethods[] = {
     { "addMacro", (PyCFunction) rpmmacro_AddMacro, METH_VARARGS|METH_KEYWORDS,
       "rpmPushMacro(macro, value)\n"
@@ -215,6 +249,8 @@
       "once only at process startup because currently signal handlers will\n"
       "not be retroactively applied if a database is open."
     },
+    { "addSign", (PyCFunction) addSign, METH_VARARGS|METH_KEYWORDS, NULL },
+    { "delSign", (PyCFunction) delSign, METH_VARARGS|METH_KEYWORDS, NULL },
     { NULL }
 } ;
 
@@ -236,8 +272,8 @@
 	tagval = rpmTagGetValue(shortname);
 
 	PyModule_AddIntConstant(module, tagname, tagval);
-	pyval = PyInt_FromLong(tagval);
-	pyname = Py_BuildValue("s", shortname);
+	pyval = PyLong_FromLong(tagval);
+	pyname = utf8FromString(shortname);
 	PyDict_SetItem(dict, pyval, pyname);
 	Py_DECREF(pyval);
 	Py_DECREF(pyname);
@@ -269,6 +305,8 @@
 #endif
     if (PyType_Ready(&rpmte_Type) < 0) return 0;
     if (PyType_Ready(&rpmts_Type) < 0) return 0;
+    if (PyType_Ready(&spec_Type) < 0) return 0;
+    if (PyType_Ready(&specPkg_Type) < 0) return 0;
 
     return 1;
 }
@@ -388,6 +426,12 @@
     Py_INCREF(&rpmts_Type);
     PyModule_AddObject(m, "ts", (PyObject *) &rpmts_Type);
 
+    Py_INCREF(&spec_Type);
+    PyModule_AddObject(m, "spec", (PyObject *) &spec_Type);
+
+    Py_INCREF(&specPkg_Type);
+    PyModule_AddObject(m, "specPkg", (PyObject *) &specPkg_Type);
+
     addRpmTags(m);
 
     PyModule_AddStringConstant(m, "__version__", RPMVERSION);
@@ -596,6 +640,32 @@
     REGISTER_ENUM(RPMVERIFY_READFAIL);
     REGISTER_ENUM(RPMVERIFY_LSTATFAIL);
 
+    REGISTER_ENUM(RPMBUILD_ISSOURCE);
+    REGISTER_ENUM(RPMBUILD_ISPATCH);
+    REGISTER_ENUM(RPMBUILD_ISICON);
+    REGISTER_ENUM(RPMBUILD_ISNO);
+
+    REGISTER_ENUM(RPMBUILD_NONE);
+    REGISTER_ENUM(RPMBUILD_PREP);
+    REGISTER_ENUM(RPMBUILD_BUILD);
+    REGISTER_ENUM(RPMBUILD_INSTALL);
+    REGISTER_ENUM(RPMBUILD_CHECK);
+    REGISTER_ENUM(RPMBUILD_CLEAN);
+    REGISTER_ENUM(RPMBUILD_FILECHECK);
+    REGISTER_ENUM(RPMBUILD_PACKAGESOURCE);
+    REGISTER_ENUM(RPMBUILD_PACKAGEBINARY);
+    REGISTER_ENUM(RPMBUILD_RMSOURCE);
+    REGISTER_ENUM(RPMBUILD_RMBUILD);
+    REGISTER_ENUM(RPMBUILD_RMSPEC);
+
+    REGISTER_ENUM(RPMBUILD_PKG_NONE);
+    REGISTER_ENUM(RPMBUILD_PKG_NODIRTOKENS);
+
+    REGISTER_ENUM(RPMSPEC_NONE);
+    REGISTER_ENUM(RPMSPEC_ANYARCH);
+    REGISTER_ENUM(RPMSPEC_FORCE);
+    REGISTER_ENUM(RPMSPEC_NOLANG);
+
     return 1;
 }
 
--- librpm-tizen-4.14.1.1.tizen20230628.orig/python/rpmps-py.c
+++ librpm-tizen-4.14.1.1.tizen20230628/python/rpmps-py.c
@@ -18,12 +18,12 @@
 
 static PyObject *rpmprob_get_pkgnevr(rpmProblemObject *s, void *closure)
 {
-    return Py_BuildValue("s", rpmProblemGetPkgNEVR(s->prob));
+    return utf8FromString(rpmProblemGetPkgNEVR(s->prob));
 }
 
 static PyObject *rpmprob_get_altnevr(rpmProblemObject *s, void *closure)
 {
-    return Py_BuildValue("s", rpmProblemGetAltNEVR(s->prob));
+    return utf8FromString(rpmProblemGetAltNEVR(s->prob));
 }
 
 static PyObject *rpmprob_get_key(rpmProblemObject *s, void *closure)
@@ -38,7 +38,7 @@
 
 static PyObject *rpmprob_get_str(rpmProblemObject *s, void *closure)
 {
-    return Py_BuildValue("s", rpmProblemGetStr(s->prob));
+    return utf8FromString(rpmProblemGetStr(s->prob));
 }
 
 static PyObject *rpmprob_get_num(rpmProblemObject *s, void *closure)
@@ -59,7 +59,7 @@
 static PyObject *rpmprob_str(rpmProblemObject *s)
 {
     char *str = rpmProblemString(s->prob);
-    PyObject *res = Py_BuildValue("s", str);
+    PyObject *res = utf8FromString(str);
     free(str);
     return res;
 }
@@ -72,8 +72,8 @@
 
 PyTypeObject rpmProblem_Type = {
 	PyVarObject_HEAD_INIT(&PyType_Type, 0)
-	"rpm.prob",			/* tp_name */
-	sizeof(rpmProblemObject),		/* tp_basicsize */
+	PYTHON_MODULENAME".prob",	/* tp_name */
+	sizeof(rpmProblemObject),	/* tp_basicsize */
 	0,				/* tp_itemsize */
 	/* methods */
 	(destructor)rpmprob_dealloc,	/* tp_dealloc */
--- librpm-tizen-4.14.1.1.tizen20230628.orig/python/rpmstrpool-py.c
+++ librpm-tizen-4.14.1.1.tizen20230628/python/rpmstrpool-py.c
@@ -44,8 +44,8 @@
 	const char *str = rpmstrPoolStr(s->pool, id);
 
 	if (str)
-	    ret = PyBytes_FromString(str);
-	else 
+	    ret = utf8FromString(str);
+	else
 	    PyErr_SetObject(PyExc_KeyError, item);
     }
     return ret;
--- librpm-tizen-4.14.1.1.tizen20230628.orig/python/rpmsystem-py.h
+++ librpm-tizen-4.14.1.1.tizen20230628/python/rpmsystem-py.h
@@ -42,14 +42,11 @@
 #define CAPSULE_EXTRACT(obj,name) PyCObject_AsVoidPtr(obj)
 #endif
 
-/* For Python 3, use the PyLong type throughout in place of PyInt */
+/* In Python 3, we return all strings as surrogate-escaped utf-8 */
 #if PY_MAJOR_VERSION >= 3
-#define PyInt_Check PyLong_Check
-#define PyInt_AsLong PyLong_AsLong
-#define PyInt_FromLong PyLong_FromLong
-#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
-#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
-#define PyInt_AsSsize_t PyLong_AsSsize_t
+#define utf8FromString(_s) PyUnicode_DecodeUTF8(_s, strlen(_s), "surrogateescape")
+#else
+#define utf8FromString(_s) PyBytes_FromString(_s)
 #endif
 
 #endif	/* H_SYSTEM_PYTHON */
--- librpm-tizen-4.14.1.1.tizen20230628.orig/python/rpmtd-py.c
+++ librpm-tizen-4.14.1.1.tizen20230628/python/rpmtd-py.c
@@ -17,7 +17,7 @@
 
     switch (tclass) {
     case RPM_STRING_CLASS:
-	res = PyBytes_FromString(rpmtdGetString(td));
+	res = utf8FromString(rpmtdGetString(td));
 	break;
     case RPM_NUMERIC_CLASS:
 	res = PyLong_FromLongLong(rpmtdGetNumber(td));
--- librpm-tizen-4.14.1.1.tizen20230628.orig/python/rpmte-py.c
+++ librpm-tizen-4.14.1.1.tizen20230628/python/rpmte-py.c
@@ -56,49 +56,49 @@
 static PyObject *
 rpmte_N(rpmteObject * s, PyObject * unused)
 {
-    return Py_BuildValue("s", rpmteN(s->te));
+    return utf8FromString(rpmteN(s->te));
 }
 
 static PyObject *
 rpmte_E(rpmteObject * s, PyObject * unused)
 {
-    return Py_BuildValue("s", rpmteE(s->te));
+    return utf8FromString(rpmteE(s->te));
 }
 
 static PyObject *
 rpmte_V(rpmteObject * s, PyObject * unused)
 {
-    return Py_BuildValue("s", rpmteV(s->te));
+    return utf8FromString(rpmteV(s->te));
 }
 
 static PyObject *
 rpmte_R(rpmteObject * s, PyObject * unused)
 {
-    return Py_BuildValue("s", rpmteR(s->te));
+    return utf8FromString(rpmteR(s->te));
 }
 
 static PyObject *
 rpmte_A(rpmteObject * s, PyObject * unused)
 {
-    return Py_BuildValue("s", rpmteA(s->te));
+    return utf8FromString(rpmteA(s->te));
 }
 
 static PyObject *
 rpmte_O(rpmteObject * s, PyObject * unused)
 {
-    return Py_BuildValue("s", rpmteO(s->te));
+    return utf8FromString(rpmteO(s->te));
 }
 
 static PyObject *
 rpmte_NEVR(rpmteObject * s, PyObject * unused)
 {
-    return Py_BuildValue("s", rpmteNEVR(s->te));
+    return utf8FromString(rpmteNEVR(s->te));
 }
 
 static PyObject *
 rpmte_NEVRA(rpmteObject * s, PyObject * unused)
 {
-    return Py_BuildValue("s", rpmteNEVRA(s->te));
+    return utf8FromString(rpmteNEVRA(s->te));
 }
 
 static PyObject *
@@ -204,7 +204,7 @@
 }
 static struct PyMethodDef rpmte_methods[] = {
     {"Type",	(PyCFunction)rpmte_TEType,	METH_NOARGS,
-     "te.Type() -- Return element type (rpm.TR_ADDED | rpm.TR_REMOVED).\n" },
+     "te.Type() -- Return element type ("PYTHON_MODULENAME".TR_ADDED | "PYTHON_MODULENAME".TR_REMOVED).\n" },
     {"N",	(PyCFunction)rpmte_N,		METH_NOARGS,
      "te.N() -- Return element name.\n" },
     {"E",	(PyCFunction)rpmte_E,		METH_NOARGS,
@@ -257,7 +257,7 @@
 
 PyTypeObject rpmte_Type = {
 	PyVarObject_HEAD_INIT(&PyType_Type, 0)
-	"rpm.te",			/* tp_name */
+	PYTHON_MODULENAME".te",		/* tp_name */
 	sizeof(rpmteObject),		/* tp_size */
 	0,				/* tp_itemsize */
 	(destructor)0,		 	/* tp_dealloc */
--- librpm-tizen-4.14.1.1.tizen20230628.orig/python/rpmts-py.c
+++ librpm-tizen-4.14.1.1.tizen20230628/python/rpmts-py.c
@@ -230,16 +230,17 @@
 
     PyEval_RestoreThread(cbInfo->_save);
 
-    args = Py_BuildValue("(Oissi)", cbInfo->tso,
-		rpmdsTagN(ds), rpmdsN(ds), rpmdsEVR(ds), rpmdsFlags(ds));
-    result = PyEval_CallObject(cbInfo->cb, args);
+    args = Py_BuildValue("(OiNNi)", cbInfo->tso,
+		rpmdsTagN(ds), utf8FromString(rpmdsN(ds)),
+		utf8FromString(rpmdsEVR(ds)), rpmdsFlags(ds));
+    result = PyObject_Call(cbInfo->cb, args, NULL);
     Py_DECREF(args);
 
     if (!result) {
 	die(cbInfo->cb);
     } else {
-	if (PyInt_Check(result))
-	    res = PyInt_AsLong(result);
+	if (PyLong_Check(result))
+	    res = PyLong_AsLong(result);
 	Py_DECREF(result);
     }
 
@@ -409,7 +410,7 @@
     rpmrc = headerCheck(s->ts, uh, uc, &msg);
     Py_END_ALLOW_THREADS;
 
-    return Py_BuildValue("(is)", rpmrc, msg);
+    return Py_BuildValue("(iN)", rpmrc, utf8FromString(msg));
 }
 
 static PyObject *
@@ -459,7 +460,7 @@
     if (arg == Py_None || rpmKeyringFromPyObject(arg, &keyring)) {
 	return PyBool_FromLong(rpmtsSetKeyring(s->ts, keyring) == 0);
     } else {
-	PyErr_SetString(PyExc_TypeError, "rpm.keyring or None expected");
+	PyErr_SetString(PyExc_TypeError, PYTHON_MODULENAME".keyring or None expected");
 	return NULL;
     }
 }
@@ -498,7 +499,7 @@
     /* Synthesize a python object for callback (if necessary). */
     if (pkgObj == NULL) {
 	if (h) {
-	    pkgObj = Py_BuildValue("s", headerGetString(h, RPMTAG_NAME));
+	    pkgObj = utf8FromString(headerGetString(h, RPMTAG_NAME));
 	} else {
 	    pkgObj = Py_None;
 	    Py_INCREF(pkgObj);
@@ -509,7 +510,7 @@
     PyEval_RestoreThread(cbInfo->_save);
 
     args = Py_BuildValue("(iLLOO)", what, amount, total, pkgObj, cbInfo->data);
-    result = PyEval_CallObject(cbInfo->cb, args);
+    result = PyObject_Call(cbInfo->cb, args, NULL);
     Py_DECREF(args);
     Py_DECREF(pkgObj);
 
@@ -624,8 +625,8 @@
 	return NULL;
 
     if (Key) {
-	if (PyInt_Check(Key)) {
-	    lkey = PyInt_AsLong(Key);
+	if (PyLong_Check(Key)) {
+	    lkey = PyLong_AsLong(Key);
 	    key = (char *)&lkey;
 	    len = sizeof(lkey);
 	} else if (PyLong_Check(Key)) {
@@ -845,7 +846,7 @@
 
 static PyObject *rpmts_get_rootDir(rpmtsObject *s, void *closure)
 {
-    return Py_BuildValue("s", rpmtsRootDir(s->ts));
+    return utf8FromString(rpmtsRootDir(s->ts));
 }
 
 static int rpmts_set_scriptFd(rpmtsObject *s, PyObject *value, void *closure)
@@ -968,7 +969,7 @@
 
 PyTypeObject rpmts_Type = {
 	PyVarObject_HEAD_INIT(&PyType_Type, 0)
-	"rpm.ts",			/* tp_name */
+	PYTHON_MODULENAME".ts",		/* tp_name */
 	sizeof(rpmtsObject),		/* tp_size */
 	0,				/* tp_itemsize */
 	(destructor) rpmts_dealloc, 	/* tp_dealloc */
--- librpm-tizen-4.14.1.1.tizen20230628.orig/python/setup.py.in
+++ librpm-tizen-4.14.1.1.tizen20230628/python/setup.py.in
@@ -25,35 +25,18 @@
     os.environ['PKG_CONFIG_PATH'] = '..'
 
 
-rpmmod = Extension('rpm._rpm',
-                   sources = [  'header-py.c', 'rpmds-py.c', 'rpmfd-py.c',
-				'rpmfi-py.c', 'rpmii-py.c', 'rpmkeyring-py.c',
-                                'rpmmacro-py.c', 'rpmmi-py.c', 'rpmps-py.c',
-                                'rpmstrpool-py.c', 'rpmfiles-py.c', 
-				'rpmarchive-py.c', 'rpmtd-py.c',
-                                'rpmte-py.c', 'rpmts-py.c', 'rpmmodule.c',
-                             ],
+rpmmod = Extension('@PYTHON_MODULENAME@._rpm',
+                   sources = ['header-py.c', 'rpmds-py.c', 'rpmfd-py.c',
+                              'rpmfi-py.c', 'rpmii-py.c', 'rpmkeyring-py.c',
+                              'rpmmacro-py.c', 'rpmmi-py.c', 'rpmps-py.c',
+                              'rpmstrpool-py.c', 'rpmfiles-py.c',
+                              'rpmarchive-py.c', 'rpmtd-py.c',
+                              'rpmte-py.c', 'rpmts-py.c',
+                              'spec-py',
+                              'rpmmodule.c'],
                    include_dirs = pkgconfig('--cflags'),
                    library_dirs = pkgconfig('--libs-only-L'),
-                   libraries = pkgconfig('--libs-only-l'),
-                   extra_compile_args = cflags,
-                   extra_link_args = additional_link_args
-                  )
-
-rpmbuild_mod = Extension('rpm._rpmb',
-                   sources = ['rpmbmodule.c', 'spec-py.c'],
-                   include_dirs = pkgconfig('--cflags'),
-                   library_dirs = pkgconfig('--libs-only-L'),
-                   libraries = pkgconfig('--libs-only-l') + ['rpmbuild'],
-                   extra_compile_args = cflags,
-                   extra_link_args = additional_link_args
-                  )
-
-rpmsign_mod = Extension('rpm._rpms',
-                   sources = ['rpmsmodule.c'],
-                   include_dirs = pkgconfig('--cflags'),
-                   library_dirs = pkgconfig('--libs-only-L'),
-                   libraries = pkgconfig('--libs-only-l') + ['rpmsign'],
+                   libraries = pkgconfig('--libs-only-l') + ['rpmbuild', 'rpmsign'],
                    extra_compile_args = cflags,
                    extra_link_args = additional_link_args
                   )
@@ -63,6 +46,6 @@
       description='Python bindings for @PACKAGE_NAME@',
       maintainer_email='@PACKAGE_BUGREPORT@',
       url='http://www.rpm.org/',
-      packages = ['@PACKAGE_NAME@'],
-      ext_modules= [rpmmod, rpmbuild_mod, rpmsign_mod]
+      packages=['@PACKAGE_NAME@'],
+      ext_modules=[rpmmod]
      )
--- librpm-tizen-4.14.1.1.tizen20230628.orig/python/spec-py.c
+++ librpm-tizen-4.14.1.1.tizen20230628/python/spec-py.c
@@ -31,10 +31,10 @@
 /* Header objects are in another module, some hoop jumping required... */
 static PyObject *makeHeader(Header h)
 {
-    PyObject *rpmmod = PyImport_ImportModuleNoBlock("rpm");
+    PyObject *rpmmod = PyImport_ImportModuleNoBlock(PYTHON_MODULENAME);
     if (rpmmod == NULL) return NULL;
 
-    PyObject *ptr = CAPSULE_BUILD(h, "rpm._C_Header");
+    PyObject *ptr = CAPSULE_BUILD(h, PYTHON_MODULENAME"._C_Header");
     PyObject *hdr = PyObject_CallMethod(rpmmod, "hdr", "(O)", ptr);
     Py_XDECREF(ptr);
     Py_XDECREF(rpmmod);
@@ -57,7 +57,7 @@
 {
     char *sect = rpmSpecPkgGetSection(pkg, section);
     if (sect != NULL) {
-        PyObject *ps = PyBytes_FromString(sect);
+        PyObject *ps = utf8FromString(sect);
         free(sect);
         if (ps != NULL)
             return ps;
@@ -98,7 +98,7 @@
 
 PyTypeObject specPkg_Type = {
 	PyVarObject_HEAD_INIT(&PyType_Type, 0)
-	"rpm.specpkg",			/* tp_name */
+	PYTHON_MODULENAME".specpkg",	/* tp_name */
 	sizeof(specPkgObject),		/* tp_size */
 	0,				/* tp_itemsize */
 	(destructor) specPkg_dealloc, 	/* tp_dealloc */
@@ -158,7 +158,7 @@
 {
     const char *sect = rpmSpecGetSection(spec, section);
     if (sect) {
-	return Py_BuildValue("s", sect);
+	return utf8FromString(sect);
     }
     Py_RETURN_NONE;
 }
@@ -208,8 +208,8 @@
 
     rpmSpecSrcIter iter = rpmSpecSrcIterInit(s->spec);
     while ((source = rpmSpecSrcIterNext(iter)) != NULL) {
-	PyObject *srcUrl = Py_BuildValue("(sii)",
-				rpmSpecSrcFilename(source, 1),
+	PyObject *srcUrl = Py_BuildValue("(Nii)",
+				utf8FromString(rpmSpecSrcFilename(source, 1)),
 				rpmSpecSrcNum(source),
 				rpmSpecSrcFlags(source)); 
         if (!srcUrl) {
@@ -312,7 +312,7 @@
 
 PyTypeObject spec_Type = {
     PyVarObject_HEAD_INIT(&PyType_Type, 0)
-    "rpm.spec",               /*tp_name*/
+    PYTHON_MODULENAME".spec",  /*tp_name*/
     sizeof(specObject),        /*tp_basicsize*/
     0,                         /*tp_itemsize*/
     (destructor) spec_dealloc, /*tp_dealloc*/
--- librpm-tizen-4.14.1.1.tizen20230628.orig/rpm.am
+++ librpm-tizen-4.14.1.1.tizen20230628/rpm.am
@@ -6,4 +6,4 @@
 rpmconfigdir = @RPMCONFIGDIR@
 
 # Libtool version (current-revision-age) for all our libraries
-rpm_version_info = 4:0:1
\ No newline at end of file
+rpm_version_info = 4:0:1
--- librpm-tizen-4.14.1.1.tizen20230628.orig/rpmio/macro.c
+++ librpm-tizen-4.14.1.1.tizen20230628/rpmio/macro.c
@@ -421,6 +421,10 @@
     FILE *shf;
     int c;
 
+#ifdef WITH_LUA
+    rpmlog(RPMLOG_WARNING, _("Refusing to run shell code: %s\n"), cmd);
+    mbAppendStr(mb, "UNEXPANDEDSHELLSCRIPT");
+#else
     if (expandThis(mb, cmd, clen, &buf))
 	goto exit;
 
@@ -443,6 +447,7 @@
 
 exit:
     _free(buf);
+#endif
 }
 
 /**
@@ -1221,7 +1226,7 @@
 	    int loglevel = RPMLOG_NOTICE; /* assume echo */
 	    if (STREQ("error", f, fn)) {
 		loglevel = RPMLOG_ERR;
-		mb->error = 1;
+		mb->error = 0;
 	    } else if (STREQ("warn", f, fn)) {
 		loglevel = RPMLOG_WARNING;
 	    }
