Bug 4452

Summary: rpm %install target fails because of incorrect __mkdir_p macro on x86 32bit only
Product: [Runtime] Package Management Issues Reporter: Martin Mohring <martin.mohring>
Component: RPMAssignee: Saul Wold <sgw>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: Medium CC: bluelightning, martin.mohring, sgw
Version: 1.4   
Target Milestone: 1.4.1   
Hardware: x86   
OS: x86   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Martin Mohring 2013-05-06 17:29:17 UTC
rpms macro file in:

/usr/lib/rpm/macros:%__mkdir_p           /usr/bin/mkdir -p

sets mkdir_p to /usr/bin/mkdir instead of /bin/mkdir.

%install is not optional, so all rpm builds fail.

This is only on x86 32bit target, all other targets work.
Comment 1 Saul Wold 2013-05-06 18:02:23 UTC
More information is needed here. I just did a build and it has the correct path which is set via the db_cv_path_mkdir in meta/site/common-linux file.

Can you attach your config.log file your rpm build? This file would be in the tmp/work/<arch>/rpm/<version>/build dir (if you are using 1.4).
Comment 2 Mark Hatle 2013-05-06 18:27:12 UTC
Note: This defect appears to be referring to 'rpmbuild' when running -on the target-.

Martin, please verify this is correct.
Comment 3 Martin Mohring 2013-05-06 18:32:41 UTC
I found the problem in the package from

http://downloads.yoctoproject.org/releases/yocto/yocto-1.4/rpm/i586/rpm-5.4.9-r62.i586.rpm

/usr/lib/rpm/macros

line 110

%__mkdir_p /usr/bin/mkdir -p

Maybe a borked release file ?

I could *not find this* in the other architectures...
Comment 4 Martin Mohring 2013-05-06 18:56:37 UTC
And on your question: yes, error occurs when rpm is run on the target.

In this case: rpmbuild is called.

I setup a chroot of the rpm packages from said location on the yocto release server, http://downloads.yoctoproject.org/releases/yocto/yocto-1.4/rpm
Comment 5 Saul Wold 2013-05-07 15:34:36 UTC
From 59fcb2a92b5928c3178b03701cf342ba8a6cac37 Mon Sep 17 00:00:00 2001
From: Poky Build User <pokybuild@ab06.i.yoctoproject.org>
Date: Tue, 7 May 2013 15:22:37 +0000
Subject: [PATCH] rpm: ensure __mkdir_p matches __mkdir

They differ at times because one is set from the db_cv_path_mkdir and the other is
found during config time for the host (/usr/bin/mkdir), in the macros we should just
use __mkdir for the __mkdir_p variant.

[YOCTO #4452]

Signed-off-by: Poky Build User <pokybuild@ab06.i.yoctoproject.org>
---
 meta/recipes-devtools/rpm/rpm_5.4.9.bb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/recipes-devtools/rpm/rpm_5.4.9.bb b/meta/recipes-devtools/rpm/rpm_5.4.9.bb
index 7d2cba4..24f0d3c 100644
--- a/meta/recipes-devtools/rpm/rpm_5.4.9.bb
+++ b/meta/recipes-devtools/rpm/rpm_5.4.9.bb
@@ -359,6 +359,7 @@ FILES_${PN}-staticdev = " \
 do_configure() {
 	# Disable tests!
 	echo "all:" > ${S}/tests/Makefile.am
+	sed -e 's/@__MKDIR_P@/%{__mkdir} -p/' -i ${S}/macros/macros.in
 
 	( cd ${S}; ${S}/autogen.sh )
 
-- 
1.8.1.4