newsen
newsen

Reputation: 51

rpm build error

I tried to build a rpm package which is giving me the following error

Upvotes: 5

Views: 6500

Answers (3)

Kris W
Kris W

Reputation: 11

I just hit this same problem when attempting to build on a RedHat 5.3 server. Here is what I found. The error appears to be caused by an empty RPM_BUILD_ROOT variable. Below is one offending line:

find "$RPM_BUILD_ROOT" ! -path "${debugdir}/*.debug" -type f \
                 \( -perm -0100 -or -perm -0010 -or -perm -0001 \) \
                 -print |

If RPM_BUILD_ROOT hasn't been defined, then the first argument to find is an empty string "", which causes this error. Interestingly enough, if you remove the quotes from around $RPM_BUILD_ROOT, then command works fine since the first argument would become the "!". Since it's not required to define a "BuildRoot:" in the spec file, this certainly looks like a bug to me.

Upvotes: 1

Corey Henderson
Corey Henderson

Reputation: 7455

In your spec you can do this at the top:

%define debug_package %{nil}

This should bypass this problem

Upvotes: 5

zerosquid
zerosquid

Reputation: 401

Try defining the BuildRoot variable in your spec file. The find-debuginfo script looks in to that directory several times, and will die without it.

This will usually look something like: BuildRoot: %{_tmpdir}/%{name}-%{version}-%{release}

As to your second question, I can't say without seeing spec file and sources directly, and I am by no means an RPM expert. I will recommend you to Chapter 13 of Maximum RPM(there are copies available free online), and the notes from Tom Callaway's presentation on How to make good RPM packages - I've found the spec examples here to be very helpful in the past.

Upvotes: 7

Related Questions