]> code.ossystems Code Review - openembedded-core.git/commitdiff
rpm: Update the rpm integration to support per-file dependencies
authorMark Hatle <mhatle@windriver.com>
Fri, 20 Aug 2010 15:32:08 +0000 (08:32 -0700)
committerRichard Purdie <rpurdie@linux.intel.com>
Fri, 20 Aug 2010 22:39:31 +0000 (23:39 +0100)
Update the RPM package integration to support per-file dependencies

This adds additional configuration options to RPM, as well as provides
a helper script "perfile_rpmdeps.sh" that the build system can use to
gather the dependency information.

Signed-off-by: Mark Hatle <mhatle@windriver.com>
meta/packages/rpm/rpm/no_parentdir_ordering.patch [new file with mode: 0644]
meta/packages/rpm/rpm/perfile_rpmdeps.sh [new file with mode: 0755]
meta/packages/rpm/rpm_5.1.9.bb

diff --git a/meta/packages/rpm/rpm/no_parentdir_ordering.patch b/meta/packages/rpm/rpm/no_parentdir_ordering.patch
new file mode 100644 (file)
index 0000000..2ceb020
--- /dev/null
@@ -0,0 +1,11 @@
+--- rpm-5.1.9/lib/depends.c.orig       2009-04-12 12:46:17.000000000 -0700
++++ rpm-5.1.9/lib/depends.c    2010-08-14 11:28:11.000000000 -0700
+@@ -2257,7 +2257,7 @@
+ #define isAuto(_x)    ((_x) & _autobits)
+ /*@unchecked@*/
+-static int slashDepth = 100;  /* #slashes pemitted in parentdir deps. */
++static int slashDepth = 0;    /* #slashes pemitted in parentdir deps. */
+ static int countSlashes(const char * dn)
+       /*@*/
diff --git a/meta/packages/rpm/rpm/perfile_rpmdeps.sh b/meta/packages/rpm/rpm/perfile_rpmdeps.sh
new file mode 100755 (executable)
index 0000000..b72c9f0
--- /dev/null
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+: ${RPMDEPS:=rpmdeps}
+
+process() {
+       while read file_name ; do
+               printf "%s\t" ${file_name}
+               if [ ! -d $file_name ]; then
+                       printf "%s " $($RPMDEPS $1 $file_name | sed -e 's,rpmlib(.*,,' -e 's,\([<>\=]\+ \+[^ ]*\),(\1),g')
+               fi
+               printf "\n"
+       done
+}
+
+usage() {
+       echo "$0 {-P|--provides} {-R|--requires} FILE ..."
+}
+
+while [ $# -gt 0 ]; do
+   case "$1" in
+       --rpmdeps)
+               RPMDEPS=$2
+               shift
+               shift
+               ;;
+       -R|--requires)
+               process_type=--requires
+               shift
+               ;;
+       -P|--provides)
+               process_type=--provides
+               shift
+               ;;
+       *)
+               break;
+               ;;
+   esac
+done
+
+if [ -z "$process_type" ]; then
+       usage
+       exit 1
+fi
+
+if [ $# -gt 0 ]; then
+       find "$@" | process $process_type
+       exit $?
+fi
+
+process $process_type
index 9ba11265335dc07733a0b9496bbb50bf471b36fa..bf8ceb6d908cc5befa14033eee76d9d230bc3515 100644 (file)
@@ -1,11 +1,14 @@
 DESCRIPTION = "The RPM Package Manager - relaunched"
+DESCRIPTION_rpm-build = "The RPM Package Manager rpmbuild and related commands."
 HOMEPAGE = "http://rpm5.org/"
 LICENSE = "LGPL 2.1"
-DEPENDS = "zlib perl popt beecrypt python libpcre"
-PR = "r0"
+DEPENDS = "zlib perl popt beecrypt python libpcre elfutils"
+PR = "r2"
 
 SRC_URI = "http://www.rpm5.org/files/rpm/rpm-5.1/${BPN}-${PV}.tar.gz \
           file://remove-compiled-tests.patch;apply=no \
+          file://perfile_rpmdeps.sh \
+          file://no_parentdir_ordering.patch \
          "
 inherit autotools gettext
 
@@ -19,6 +22,8 @@ EXTRA_OECONF = "--with-python=$PYTHONVER \
                --with-python-lib-dir=${libdir}/python$PYTHONVER \
                --with-db=internal \
                --with-db-tools-integrated \
+               --with-libelf \
+               --with-file=internal \
                --without-apidocs \
                --without-selinux \
                --without-lua \
@@ -26,12 +31,32 @@ EXTRA_OECONF = "--with-python=$PYTHONVER \
                --without-efence \
                --without-neon \
                --with-pcre=${libdir} \
-               --with-path-macros=${rpm_macros}"
+               --with-path-macros=${rpm_macros} \
+               --with-bugreport=http://bugzilla.pokylinux.org"
 
 CFLAGS_append = " -DRPM_VENDOR_WINDRIVER"
 
-PACKAGES += "python-rpm"
-FILES_python-rpm = "${libdir}/python*/site-packages/rpm/_*"
+PACKAGES =+ "rpm-build python-rpm python-rpm-dbg"
+
+SOLIBS = "5.0.so"
+
+FILES_rpm-build = "${bindir}/*-rpmbuild \
+               ${bindir}/*-gendiff \
+               ${bindir}/*-rpmspecdump \
+               ${libdir}/rpm/helpers/* \
+               ${libdir}/rpm/*brp* \
+               ${libdir}/rpm/*check-files \
+               ${libdir}/rpm/*cross-build \
+               ${libdir}/rpm/*debugedit \
+               ${libdir}/rpm/*dep* \
+               ${libdir}/rpm/*prov* \
+               ${libdir}/rpm/*req* \
+               ${libdir}/rpm/*find* \
+               ${libdir}/rpm/qf/* \
+               "
+
+FILES_python-rpm = "${libdir}/python*/rpm/_*"
+FILES_python-rpm-dbg = "${libdir}/python*/rpm/.debug/_*"
 
 # The mutex needs to be POSIX/pthreads/library or we can't
 # share a database between host and target environments
@@ -78,6 +103,18 @@ INSTALL_ACTIONS_virtclass-native="sed -i -e 's,rpm,${HOST_SYS}-rpm,' ${D}/${libd
 do_install_append() {
         ${INSTALL_ACTIONS}
        sed -i -e 's,%__check_files,#%%__check_files,' ${D}/${libdir}/rpm/macros
+       sed -i -e 's,pythondeps.sh,${HOST_SYS}-pythondeps.sh,' ${D}/${libdir}/rpm/macros
+       sed -i -e 's,phpdeps.sh,${HOST_SYS}-phpdeps.sh,' ${D}/${libdir}/rpm/macros
+       sed -i -e 's,javadeps.sh,${HOST_SYS}-javadeps.sh,' ${D}/${libdir}/rpm/macros
+       sed -i -e 's,libtooldeps.sh,${HOST_SYS}-libtooldeps.sh,' ${D}/${libdir}/rpm/macros
+       sed -i -e 's,pkgconfigdeps.sh,${HOST_SYS}-pkgconfigdeps.sh,' ${D}/${libdir}/rpm/macros
+       sed -i -e 's,executabledeps.sh,${HOST_SYS}-executabledeps.sh,' ${D}/${libdir}/rpm/macros
+
+       install -m 0755 ${WORKDIR}/perfile_rpmdeps.sh ${D}/${libdir}/rpm/perfile_rpmdeps.sh
+
+       mv ${D}/${libdir}/python$PYTHONVER/rpm/${HOST_SYS}-__init__.py \
+               ${D}/${libdir}/python$PYTHONVER/rpm/__init__.py
+
 }
 
 def rpm_python_version(d):