Bug 496464

Summary: don't install %if-ed BuildRequires into the buildroot
Product: [Retired] Fedora Hosted Projects Reporter: Levente Farkas <lfarkas>
Component: mockAssignee: Clark Williams <williams>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: unspecifiedCC: dcantrell
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-04-30 11:28:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Levente Farkas 2009-04-19 12:46:00 UTC
if i try to build latest rhel-5's kernel-2.6.18-128.1.6.el5 in mock-0.9.14-1.el5 then it's failed, because mock do not install unifdef into the buildroot. the reason for this may be because the spec file contains:
------------------------------
%if %{with_headers}
BuildRequires: unifdef
%endif
------------------------------
and even if with_headers defined as 1 mock still not install unifdef into the buildroot. the following command gives this result:
--------------------------------
mock --rebuild --target="noarch,i386,i686" --without=pae --without=debug --without=debuginfo kernel-2.6.18-128.1.6.el5.src.rpm
--------------------------------
so imho it's a bug.

Comment 1 Clark Williams 2009-04-19 14:59:45 UTC
mock uses the rpmUtils package provded by yum to extract required packages from an SRPM and install them. Chances are the dependency for unifdef is not being recorded in the SRPM. 

Try this on your srpm:

$ rpm -qp --requires kernel-2.6.18-128.1.6.el5.src.rpm | grep unifdef

I tried this on a 2.6.28-128.1.1.el5.src.rpm and it did in fact show unifdef in the output. If unifdef shows up then something is amiss in mock/yum/rpm. If it doesn't show up then the SRPM is probably hosed.

Comment 2 Levente Farkas 2009-04-19 15:13:26 UTC
i also try it with kernel-2.6.18-128.1.6.el5.src.rpm and kernel-.6.28-128.1.1.el5.src.rpm too. the strange thing is that while it's missing from the first it's in the second?

Comment 3 Levente Farkas 2009-04-19 15:27:33 UTC
ok it's not happened with rhel's kernel just with centos kernel:-(

Comment 4 Clark Williams 2009-04-19 18:14:50 UTC
I'd suspect something changed in the build process that caused with_headers to be undefined.