rpm: Update the rpm integration to support per-file dependencies

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>
This commit is contained in:
Mark Hatle
2010-08-20 08:32:08 -07:00
committed by Richard Purdie
parent 6c12afd57d
commit 5d2e88c3c2
3 changed files with 103 additions and 5 deletions

View File

@@ -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)
/*@*/

View File

@@ -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

View 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):