[Fedora-packaging] Re: Re: BuildRoot

Matthias Saou thias at spam.spam.spam.spam.spam.spam.spam.egg.and.spam.freshrpms.net
Wed Jul 26 09:23:16 UTC 2006


Ville Skyttä wrote :

> On Tue, 2006-07-25 at 15:48 -0500, Rex Dieter wrote:
> > Ville Skyttä wrote:
> > > 
> > > /var/tmp/foo-1-1-noarch
> > > /var/tmp/foo-1-1-x86_64
> > 
> > Yuck, though, in practice mostly harmless, since we enforce the consistent
> > use (ie, not mixing) of either %buildroot or $RPM_BUILD_ROOT.
> 
> I don't think it's harmless.  Stuff in /usr/lib/rpm uses $RPM_BUILD_ROOT
> no matter what one does inside the specfile.
> 
> So if one installs into and otherwise deals with %{buildroot} inside the
> spec, chances are that the scripts in /usr/lib/rpm will not operate on
> the expected build root.
> 
> And if one uses $RPM_BUILD_ROOT everywhere in the specfile, things will
> probably work just fine but having %{_target_cpu} in the buildroot
> definition is useless for some cases.

Things are getting fun and interesting now! :-)

What I really fail to understand is how when you don't specify a
BuildRoot: in a spec file, $RPM_BUILD_ROOT ends up empty, but when you
define %buildroot in a macro, it gets a value which is different!

The easiest possible explanation here would be that %buildroot gets
expanded multiple times, one being what we see set as $RPM_BUILD_ROOT
and another being what the "echo %{buildroot}" in the spec file shows.

I've tried to dig a little deeper, as this might be easy to fix
(although I doubt it), but am completely lost in the macros right
now... might be a simple matter of having the arch globally set from
the spec file value _before_ the buildroot gets globally set for the
first time.

Matthias

-- 
Clean custom Red Hat Linux rpm packages : http://freshrpms.net/
Fedora Core release 5.91 (FC6 Test2) - Linux kernel 2.6.17-1.2445.fc6
Load : 0.14 0.18 0.15




More information about the Fedora-packaging mailing list