RE: File listed twice

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bob,

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?

Jeff.

-----Original Message-----
From: rpm-list-bounces@xxxxxxxxxx [mailto:rpm-list-bounces@xxxxxxxxxx]
On Behalf Of Bob Proulx
Sent: Monday, September 01, 2008 3:55 PM
To: rpm-list@xxxxxxxxxx
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!

  %clean
  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.

Bob

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list



_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux