Bug 100653

Summary: %buildroot ignored in final packaging step
Product: [Fedora] Fedora Reporter: Kenneth Porter <shiva>
Component: rpmAssignee: Paul Nasrat <nobody+pnasrat>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhide   
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: 2006-01-06 14:33:07 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:
Attachments:
Description Flags
Trivial example to reproduce bug none

Description Kenneth Porter 2003-07-24 00:46:45 UTC
rpm-build-4.1-1.06

Build a package as mortal that lacks a BuildRoot directive.
Define %buildroot in ~/.rpmmacros. All steps complete successfully up to
%install (including stripping and compressing) but the final packaging step
fails when rpmbuild looks for the files in the packaged location, not the build
root.

Comment 1 Kenneth Porter 2003-07-24 00:50:35 UTC
Created attachment 93092 [details]
Trivial example to reproduce bug

Define %buildroot in mortal's ~/.rpmmacros. Build this with "rpmbuild -ba
foo2.spec".

Comment 2 Kenneth Porter 2005-03-21 14:35:30 UTC
According to http://www.rpm.org/max-rpm-snapshot/ch-rpm-anywhere.html "Several
requirements must be met in order for a build root to be utilized: * A default
build root must be defined in the package's spec file." So I guess this is
working as designed. What motivated this design decision? Shouldn't %buildroot
(and $RPM_BUILD_ROOT) always work?

Comment 3 Jeff Johnson 2006-01-06 14:33:07 UTC
The BuildRoot: directive sets the %buildroot macro which is used to set RPM_BUILD_ROOT in scriptlets.

This is consistent behavior, expecting %define buildroot /some path during *.spec parse to
Do The Right Thing is impossible because BuildRoot: is a FIFO object, while macro values
are LIFO (i.e. %define buildroot /some/path can be done multiple times).