Adding capabilities to an RPM

Hi.
I downloaded a package that could only be installed on RHEL5, and not 4 or 3, so I got the source in order to compile it on RHEL 3 so hopefully it will work on all versions.

So I have the source for a working package, but when I build it in RHEL 3 and then try to install it in RHEL 5, it has a dependency, let's call it libX.so.5. I'm trying to add this capability to the package so I can recompile it and then use it on RHEL 3 4 and 5 without dependencies. However, I have no experience with building RPMs.

I've tried adding /usr/lib/libX.so.5 to the files list in the spec file, but it doesn't seem to have removed the dependency.

Anyone know how I can do this? Basically, I'm trying to add a file/capability to a package so that it's no longer a seperate dependency.

More information: The package also had a subpackage that, to build, required too high a version of python, so i deleted the subpackage's spec file and directory. This is information in case that may have broken something.

Thanks!
Boaz

This is a danger in using rpms not specifically meant for your distribution. The other option is to see if you can extract that file from the RPM that provides it, put it into /usr/lib and seeing if that will allow it to complete.

An alternative, though not any safer, is to find any file such as:
/usr/lib/libX.so.3 and create a symbolic link to /usr/lib/libX.so.5

This can break things.

But isn't there a way to include libX.so.5 *in* the package i'm rebuilding? That way I don't have to do anything seperate when I try to install it on other systems, and it just works?

Try to use static linking instead; that will result in a bigger binary, but it will not require any external libraries.

That sounds promising, though like I said I'm new to this. How do I do that?

In the trivial case, add -static to the CCFLAGS in the Makefile.

static\ linking - Google Search also brings up a lot of useful and interesting hits.

So to really include the library file I want, would I have to edit the Makefile as well as the spec file?