Skip to contentSkip to conversation

Add rpm4 recipe and enable smartpm for rpm4

PATCH New Saul Wold 1 participant 6 messages Sep 30, 2014

lore
Share & tools
lore

Saul Wold

author
#0 lore raw

cover Add rpm4 recipe and enable smartpm for rpm4

This patch series is the last bit to enable rpm4 base code. To use this version you must set Preferred Version as such:

EFERRED_VERSION_rpm = "4.11.2"
PREFERRED_VERSION_rpm-native = "4.11.2"

The rootfs_rpm is a Work In Progress and I expect will not be accepted.

Sau!

The following changes since commit bff185f6252751a97dcdf7ddfe86b808a714fdc5:

dev-manual: Added a note to the EXTERNALSRC example about the class (2014-09-22 13:04:44 +0100)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib sgw/rpm4
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=sgw/rpm4

Saul Wold (5):
nss: nss.pc is not target specific
rpm5: add python-rpm PROVIDES
python-smartpm: Add patches for rpm4
rpm: add version 4.11.2
rootfs_rpm: remove hard depends on rpmresolve - WIP

 meta/classes/rootfs_rpm.bbclass                    |   1 -
 .../python/python-smartpm/smart-dflags.patch       |  53 +--
 .../python/python-smartpm/smart-rpm4-fixes.patch   |  49 +++
 .../python/python-smartpm_1.4.1.bb                 |   5 +-
 .../add_RPMSENSE_MISSINGOK_to_rpmmodule.patch      |  20 ++
 .../rpm/rpm-4.11.2/disable_shortcircuited.patch    |  23 ++
 .../rpm/rpm-4.11.2/fix_libdir.patch                |  19 +
 meta/recipes-devtools/rpm/rpm-4.11.2/pythondeps.sh |  16 +
 .../rpm/rpm-4.11.2/remove-db3-from-configure.patch |  26 ++
 .../rpm/rpm-4.11.2/remove-dir-check.patch          |  23 ++
 .../rpm/rpm-4.11.2/rpm-scriptetexechelp.patch      | 194 +++++++++++
 .../rpm/rpm-4.11.2/support-suggests-tag.patch      | 384 +++++++++++++++++++++
 .../rpm/rpm-4.11.2/use-pkgconfig-for-python.patch  |  38 ++
 meta/recipes-devtools/rpm/rpm_4.11.2.bb            | 133 +++++++
 meta/recipes-devtools/rpm/rpm_5.4.14.bb            |   1 +
 meta/recipes-support/nss/nss.inc                   |   6 +-
 16 files changed, 962 insertions(+), 29 deletions(-)
 create mode 100644 meta/recipes-devtools/python/python-smartpm/smart-rpm4-fixes.patch
 create mode 100644 meta/recipes-devtools/rpm/rpm-4.11.2/add_RPMSENSE_MISSINGOK_to_rpmmodule.patch
 create mode 100644 meta/recipes-devtools/rpm/rpm-4.11.2/disable_shortcircuited.patch
 create mode 100644 meta/recipes-devtools/rpm/rpm-4.11.2/fix_libdir.patch
 create mode 100755 meta/recipes-devtools/rpm/rpm-4.11.2/pythondeps.sh
 create mode 100644 meta/recipes-devtools/rpm/rpm-4.11.2/remove-db3-from-configure.patch
 create mode 100644 meta/recipes-devtools/rpm/rpm-4.11.2/remove-dir-check.patch
 create mode 100644 meta/recipes-devtools/rpm/rpm-4.11.2/rpm-scriptetexechelp.patch
 create mode 100644 meta/recipes-devtools/rpm/rpm-4.11.2/support-suggests-tag.patch
 create mode 100644 meta/recipes-devtools/rpm/rpm-4.11.2/use-pkgconfig-for-python.patch
 create mode 100644 meta/recipes-devtools/rpm/rpm_4.11.2.bb
Signature · 1 line
1.8.3.1
author
#1 lore raw

