Page 1 of 1

Trying to make an rpm from a tarball.

PostPosted: Mon Mar 24, 2008 11:39 am
by tiberius61
I have a question about creating rpms from a tarball.

I did a full install of cfengine on my admin box and configured it the way I want it to run. Now I am trying to create an rpm, so I can put it out there on all my machines with all MY configuration files, setup the way I want it.

I made a list of all the files, binaries, libraries, shared files, config files, then made a spec file. I tar'ed it all up and then ran:


# rpmbuild -vv -tl cfengine-2.2.3.tar.gz

It gave me the following output:

Processing files: cfengine-2.2.3-0
Checking for unpackaged file(s): /usr/lib/rpm/check-files %{buildroot}
D: execv(/usr/lib/rpm/check-files) pid 27682
D: waitpid(27682) rc 27682 status 100

And NO rpm's.

For the "-vv" output, this isn't a whole lot of information. Can anybody decipher what rpmbuild is trying to tell me is wrong? :?:

PostPosted: Mon Mar 24, 2008 1:37 pm
by hotmule
Hi,

The output you're getting looks normal -- this is from a "spec file", rather than a tarball, build, but the essence is the same:

rpmbuild -vv -bl openssl.spec

blahblah....
D: execv(/usr/lib/rpm/check-files) pid 1620
D: waitpid(1620) rc 1620 status 100

And that's it.

I think the issue is that you're running it with the -l option and it's only listing out files. If you want it to build a binary rpm, you may need to do

rpmbuild -vv -tb cfengine-2.2.3.tar.gz
or
rpmbuild -vv -ta cfengine-2.2.3.tar.gz (If you want a source RPM, too)

I would leave the -vv out at first though. It some times makes perfectly normal things look like they're failing ;)

If I'm off base on what you're looking for here, just ping back - I check here at least once a day.

Good luck to you!

BTW, if you already have the sources compiled, etc, be sure to remove the %prep, %setup, %build and %install, etc from your spec file. All you really need is %description and %files (along with the other "necessary" headers)

, Mule

PostPosted: Mon Mar 24, 2008 9:45 pm
by laum
Hey Guys,

Check out our Creating RPMs from installed packages post. That may be kind of what you're shooting for by creating your cfengine RPM of already-built and customized content.

Just change the :

Code: Select all
echo "%files" >>$existing_rpm.spec
rpm -ql $existing_rpm|while read x
do       
       echo "%{prefix}$x" >>$existing_rpm.spec
done


part to

Code: Select all
%files
/your/file/1
/your/file/2


, etc

Hope that helps :)

, Mike

PostPosted: Tue Mar 25, 2008 12:24 pm
by tiberius61
Mike,

Thanks, but I'm not creating an rpm from an rpm install, its from a tar.gz that I compiled myself. I did get a few pointers from your post from a few weeks back, that helped. Mule hit the nail on the head when he informed me I forgot to change the -tl to a -tb when I was through testing. (New job, a lot of new information running through my head. I guess I should take some time to gzip some of it. :) )

I plan on making good use of your post on making packages on sun systems, since I've never done that before. This is going to be fun. Thanks for that post!

Jim

PostPosted: Tue Mar 25, 2008 9:50 pm
by laum
Hey Jim,

Awesome. I'm glad one of us could help you out :) I know how it is. Every once and a while you just need to step back and let your problems work themselves out while you space out (or work on something else ;)


Take it easy,

, Mike

PostPosted: Tue Mar 25, 2008 11:05 pm
by hotmule
Great,

Glad to help out :)

, Mule

Re: Trying to make an rpm from a tarball.

PostPosted: Mon Nov 30, 2009 2:27 am
by nguyentruong
Hope that helps
----------------------------
tuyen dung | tim viec | viec lam