LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Will RPM play nice with locally built packages? (http://www.linuxquestions.org/questions/linux-general-1/will-rpm-play-nice-with-locally-built-packages-677056/)

alanhr 10-17-2008 07:52 AM

Will RPM play nice with locally built packages?
 
Hi all,

Suppose I build library X from source and install it via make install. Suppose then that I install program Y via rpm. If program Y depends on library X, is there a way to make rpm see that I already have library X? Or am I pretty much stuck looking for a suitable rpm for library X (or packaging one up myself)?

Thanks.

smbell100 10-18-2008 01:55 AM

if you look at http://perso.b2b2c.ca/sarrazip/dev/r...sh-course.html, amongst others, you will find instructions for building rpms. Most source packages that I have looked at have a spec file for building the rpm package.

There are slightly more detailed instructions at http://perso.b2b2c.ca/sarrazip/dev/r...sh-course.html.

Of course, the ultimate reference is http://www.rpm.org/max-rpm/

Hope this helps

jay73 10-18-2008 02:12 AM

Manually compiled libraries should work as well as any rpm provided alternative. However, you may occasionally need to edit one or more variables to make it work properly, especially when another library already provides the same functionality.
Anything you compile yourself is not known to the package manager, though, and takes manual removal and updating and obviously implies that you are yourself responsible for keeping track of any security issues related to the library in question .
Of course, you could also look into building your own rpm package from source if that looks inconvenient.

abolishtheun 10-18-2008 06:04 AM

obviously its best to build a proper rpm for the dependency, but if you're in a hurry, you can always edit the spec file (that is, if you can get the SRPM for the package).
1) install rpmbuild
2) do an rpm2cpio foo.src.rpm |cpio -id
3) remove the BuildRequires line for the dependency lib
3) copy the spec to /usr/src/redhat/SPECS, the tar to /usr/src/redhat/SOURCES
4) change to /usr/src/redhat
5) run rpmbuild -bb SPECS/foo.spec
6) install the new rpm in /usr/src/redhat/RPMS

alanhr 10-20-2008 04:04 AM

Excellent! Thank you all for the helpful tips! I will look into packaging my own rpms for locally compiled software. It looks like it might be a fairly involved process, though, so for the short term I might just have to live with side-by-side installations of multiple version of a few things. No big deal, as long as the number of those remains manageable....

abolishtheun 10-20-2008 06:27 AM

building rpms can be either trivial or excruciating. Usually, if the package uses automake/autoconf/etc, the spec file can be trivial and its worth building the package... on the other hand if the package uses hard coded directories, custom/buggy build scripts, etc, its best to install from source.


All times are GMT -5. The time now is 03:14 PM.