--- /dev/null
+python/rpmmodules.c: Change the way the python module loads the RPM config
+
+In order to support the RPM_VENDOR_WINDRIVER enhancement of dynamic
+runtime relocation paths, we need to call rpmcliInit instead of 
+rpmReadConfigFiles.  The rpmcliInit will end up calling rpmReadConfigFiles
+after the necessary relocation processing (if enabled).
+
+Code derived from changes suggested by Paul Eggleton.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff --git a/python/rpmmodule.c b/python/rpmmodule.c
+index f7282bc..dde68ca 100644
+--- a/python/rpmmodule.c
++++ b/python/rpmmodule.c
+@@ -392,7 +392,8 @@ void init_rpm(void)
+     if (Py_AtExit(rpm_exithook) == -1)
+       return;
+ 
+-    rpmReadConfigFiles(NULL, NULL);
++    const char *argv[1] = {"rpmmodule", 0};
++    rpmcliInit(1, argv, NULL);
+ 
+     d = PyModule_GetDict(m);
+ 
 
 LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1"
 
 DEPENDS = "libpcre attr acl popt ossp-uuid file bison-native"
-PR = "r52"
+PR = "r53"
 
 # rpm2cpio is a shell script, which is part of the rpm src.rpm.  It is needed
 # in order to extract the distribution SRPM into a format we can extract...
           file://makefile-am-exec-hook.patch \
           file://rpm-stub-out-git_strerror.patch \
           file://rpm-db_buffer_small.patch \
+          file://rpm-py-init.patch \
          "
 
 SRC_URI[md5sum] = "60d56ace884340c1b3fcac6a1d58e768"
 
 WITH_PYTHON = " --with-python=${PYTHON_BASEVERSION} \
                --with-python-inc-dir=${STAGING_INCDIR}/python${PYTHON_BASEVERSION} \
-               --with-python-lib-dir=${libdir}/python${PYTHON_BASEVERSION} \
+               --with-python-lib-dir=${libdir}/python${PYTHON_BASEVERSION}/site-packages \
                --without-pythonembed"
 PACKAGECONFIG[python] = "${WITH_PYTHON},--without-python,python,"
 
 
 LDFLAGS_append_libc-uclibc = "-lrt -lpthread"
 
-PACKAGES = "${PN}-dbg ${PN} ${PN}-doc ${PN}-libs ${PN}-dev ${PN}-staticdev ${PN}-common ${PN}-build python-rpm-dbg python-rpm-staticdev python-rpm perl-module-rpm perl-module-rpm-dev ${PN}-locale"
+PACKAGES = "${PN}-dbg ${PN} ${PN}-doc ${PN}-libs ${PN}-dev ${PN}-staticdev ${PN}-common ${PN}-build python-rpm-dbg python-rpm-staticdev python-rpm-dev python-rpm perl-module-rpm perl-module-rpm-dev ${PN}-locale"
 
 SOLIBS = "5.4.so"
 
 RDEPENDS_${PN}_class-native = ""
 RDEPENDS_${PN}-build = "file"
 
-FILES_python-rpm-dbg = "${libdir}/python*/rpm/.debug/_*"
-FILES_python-rpm-staticdev = "${libdir}/python*/rpm/*.a"
-FILES_python-rpm = "${libdir}/python*/rpm"
+RDEPENDS_python-rpm = "${PN}"
+
+FILES_python-rpm-dbg = "${libdir}/python*/site-packages/rpm/.debug/_*"
+FILES_python-rpm-dev = "${libdir}/python*/site-packages/rpm/*.la"
+FILES_python-rpm-staticdev = "${libdir}/python*/site-packages/rpm/*.a"
+FILES_python-rpm = "${libdir}/python*/site-packages/rpm"
 
 FILES_perl-module-rpm = "${libdir}/perl/*/* \
                "