-   Linux - Software (
-   -   Source RPM help needed (

winsnomore 10-24-2004 11:45 PM

Source RPM help needed
I am trying to compile some source RPMS under FC2
I have a tree created ~/rpm .... under it I have the BUILD SOURCES SRPMS RPMS tmp ...
I downloaded a source rpm (libjpeg-6b. ... 31 .. src.rpm)

When I try to install RPM by
rpm -iv lib*.src.rpm
It always extracts to the SOURCES directory.
It doens't really do much execpt to pull out the tarball from the package and dumps it there.
The corrrect behaviour should be that it should create
~/rpm/BUILDS/ libjpeg-6b . .. and un-tar the stuff there.
It does put the .spec file in the SPECS directory.. that's the only right thing it does !!

Now I can move files around by hand and untar and move on, but it's a drag and seems like something is wrong. I can't figure it out.

I do have a ~/.rpmmacros and .rpmrc (standard stuff I pulled out from mandrake howto)

Actually the behaviour seems not to change much no matter how much detail i put
in the rpmmacros
I started with _topdir .. and defined everything else .. (dest/srpm ... etc. )

I tried -vv flag and it doesn't really tell you much.
I have looked at the spec file and it looks fine ... it has the righ .prep commands, actually I tried a bunch of RPMS and all look same (so must be right :-))

All the permissions are 777 EVERYwhere

Am I missiig something . ? any help will be appreciated.

bigrigdriver 10-25-2004 12:11 AM

Yes. You are missing something; quite a lot actually. A .src.rpm is just that; source code (think tarball). A .src.rpm consista of a tarball, a spec file, and possibly one or more patch files. You have to compile a .src.rpm to get an installable binary rpm (read 'an application you can run').
When you install a .src.rpm, as you found, you get a tarbal and a spec file. It won't do anything until you compile it to make an installable binary rpm and install it (I respectfully suggest that you do some basic research and reading on the subject - Max-rpm from RedHat would be a good place to start).
Now that I have vented my spleen, here's what to do.
cd to the SPECS directory. You should find there a file called <rpm filename>.spec (substitute the name of the file for <rpm filename>).
Issue the command rpm -bb <filename>.spec (to build an installable binary rpm). If all goes well, at the end, you will find in the RPMS directory, probably in the i386 folder (unless you specified otherwise) and brand-spanking-new installable binary rpm which you can install in the usual maner.
If you don't find it there, look in the default location: /usr/src/<distroname>/RPMS (/usr/src/packages in SuSE). It should be in one of the folders there.
Once again, with respect, from the content of your post, you do not understand the ins and outs of rpm, and .src.rpm. Do yourself a favor and do some homework. Once you have a firm grasp of rpm, the possibilities are awesome. I once couldn't find an upgrade to webmin that I wanted, except in tarball. With Max-rpm and a copy of the spec file from an earlier version which I could edit, I successfully created an rpm which I used to upgrade my webmin installation. From that experience I learned a lot about rpm.

winsnomore 10-25-2004 12:42 PM

Thanks .. but
I looked for a manual for RPM on redhat site, but you can't find the doc unless you say MAX-RPM .. thanks for that.
I have gone thru the document, it's nice but leaves some questions unanswred.

- there is a slighthly easier path to "install" source RPMS .. (not mentioned AT-ALL in the MAX-RPM "book")

rpmbuild <source_rpm>
with the approrpiate option is cleaner and simpler than multistep operatons of ..
rpm -i <source rpm > to be followed by
rpm -b[abc] <rpm spec file>
(and some hand cleaning to get rid of tarballs and patch files from SOURCES)

The documnetaion is elaborate but doesn't still clarify a couple of questions .. particular installing header files that you would need for dependent packages !!


All times are GMT -5. The time now is 09:34 PM.