rpm dependencies: providing capabilities

artichoke

Verified User
Joined
Jan 23, 2006
Messages
43
Location
San Jose, California, USA
As you all probably know, each rpm exports some "capabilities" that represent which features it provides. For example, on an RHEL/CentOS machine that includes a stock httpd, typing "rpm -q --provides httpd" will give you a list that includes "webserver" and 'httpd".

And software installed as an rpm will specify which capabilities must already exist somewhere. A stock squirrelmail rpm, for example, requires certain capabilities that can be listed with "rpm -q --requires squirrelmail". These include "httpd" and "perl", for example.

The problem occurs when you replace one of these rpms by compling from source, as DirectAdmin's "build" script does. The capabilities provided by the original rpms are no longer present. Now some rpm updates and installs will fail.

The normal way of working around this is to install/update rpms using the "--nodeps" flag. This makes things error-prone, as you will not detect missing dependencies.

It occurred to me that i could write a script that would scan for common programs installed from source, and then build a small rpm that exports all the appropriate capabilities. These capabilities would correspond to the software already present on the system. This would allow other rpms, that need those capabilities, to be installed without the --nodeps flag.

I ran into a problem, though. I have not been able to successfully use the "Provides:" tag in a spec file to make the rpm actually provide those capabilities. It's as if the "rpmbuild" command simply ignores the "Provides" tag.

I may give up on this. But if anybody else is an expert on rpms and spec files, maybe you could try this and make the result available to the rest of us. The basic idea is simple: Just take a list of common programs that were rpms but are replaced by DirectAdmin, look in standard places, get their current revisions, and automatically generate a small rpm that provides the corresponding capabilities.

For example, if the highest revision of libcurl is found in /usr/local/lib/libcurl.so.4, then your rpm would claim to provide libcurl.so.4. Actually, of course, libcurl.so.4 is provided by the already-installed "curl". Now any rpm that requires libcurl.so.4 will install without needing --nodeps.

Rahul
 
It didn't look to me that Rahul was suggesting eliminating RPMs but rather making it easier to use them.

Jeff
 
It didn't look to me that Rahul was suggesting eliminating RPMs but rather making it easier to use them.

Jeff

Yes that's my suggestion they should be built properly is the first issue (ala exim rpm)

Also force installing mysql rpms is bad! I had two versions of mysql because of this.
 
Back
Top