FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > RPM Package Manager

 
 
LinkBack Thread Tools
 
Old 09-01-2008, 07:21 PM
"Jeffrey Sherwin"
 
Default File listed twice

One more question:

How come when I list the following directory under %files:

/usr/local/foo

RPM starts looking for those files under the $RPM_BUILD_DIR? 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.

-----Original Message-----
From: rpm-list-bounces@redhat.com [mailto:rpm-list-bounces@redhat.com]
On Behalf Of Jeffrey Sherwin
Sent: Monday, September 01, 2008 1:05 AM
To: RPM Package Manager
Subject: RE: File listed twice

That makes sense. Thanks. The warnings are now all gone.

I appreciate all of the help.


-----Original Message-----
From: rpm-list-bounces@redhat.com [mailto:rpm-list-bounces@redhat.com]
On Behalf Of Michael Jennings
Sent: Monday, September 01, 2008 1:00 AM
To: rpm-list@redhat.com
Subject: Re: File listed twice

On Monday, 01 September 2008, at 00:54:21 (-0400),
Jeffrey Sherwin wrote:

> Interesting. I think that's the answer. I have directories in the file
> list. So I need to pull them out.
>
> If I have a big tree (that the entire installation is contained
within),
> with a 900 or so files, what is the easiest way to accomplish a
> comprehensive and proper file list?
>
> Thanks again for all the help.

List only the top-level files and directories your package should
own. For example, list %{_datadir}/yourapp/ as a directory, not all
its contents. That way your package will own the directory *and* the
contents. List files in system directories (e.g., %{_bindir}/yourapp)
individually. This technique properly delegates file/directory
ownership.

Michael

--
Michael Jennings (a.k.a. KainX) http://www.kainx.org/ <mej@kainx.org>
Linux Server/Cluster Admin, LBL.gov Author, Eterm (www.eterm.org)
-----------------------------------------------------------------------
"I've been looking for a Savior in these dirty streets,
Looking for a Savior beneath these dirty sheets."
-- Tori Amos, "Crucify"

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



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



_______________________________________________
Rpm-list mailing list
Rpm-list@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list
 
Old 09-01-2008, 07:55 PM
Bob Proulx
 
Default 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@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list
 
Old 09-01-2008, 10:50 PM
"Jeffrey Sherwin"
 
Default File listed twice

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@redhat.com [mailto:rpm-list-bounces@redhat.com]
On Behalf Of Bob Proulx
Sent: Monday, September 01, 2008 3:55 PM
To: rpm-list@redhat.com
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@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list



_______________________________________________
Rpm-list mailing list
Rpm-list@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list
 
Old 09-02-2008, 07:45 AM
Mikael Fridh
 
Default File listed twice

On Mon, Sep 01, 2008 at 06:50:01PM -0400, Jeffrey Sherwin wrote:
> 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?
>

You mentioned $RPM_BUILD_DIR earlier, are you sure that you didn't
confuse something in the spec file?

Post your spec file or atleast the relevant sections and I bet someone
will determine the error pretty quickly.

--
Fridh

_______________________________________________
Rpm-list mailing list
Rpm-list@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list
 
Old 09-02-2008, 10:59 PM
"Jeffrey Sherwin"
 
Default File listed twice

I have attached the file as is. Please have a look.

I understand that I am not supposed to build as root, but I am not sure
how I create the relevant symlinks if I don't.

Jeff.

-----Original Message-----
From: rpm-list-bounces@redhat.com [mailto:rpm-list-bounces@redhat.com]
On Behalf Of Mikael Fridh
Sent: Tuesday, September 02, 2008 3:45 AM
To: RPM Package Manager
Subject: Re: File listed twice

On Mon, Sep 01, 2008 at 06:50:01PM -0400, Jeffrey Sherwin wrote:
> 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?
>

You mentioned $RPM_BUILD_DIR earlier, are you sure that you didn't
confuse something in the spec file?

Post your spec file or atleast the relevant sections and I bet someone
will determine the error pretty quickly.

--
Fridh

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

_______________________________________________
Rpm-list mailing list
Rpm-list@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list
 
Old 09-03-2008, 08:37 AM
Mikael Fridh
 
Default File listed twice

On Tue, Sep 02, 2008 at 06:59:24PM -0400, Jeffrey Sherwin wrote:
> I have attached the file as is. Please have a look.
>
> I understand that I am not supposed to build as root, but I am not sure
> how I create the relevant symlinks if I don't.
>

A symlink is just a file. Create the symlink in your %install section
and reference it in your %files section. Getting the links right
requires some careful thinking though.


%install
ln -s foo.so.1 $RPM_BUILD_ROOT/usr/local/foo.so

%files
/usr/local/foo.so.1
/usr/local/foo.so


Result:
/usr/local:
foo.so -> foo.so.1

Regarding your other issues, I think if you read what we all sent you
privately earlier, you will understand that you've misunderstood rpm
completely, especially what %install means.

You're better off just writing a script, because that's what you're
using your specfile for right now.

--
Fridh

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

Thread Tools




All times are GMT. The time now is 09:49 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org