How to install .src.rpm ? ( source rpm )

Hi,

I have got few RPM's from rpmfind.net ( mainly gcc ).
But it seems to be src files instead of the image.
so I think we have to build the src files according to target machine using rpmbuild.
Can any one help me with

1) Various options of rpm build that have to be taken care
2) Steps to follow after rpmbuild
3) How a tar.gz install can be made into rpm
4) How to gather missing additional libraries ( missing rpm's ) along with current rpm's.

I have used apt-get in some linux distributions where we get
apt-get install <s/w name>
But with RPM I need some more inputs.

Thanks in advance,
Sivaswami Jeganathan.

You can use alien to install rpm package on a Debian system.

Regards

its src.rpm not rpm .

A .src.rpm is made up of a minimum of two files: a .spec file and a tarball. There may also be patch files as part of the .src.rpm. When you install the .src.rpm, the files are installed into /usr/src/.../SPECS and /usr/src/.../SOURCES. When the binary rpm has been compiled, you will find it in /usr/src/.../RPMS. The /.../ is different for redhat (and derivatives), Mandriva, and Suse.

The tarball can be installed just as any other tarball. Get any tarball and write a .spec file for it, and you have a .src.rpm.

The options that rpmbuild needs should be in the .spec file. The additional options that you can give to rpmbuild modify the result of applying the .spec file to the direct the build.

If you are missing any dependencies in order to build an rpm, you will have to find and install them. There are several tools that can ease the process to varing degrees of success, such as up2date, urpmi, and apt4rpm.