Patchwork [CONSOLIDATED,PULL,10/25] package_rpm.bbclass: Update the platform config and --target

login
register
mail settings
Submitter Saul Wold
Date Aug. 12, 2011, 7:49 a.m.
Message ID <bcf055fdf0c3f1440e7c8140ca2f3d90aa0441c9.1313134270.git.sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/9723/
State New, archived
Headers show

Comments

Saul Wold - Aug. 12, 2011, 7:49 a.m.
From: Mark Hatle <mark.hatle@windriver.com>

When constructing the /etc/rpm/platform file, we need to ensure that
the any, all, and noarch platforms will allow any "linux" variant to
be installable, not just matching variants.. i.e.

arm-oe-linux-gnueabi should be able to install noarch-oe-linux

Also ensure that we pass the full canonical arch via the --target=
parameter.  This allows us to define the proper platform settings
for all packages.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
 meta/classes/package_rpm.bbclass |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

Patch

diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 59e8d48..5c67f69 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -177,7 +177,15 @@  package_install_internal_rpm () {
 	echo "${platform}${TARGET_VENDOR}-${TARGET_OS}" > ${target_rootfs}/etc/rpm/platform
 	if [ ! -z "$platform_extra" ]; then
 		for pt in $platform_extra ; do
-			echo "$pt-.*-${TARGET_OS}" >> ${target_rootfs}/etc/rpm/platform
+			case $pt in
+				noarch | any | all)
+					os="`echo ${TARGET_OS} | sed "s,-.*,,"`.*"
+					;;
+				*)
+					os="${TARGET_OS}"
+					;;
+			esac
+			echo "$pt-.*-$os" >> ${target_rootfs}/etc/rpm/platform
 		done
 	fi
 
@@ -821,13 +829,13 @@  python do_package_rpm () {
 	targetsys = bb.data.getVar('TARGET_SYS', d, True)
 	targetvendor = bb.data.getVar('TARGET_VENDOR', d, True)
 	pkgwritedir = bb.data.expand('${PKGWRITEDIRRPM}/${PACKAGE_ARCH}', d)
-	pkgarch = bb.data.expand('${PACKAGE_ARCH}', d)
+	pkgarch = bb.data.expand('${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}', d)
 	magicfile = bb.data.expand('${STAGING_DIR_NATIVE}/usr/share/misc/magic.mgc', d)
 	bb.mkdirhier(pkgwritedir)
 	os.chmod(pkgwritedir, 0755)
 
 	cmd = rpmbuild
-	cmd = cmd + " --nodeps --short-circuit --target " + pkgarch + targetvendor + "-linux-gnu --buildroot " + pkgd
+	cmd = cmd + " --nodeps --short-circuit --target " + pkgarch + " --buildroot " + pkgd
 	cmd = cmd + " --define '_topdir " + workdir + "' --define '_rpmdir " + pkgwritedir + "'"
 	cmd = cmd + " --define '_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm'"
 	cmd = cmd + " --define '_use_internal_dependency_generator 0'"