Bug 496816 - bug in spec file cause wrong src.rpm
bug in spec file cause wrong src.rpm
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel (Show other bugs)
All Linux
low Severity medium
: rc
: ---
Assigned To: Jarod Wilson
Red Hat Kernel QE team
Depends On:
  Show dependency treegraph
Reported: 2009-04-21 05:56 EDT by Levente Farkas
Modified: 2015-01-08 11:53 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-01-08 11:53:19 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Levente Farkas 2009-04-21 05:56:02 EDT
i started this long thread on centos-devel:
the result turn out a kernel.spec file bug (and rpm problem). it turns out that this part of the spec:
%if %{with_headers}
BuildRequires: unifdef
should have to replace with
BuildRequires: unifdef
otherwise the resulting src.rpm depends on the build arch and no longer can be build in mock. see my other bug report:
imho it's a small fix which not intrusive since only change the result src.rpm and everybody can have a benefit from it.
Comment 2 Don Zickus 2009-04-22 10:25:17 EDT
NACK on the change.  Having the %if provides clear separation for why the unifdef package is there.  Afaict there is nothing wrong with having it there.  In addition, we have built hundreds and perhaps thousands of kernel packages with that change in there (this was in 5.0) and this includes our partners, and no one has ever had a problem.  

Reading through the email threads seems to suggest this is a CentOS problem.  I don't see why RedHat should make this change.

If you can provide me a reliable test case (ie a specific arch and rpmbuild params) I will look into trying to duplicate and figure out what went wrong.  But so far evidence seems to suggest a misconfigured mock??

Also because the with_headers logic is slightly complicated in the kernel spec file, it might have been accidentally broken on the CentOS side.  If you attach the spec file that breaks to this bz, I will diff it with RedHat's version and review the changes to see what might have caused it.

Don't get me wrong, I am willing to help you guys, but I personally think you are trying to fix the symptom and not the problem.


ps - I don't know much about mock, so all I can do is look at things from a spec file perspective.
Comment 3 Levente Farkas 2009-04-22 10:53:22 EDT
probably you don't read through the thread:-) reconstruction is very simple just build a i386 kernel from spec file and _not_ from src.rpm (with eg. the latest kernel-2.6.18-128.1.6.el5) on i386 host eg with:
rpmbuild -ba --clean --target "noarch,i386,i686" -define "dist .el5" ~/rpm/SPECS/kernel-2.6.spec
and then on the resulting src.rpm run:
rpm -qp --requires kernel-2.6.18-128.1.6.el5.src.rpm | grep unifdef
if it give nothing (and will:-) than it's not working.

ps. anyway jeff johnson who probably now about rpm more then me acknowledge this rpm behavior in: 
so one have to build the kernel on x86_64 (or ppc) and the resulting src.rpm will be good (that's what centos will do in the future), but in i386 not.

but this problem/artifacts can be solved in kernel spec ie. not put into BR into if or define with_headers other ways.
Comment 4 Don Zickus 2009-04-23 18:21:33 EDT
Interesting.  I can reproduce the problem on my end.  I do notice with your example above the src.rpm is created 3 times, one for each target.  If you put i386 as the last target it works out ok, because the last src.rpm created has the unifdef.

I'll try to think more about it tomorrow.  I understand why you came up with the patch above now.  

Comment 5 Levente Farkas 2010-06-18 06:47:12 EDT
please close this bug as wontfix.
Comment 6 Levente Farkas 2010-10-29 16:01:25 EDT
Comment 7 Jarod Wilson 2010-10-29 16:20:27 EDT
Eh. I'll go ahead and fix this. The real fix though, I believe, is to move the BR: up before where with_headers gets set to 0 within the spec. That way, its always a BR, unless someone does an 'rpmbuild -bb --without headers src.rpm'.
Comment 8 RHEL Product and Program Management 2011-02-01 12:01:16 EST
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
Comment 14 RHEL Product and Program Management 2012-01-09 08:54:58 EST
This request was evaluated by Red Hat Product Management for inclusion in Red Hat Enterprise Linux 5.8 and Red Hat does not plan to fix this issue the currently developed update.

Contact your manager or support representative in case you need to escalate this bug.

Note You need to log in before you can comment on or make changes to this bug.