1827807 Members
2985 Online
109969 Solutions
New Discussion

Re: RPM question

 
SOLVED
Go to solution
Alex Lavrov
Regular Advisor

RPM question

Hello,
is there any tool to view how rpm file was built? It's drictories, spec files etc.
Also, where can I find a *good* documentation about building rpm files (wuth examples).

Thank you for help.
16 REPLIES 16
Alexander Chuzhoy
Honored Contributor

Re: RPM question

here's a link
http://rpm.redhat.com/RPM-HOWTO
I used it to build my rpms.

Best Regards.
Jerome Henry
Honored Contributor

Re: RPM question

rpm -ql package
rpm -q --filesbypkg package
man rpm
Good tut on package building :
http://freshrpms.net/docs/fight/

hth

J
You can lean only on what resists you...
Alex Lavrov
Regular Advisor

Re: RPM question

Thank you for replies.

I saw in few documentations:
rpm -ba

But my RedHat AS 3.00 linux box says that -ba is unknown option ....

Weird ...
Alexander Chuzhoy
Honored Contributor
Solution

Re: RPM question

You need to add a line to /etc/popt
rpm exec --ba rpmb -ba


Best regards.
Alex Lavrov
Regular Advisor

Re: RPM question

It works!

Tank you very much for the help! :-)
Alex Lavrov
Regular Advisor

Re: RPM question

Hello again, another RPM problem.
When I put some file in the %files section,
I get this message:
Requires(rpmlib): rpmlib(ConpressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) < 4.0.-1
Checking for unpackaged files: /usr/lib/rpm/check-files %{buildroot}
getOutputFrom(): Broken pipe

Any ides how to solve it?

thanx.
Jerome Henry
Honored Contributor

Re: RPM question

Hi
This is because the .spec file is missing a definition of a build-root directory in the "Buildroot:" field, AFA I remember, RH3.0's current build-root definition is this:
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot-%(%{__id_u}

hth

J
You can lean only on what resists you...
Alex Lavrov
Regular Advisor

Re: RPM question

It helped, thank you, but probable I'm missing something.

I want to build rpm that does not build a thing. I want it only put some files, maybe modify some files and that's it.

What is the best way to create that kind of rpm? It's gonna be package with files that will be copied to different directories ...
No build, no install ...
Just untar and copy.

Or maybe rpm is not good for me ...
Jerome Henry
Honored Contributor

Re: RPM question

Hi again,

If you just want to pack and unpack things, why don't you just use tar ? (man tar) It will make from several files and directories one zipped archive, you'll extract theneafter...
Or do you want to specifically use rpm for that purpose ?

J
You can lean only on what resists you...
Alex Lavrov
Regular Advisor

Re: RPM question

Hey,

I want to unpack things, put them in different places, modify some configuration files ...
As far as I know, it's too complicated for tar. If it was HPUX (I work on HPUX) I could build software depot and in linux I thought that it's gonna be rpm, correct me if I'm wrong.

Alexander Chuzhoy
Honored Contributor

Re: RPM question

if that's all you need to do-then tar will be the perfect choice..
if you make you tar from /
and add /etc/xinetd.d/telnet (just for example-nothing personal) to it.
Then when you unpack the tar while standing in / it will put it's file in exact the same location, i.e. in /etc/xinetd.d
So it's able to change configuration files...
Jerome Henry
Honored Contributor

Re: RPM question

100 % agree.
Use rpm if you really want to install programs, that is to say not only replace files, but add parameters to conf files or modify parameters, search for libs and so on...

If it's what you are looking for, then back to your prob. Otherwise tar is easy, except that it won' serach for files in different paths than the one you packed from.

J
You can lean only on what resists you...
Alex Lavrov
Regular Advisor

Re: RPM question

Well, it solves the unpacking issue, but if I need to create filesystem, modify some params, etc ....

And ofcourse the remove thing.
The person who uses my tar, never knows what it does, but if its rpm I can rpm -e it and it will remove it all, right?

(I'm totaly new to linux administration, so I'm sorry for the noob questions:-) )
Jerome Henry
Honored Contributor

Re: RPM question

But this is about programming issue.
Rpm is a convenient way to automatize installs and to put all the stuff in a all in one file. If you look at the freshrpms link above, you'll see that in the spec file the process looks much like as in a tarball, with make & make install.
If you know how to program a little exec file that would do the stuff you need, then you can use rpm to pack it and distribute it.
But rpm is not designed to do these things by itself.
So first step would be there : setting the program you need as if you could install it manually by a make install, then make from it an rpm...
hth

J
You can lean only on what resists you...
Jerome Henry
Honored Contributor

Re: RPM question

But this is about programming issue.
Rpm is a convenient way to automatize installs and to put all the stuff in a all in one file. If you look at the freshrpms link above, you'll see that in the spec file the process looks much like as in a tarball, with make & make install.
If you know how to program a little exec file that would do the stuff you need, then you can use rpm to pack it and distribute it.
But rpm is not designed to do these things by itself.
So first step would be there : setting the program you need as if you could install it manually by a make install, then make from it an rpm...

BTW, this is by no mean a noob question :]

hth

J
You can lean only on what resists you...
Alex Lavrov
Regular Advisor

Re: RPM question

Well, that's exactly what I'm doing.
I'll use only %files, %pre, %post, %preun and %postun derictives in my spec file.
To unpack files, modify the system configurtaion as installation and deleteing files, modifying the system back as uninstall ...
Let's hope that bash on linux is the same bash we have on HPUX :-)

Thanks you all for your help!