[Prev] Thread [Next]  |  [Prev] Date [Next]

RE: File listed twice Jeffrey Sherwin Mon Sep 01 16:00:49 2008


BuildRoot is set, set to: BuildRoot:
%{_tmppath}/%{name}-%{version}-%release-build, using it everywhere.

I'm building everything there and copying over, but I get errors that
the files are not in $RPM_BUILD_ROOT/usr/local/foo as files are listed
under /usr/local/foo.

Clean is also set properly. Any other ideas?


-----Original Message-----
On Behalf Of Bob Proulx
Sent: Monday, September 01, 2008 3:55 PM
Subject: Re: File listed twice

Jeffrey Sherwin wrote:
> How come when I list the following directory under %files:
> /usr/local/foo
> RPM starts looking for those files under the $RPM_BUILD_DIR?

The idea is that you always build in an image area.  The goal is to
facilitate reproducible builds.  Therefore by default rpm will always
pull files from the $RPM_BUILD_ROOT area.  You should always start out
with an empty one and then because it is only populated with files
from your build you can ensure that only files that you want to put
there are put there.

If you were to pull files from your system area then it could
accidentally package files that are not part of your build.

> Because of this, I have actually had to modify my script to build
> everything in $RPM_BUILD_DIR/usr/local/foo and then copy it all over
> to /usr/local/foo at the end of $install.
> That can't be correct. 

You are right.  It isn't correct.  Did you forget to set BuildRoot in
your specfile?  Make sure you have BuildRoot set in the top header
area of your specfile.  Something like the following is typical.  The
exact name isn't important because it is a temporary location.

  BuildRoot: %{_tmppath}/%{name}-%{version}-build

And with that in place you should clean the build area too.  Verify
the setting of $RPM_BUILD_ROOT before cleaning it!

  rm -rf $RPM_BUILD_ROOT

Note that newer versions of rpm handle this differently.  Therefore
this is somewhat version specific.  But by your questions I assume
that the version of rpm that you are using uses the above convention.
An assumption that may be incorrect.


Rpm-list mailing list

Rpm-list mailing list