Red Hat Bugzilla – Bug 100653
%buildroot ignored in final packaging step
Last modified: 2007-11-30 17:10:31 EST
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
Created attachment 93092 [details]
Trivial example to reproduce bug
Define %buildroot in mortal's ~/.rpmmacros. Build this with "rpmbuild -ba
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?
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).