[Fedora-packaging] Re: BuildRoot

Axel Thimm Axel.Thimm at ATrpms.net
Tue Jul 25 20:52:53 UTC 2006

On Tue, Jul 25, 2006 at 11:26:26PM +0300, Ville Skyttä wrote:
> Too bad it doesn't work very well, for "BuildArch: noarch" packages,
> %{buildroot} ends up ending with -noarch here as expected, but
> $RPM_BUILD_ROOT ends with -x86_64.

Hm, I tried it w/o the patch (e.g. no default %buildroot) and the
effects are even funnier:

+ echo '%{buildroot}'
+ echo

+ exit 0

%{buildroot} becomes literally "%{buildroot}" and $RPM_BUILD_ROOT
becomes "".

So there is finally a difference between the two beyond style -
usually $RPM_BUILD_ROOT is defined as %{buildroot} automagically
within rpm upon creation of the scriplets to run for %prep and so
on. But if a BuildRoot: tag is missing no such code is emitted and the
$RPM_BUILD_ROOT environment variable is never instantiated.

In that sense it is safer to use %{buildroot} all over as install
... %{buildroot}%{_bindir} resolves to a relative non-existant folder
while $RPM_BUILD_ROOT%{_bindir} resolves to /usr/bin on missing

But to come back to Ville's observation: It means that one shouldn't
mix %{buildroot} and $RPM_BUILD_ROOT in the same specfile, which
hopefully noone is doing.
Axel.Thimm at ATrpms.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.fedoraproject.org/pipermail/packaging/attachments/20060725/fe0d4dc2/attachment.bin 

More information about the packaging mailing list