Mark S
Mark S

Reputation: 27

RPM build dependencies error

I am trying to create a binary RPM file on Cent OS 6.5 but am running into errors during the prep stage. My spec file has the following commands in the prep section:

%prep
%setup -q
wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm
yum -y install python-pip
pip install ws4py request

But when i run:

 rpmbuild -v -bb --clean SPECS/ttsdk.spec 

I get the following output:

Preparing...                ########################################### [100%]
    package epel-release-6-8.noarch is already installed
error: Bad exit status from /var/tmp/rpm-tmp.Kkbk09 (%prep)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.Kkbk09 (%prep

It seems like it is failing because the package is already installed, which would not be the behavior I would expect. Am i overlooking something? Perhaps a way to make the rpm command not fail when already installed or have the spec file overlook a bad exit code? If the full log is needed or more of the spec file, please let me know.

Upvotes: 0

Views: 1558

Answers (1)

Etan Reisner
Etan Reisner

Reputation: 80921

Try using -U instead of -i?

Try using yum install ... instead of rpm?

If all else fails add || : to the end of that line to always have it return true.

That all being said that seems a bad thing for a spec file to be doing during %prep to me (and requires building as root which is generally discouraged).

Upvotes: 1

Related Questions