PATCH 1/5 nss: nss.pc is not target specific

RPM4 requires an nss-native component

---
 meta/recipes-support/nss/nss.inc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
meta/recipes-support/nss/nss.inc +4 -2
index d706c43..716245d 100644
@@ -24,7 +24,7 @@ SRC_URI = "\
     file://nss-CVE-2013-5606.patch \
     file://nss-CVE-2014-1544.patch \
 "
-SRC_URI_append_class-target = "\
+SRC_URI_append = "\
     file://nss.pc.in \
     file://signlibs.sh \
 "
@@ -153,7 +153,7 @@ do_install() {
     done
 }
 
-do_install_append_class-target() {
+do_install_append() {
     # Create empty .chk files for the NSS libraries at build time. They could
     # be regenerated at target's boot time.
     for file in libsoftokn3.chk libfreebl3.chk libnssdbm3.chk; do
@@ -168,7 +168,9 @@ do_install_append_class-target() {
     sed -i s:OEEXECPREFIX:${exec_prefix}:g ${D}${libdir}/pkgconfig/nss.pc
     sed -i s:OELIBDIR:${libdir}:g ${D}${libdir}/pkgconfig/nss.pc
     sed -i s:OEINCDIR:${includedir}/nss3:g ${D}${libdir}/pkgconfig/nss.pc
+}
 
+do_install_append_class-target() {
     # Create a blank certificate
     mkdir -p ${D}${sysconfdir}/pki/nssdb/
     touch ./empty_password
Signature · 1 line
1.8.3.1
author
#2 lore raw

PATCH 2/5 rpm5: add python-rpm PROVIDES

In reply to Saul Wold

Since python-smartpm depends on python-rpm, we should provide here as appropriate.

---
 meta/recipes-devtools/rpm/rpm_5.4.14.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-devtools/rpm/rpm_5.4.14.bb +1 -0
index 0c9ef5b..fb8a507 100644
@@ -342,6 +342,7 @@ 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"
+PROVIDES += "python-rpm"
 
 FILES_perl-module-rpm = "${libdir}/perl/*/* \
 		"
Signature · 1 line
1.8.3.1
author
#3 lore raw

PATCH 3/5 python-smartpm: Add patches for rpm4

In reply to Saul Wold

Add DEPENDS for python-rpm package from either rpm4 or rpm5

Extend the smart-dflags patch to catch an exception if the api does exist

---
 .../python/python-smartpm/smart-dflags.patch       | 53 ++++++++++++----------
 .../python/python-smartpm/smart-rpm4-fixes.patch   | 49 ++++++++++++++++++++
 .../python/python-smartpm_1.4.1.bb                 |  5 +-
 3 files changed, 81 insertions(+), 26 deletions(-)
 create mode 100644 meta/recipes-devtools/python/python-smartpm/smart-rpm4-fixes.patch
meta/recipes-devtools/python/python-smartpm/smart-dflags.patch +29 -24
index 3f27262..531ea51 100644
@@ -7,34 +7,39 @@ Upstream-Status: Pending
 
 Signed-off-by: Paul Eggleton <[email protected]>
 
-diff --git a/smart/backends/rpm/pm.py b/smart/backends/rpm/pm.py
-index 707a146..aec82e7 100644
---- a/smart/backends/rpm/pm.py
-+++ b/smart/backends/rpm/pm.py
-@@ -106,6 +106,23 @@ class RPMPackageManager(PackageManager):
+[sgw - Added try/catch for rpm4 since it does not have setDFlags() API]
+
+Signed-off-by: Saul Wold <[email protected]>
+
+
+Index: smart-1.4.1/smart/backends/rpm/pm.py
+===================================================================
+--- smart-1.4.1.orig/smart/backends/rpm/pm.py
++++ smart-1.4.1/smart/backends/rpm/pm.py
+@@ -106,6 +106,26 @@ class RPMPackageManager(PackageManager):
              flags |= rpm.RPMTRANS_FLAG_TEST
          ts.setFlags(flags)
  
-+        dflags = ts.setDFlags(0)
-+        if sysconf.get("rpm-noupgrade", False):
-+            dflags |= rpm.RPMDEPS_FLAG_NOUPGRADE
-+        if sysconf.get("rpm-norequires", False):
-+            dflags |= rpm.RPMDEPS_FLAG_NOREQUIRES
-+        if sysconf.get("rpm-noconflicts", False):
-+            dflags |= rpm.RPMDEPS_FLAG_NOCONFLICTS
-+        if sysconf.get("rpm-noobsoletes", False):
-+            dflags |= rpm.RPMDEPS_FLAG_NOOBSOLETES
-+        if sysconf.get("rpm-noparentdirs", False):
-+            dflags |= rpm.RPMDEPS_FLAG_NOPARENTDIRS
-+        if sysconf.get("rpm-nolinktos", False):
-+            dflags |= rpm.RPMDEPS_FLAG_NOLINKTOS
-+        if sysconf.get("rpm-nosuggest", False):
-+            dflags |= rpm.RPMDEPS_FLAG_NOSUGGEST
-+        ts.setDFlags(dflags)
++        try:
++            dflags = ts.setDFlags(0)
++            if sysconf.get("rpm-noupgrade", False):
++                dflags |= rpm.RPMDEPS_FLAG_NOUPGRADE
++            if sysconf.get("rpm-norequires", False):
++                dflags |= rpm.RPMDEPS_FLAG_NOREQUIRES
++            if sysconf.get("rpm-noconflicts", False):
++                dflags |= rpm.RPMDEPS_FLAG_NOCONFLICTS
++            if sysconf.get("rpm-noobsoletes", False):
++                dflags |= rpm.RPMDEPS_FLAG_NOOBSOLETES
++            if sysconf.get("rpm-noparentdirs", False):
++                dflags |= rpm.RPMDEPS_FLAG_NOPARENTDIRS
++            if sysconf.get("rpm-nolinktos", False):
++                dflags |= rpm.RPMDEPS_FLAG_NOLINKTOS
++            if sysconf.get("rpm-nosuggest", False):
++                dflags |= rpm.RPMDEPS_FLAG_NOSUGGEST
++            ts.setDFlags(dflags)
++        except AttributeError, ae:
++            pass
 +
          # Set rpm verbosity level.
          levelname = sysconf.get('rpm-log-level')
          level = {
--- 
-1.7.9.5
-
meta/recipes-devtools/python/python-smartpm/smart-rpm4-fixes.patch new file +49 -0

49 lines not on this page · raw message

meta/recipes-devtools/python/python-smartpm_1.4.1.bb +3 -2
index 0971579..f2eb33d 100644
@@ -8,7 +8,7 @@ SECTION = "devel/python"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=393a5ca445f6965873eca0259a17f833"
 
-DEPENDS = "python rpm gettext-native"
+DEPENDS = "python rpm gettext-native python-rpm"
 PR = "r9"
 SRCNAME = "smart"
 
@@ -32,7 +32,8 @@ SRC_URI = "\
           file://smart-config-ignore-all-recommends.patch \
           file://smart-attempt.patch \
           file://smart-filename-NAME_MAX.patch \
-          "
+          file://smart-rpm4-fixes.patch \
+         "
 
 SRC_URI[md5sum] = "573ef32ba177a6b3c4bf7ef04873fcb6"
 SRC_URI[sha256sum] = "b1d519ddb43d60f293b065c28870a5d9e8b591cd49e8c68caea48ace91085eba"
Signature · 1 line
1.8.3.1
author
#4 lore raw

PATCH 4/5 rpm: add version 4.11.2

In reply to Saul Wold

add patch to remove db3 from configure.ac
add inherit pkgconfig

---
 .../add_RPMSENSE_MISSINGOK_to_rpmmodule.patch      |  20 ++
 .../rpm/rpm-4.11.2/disable_shortcircuited.patch    |  23 ++
 .../rpm/rpm-4.11.2/fix_libdir.patch                |  19 +
 meta/recipes-devtools/rpm/rpm-4.11.2/pythondeps.sh |  16 +
 .../rpm/rpm-4.11.2/remove-db3-from-configure.patch |  26 ++
 .../rpm/rpm-4.11.2/remove-dir-check.patch          |  23 ++
 .../rpm/rpm-4.11.2/rpm-scriptetexechelp.patch      | 194 +++++++++++
 .../rpm/rpm-4.11.2/support-suggests-tag.patch      | 384 +++++++++++++++++++++
 .../rpm/rpm-4.11.2/use-pkgconfig-for-python.patch  |  38 ++
 meta/recipes-devtools/rpm/rpm_4.11.2.bb            | 133 +++++++
 10 files changed, 876 insertions(+)
 create mode 100644 meta/recipes-devtools/rpm/rpm-4.11.2/add_RPMSENSE_MISSINGOK_to_rpmmodule.patch
 create mode 100644 meta/recipes-devtools/rpm/rpm-4.11.2/disable_shortcircuited.patch
 create mode 100644 meta/recipes-devtools/rpm/rpm-4.11.2/fix_libdir.patch
 create mode 100755 meta/recipes-devtools/rpm/rpm-4.11.2/pythondeps.sh
 create mode 100644 meta/recipes-devtools/rpm/rpm-4.11.2/remove-db3-from-configure.patch
 create mode 100644 meta/recipes-devtools/rpm/rpm-4.11.2/remove-dir-check.patch
 create mode 100644 meta/recipes-devtools/rpm/rpm-4.11.2/rpm-scriptetexechelp.patch
 create mode 100644 meta/recipes-devtools/rpm/rpm-4.11.2/support-suggests-tag.patch
 create mode 100644 meta/recipes-devtools/rpm/rpm-4.11.2/use-pkgconfig-for-python.patch
 create mode 100644 meta/recipes-devtools/rpm/rpm_4.11.2.bb
meta/recipes-devtools/rpm/rpm-4.11.2/add_RPMSENSE_MISSINGOK_to_rpmmodule.patch new file +20 -0
new file mode 100644
index 0000000..b877870
@@ -0,0 +1,20 @@
+Upstream-Status: Inappropriate [OE-Specific]
+
+Signed-off-by: Saul Wold <[email protected]>
+Signed-off-by: Ronan Le Martret <[email protected]> 
+
+diff --git a/python/rpmmodule.c b/python/rpmmodule.c
+index a4fe217..728c66c 100644
+--- a/python/rpmmodule.c
++++ b/python/rpmmodule.c
+@@ -396,6 +396,10 @@ static int initModule(PyObject *m)
+     REGISTER_ENUM(RPMSENSE_STRONG);
+     REGISTER_ENUM(RPMSENSE_CONFIG);
+ 
++#if defined(RPM_VENDOR_OE)
++    REGISTER_ENUM(RPMSENSE_MISSINGOK);
++#endif
++
+     REGISTER_ENUM(RPMTRANS_FLAG_TEST);
+     REGISTER_ENUM(RPMTRANS_FLAG_BUILD_PROBS);
+     REGISTER_ENUM(RPMTRANS_FLAG_NOSCRIPTS);
meta/recipes-devtools/rpm/rpm-4.11.2/disable_shortcircuited.patch new file +23 -0
new file mode 100644
index 0000000..7a646de
@@ -0,0 +1,23 @@
+Upstream-Status: Pending
+
+Signed-off-by: Saul Wold <[email protected]>
+Signed-off-by: Ronan Le Martret <[email protected]>
+
+
+Index: rpm-4.11.2/build/pack.c
+===================================================================
+--- rpm-4.11.2.orig/build/pack.c
++++ rpm-4.11.2/build/pack.c
+@@ -571,9 +571,9 @@ rpmRC packageBinaries(rpmSpec spec, cons
+ 	    headerPutBin(pkg->header, RPMTAG_SOURCEPKGID, spec->sourcePkgId,16);
+ 	}
+ 
+-	if (cheating) {
+-	    (void) rpmlibNeedsFeature(pkg, "ShortCircuited", "4.9.0-1");
+-	}
++//	if (cheating) {
++//	    (void) rpmlibNeedsFeature(pkg, "ShortCircuited", "4.9.0-1");
++//	}
+ 	
+ 	{   char *binFormat = rpmGetPath("%{_rpmfilename}", NULL);
+ 	    char *binRpm, *binDir;
meta/recipes-devtools/rpm/rpm-4.11.2/fix_libdir.patch new file +19 -0
new file mode 100644
index 0000000..be0626c
@@ -0,0 +1,19 @@
+Upstream-Status: Inappropriate [OE-Core specific]
+
+Signed-off-by: Saul Wold <[email protected]>
+Signed-off-by: Ronan Le Martret <[email protected]>
+
+
+diff --git a/installplatform b/installplatform
+index 8c3eba0..fa15e91 100755
+--- a/installplatform
++++ b/installplatform
+@@ -112,7 +112,7 @@ for ARCH in noarch `grep ^arch_canon $RPMRC | cut -d: -f2`; do
+   [ -z "$CANONARCH" ] && continue
+ 
+   if [ "$OS" = "linux" ] && [ "$CANONCOLOR" = 3 ]; then
+-      LIB=${LIB}64
++      LIB=${LIB}
+   fi
+ 
+   PPD="${DESTDIR}/${platformdir}/${ARCH}-${OS}"
meta/recipes-devtools/rpm/rpm-4.11.2/pythondeps.sh new file +16 -0
new file mode 100755
index 0000000..083b174
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+[ $# -ge 1 ] || {
+    cat > /dev/null
+    exit 0
+}
+
+case $1 in
+-R|--requires)
+    shift
+    grep "/usr/\(lib[^/]*\|share\)/python[^/]*/" >/dev/null && echo "python"
+    exit 0
+    ;;
+esac
+
+exit 0
meta/recipes-devtools/rpm/rpm-4.11.2/remove-db3-from-configure.patch new file +26 -0
new file mode 100644
index 0000000..2640e54
@@ -0,0 +1,26 @@
+
+Disable configuring the db3 directory since we will be using the
+external DB provided as part of OE-Core already, no need to have
+duplicate database code.
+
+Upstream-Status: Inappropriate [OE-Core Specific]
+
+Signed-off-by: Saul Wold <[email protected]>
+
+Index: rpm-4.11.2/configure.ac
+===================================================================
+--- rpm-4.11.2.orig/configure.ac
++++ rpm-4.11.2/configure.ac
+@@ -825,9 +825,9 @@ AC_SUBST(RPMCONFIGDIR)
+ 
+ AC_SUBST(OBJDUMP)
+ 
+-if test "$with_external_db" = no; then
+-    AC_CONFIG_SUBDIRS(db3)
+-fi
++#if test "$with_external_db" = no; then
++#    AC_CONFIG_SUBDIRS(db3)
++#fi
+ 
+ AM_CONDITIONAL([WITH_INTERNAL_DB],[test "$with_external_db" = no])
+ AM_CONDITIONAL([DOXYGEN],[test "$DOXYGEN" != no])
meta/recipes-devtools/rpm/rpm-4.11.2/remove-dir-check.patch new file +23 -0
new file mode 100644
index 0000000..f1ecab7
@@ -0,0 +1,23 @@
+Upstream-Status: Pending
+
+Signed-off-by: Saul Wold <[email protected]>
+Signed-off-by: Ronan Le Martret <[email protected]>
+
+
+Index: rpm-4.11.2/build/files.c
+===================================================================
+--- rpm-4.11.2.orig/build/files.c
++++ rpm-4.11.2/build/files.c
+@@ -1321,12 +1321,6 @@ static rpmRC addFile(FileList fl, const
+ 	}
+     }
+ 
+-    /* Error out when a non-directory is specified as one in spec */
+-    if (fl->cur.isDir && (statp == &statbuf) && !S_ISDIR(statp->st_mode)) {
+-	rpmlog(RPMLOG_ERR, _("Not a directory: %s\n"), diskPath);
+-	goto exit;
+-    }
+-
+     /* Don't recurse into explicit %dir, don't double-recurse from fts */
+     if ((fl->cur.isDir != 1) && (statp == &statbuf) && S_ISDIR(statp->st_mode)) {
+ 	return recurseDir(fl, diskPath);
meta/recipes-devtools/rpm/rpm-4.11.2/rpm-scriptetexechelp.patch new file +194 -0

194 lines not on this page · raw message

meta/recipes-devtools/rpm/rpm-4.11.2/support-suggests-tag.patch new file +384 -0

384 lines not on this page · raw message

meta/recipes-devtools/rpm/rpm-4.11.2/use-pkgconfig-for-python.patch new file +38 -0
new file mode 100644
index 0000000..8d84cf8
@@ -0,0 +1,38 @@
+
+Use pkgconfig to get the correct include paths
+
+Upstream-Status: Pending
+
+Signed-off-by: Saul Wold <[email protected]>
+Signed-off-by: Ronan Le Martret <[email protected]>
+
+diff --git a/configure.ac b/configure.ac
+index e97f727..8179f44 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -540,10 +540,10 @@ esac],
+ 
+ AS_IF([test "$enable_python" = yes],[
+   AM_PATH_PYTHON([2.6],[
+-    WITH_PYTHON_INCLUDE=`${PYTHON} -c 'from distutils.sysconfig import *; import sys; sys.stdout.write(get_python_inc())'`
++    WITH_PYTHON_INCLUDE=$(${PKG_CONFIG} --cflags-only-I  python)
+     WITH_PYTHON_SUBPACKAGE=1
+     save_CPPFLAGS="$CPPFLAGS"
+-    CPPFLAGS="$CPPFLAGS -I$WITH_PYTHON_INCLUDE"
++    CPPFLAGS="$CPPFLAGS $WITH_PYTHON_INCLUDE"
+     AC_CHECK_HEADER([Python.h],[],
+       [AC_MSG_ERROR([missing Python.h])
+       ])
+diff --git a/python/Makefile.am b/python/Makefile.am
+index fff51ae..f37cb9d 100644
+--- a/python/Makefile.am
++++ b/python/Makefile.am
+@@ -4,7 +4,7 @@ EXTRA_DIST = rpm/__init__.py rpm/transaction.py
+ 
+ AM_CPPFLAGS = -I$(top_builddir)/include/
+ AM_CPPFLAGS += -I$(top_srcdir)/python
+-AM_CPPFLAGS += -I@WITH_PYTHON_INCLUDE@
++AM_CPPFLAGS += @WITH_PYTHON_INCLUDE@
+ 
+ pkgpyexec_LTLIBRARIES = _rpmmodule.la _rpmbmodule.la _rpmsmodule.la
+ pkgpyexec_DATA = rpm/__init__.py rpm/transaction.py
meta/recipes-devtools/rpm/rpm_4.11.2.bb new file +133 -0

133 lines not on this page · raw message

Signature · 1 line
1.8.3.1
author
#5 lore raw

PATCH 5/5 rootfs_rpm: remove hard depends on rpmresolve - WIP

In reply to Saul Wold
---
 meta/classes/rootfs_rpm.bbclass | 1 -
 1 file changed, 1 deletion(-)
meta/classes/rootfs_rpm.bbclass +0 -1
index d85d001..ac17139 100644
@@ -13,7 +13,6 @@ EXTRANATIVEPATH += "python-native"
 
 # opkg is needed for update-alternatives
 RPMROOTFSDEPENDS = "rpm-native:do_populate_sysroot \
-    rpmresolve-native:do_populate_sysroot \
     python-smartpm-native:do_populate_sysroot \
     createrepo-native:do_populate_sysroot \
     opkg-native:do_populate_sysroot"
Signature · 1 line
1.8.3.1