Web-server – Make Yum recognize that httpd24-httpd (from SCL) provides the webserver virtual package

centos7packagessclweb-serveryum

I've recently discovered software collections and understand how they allow me to install multiple versions of software by introducing a namespace for each collection. On Enterprise Linux, this is neat because I'll be able to keep the the regular stability of my system, while now being able to easily update certain versions of software as they are updated (not just security updates, but features too!)

I'd like my system's main webserver to be httpd 2.4. The version available from centos-sclo-rh software collection is currently 2.4.12, while the version available from base is only 2.4.6. So I installed httpd from that SCL and enabled it:

> scl enable httpd24-httpd bash

And then enabled and started the service using systemctl

> systemctl enable httpd24-httpd
> systemctl start http24-httpd

So I would expect my system should understand that I now have a webserver installed. However, when I try to install phpmyadmin from epel, it still wants to install the standard httpd package from base as a dependency.

Looking in to a bit of the mechanics of rpms, I've just learned that packages can have a Provides line in their spec file listing virtual packages like webserver, and indeed the src rpm for httpd has a Provides: webserver line. I'm guessing that the httpd24-httpd package I obtained from the SCL doesn't have that descriptor.

How can I get my system to recognize the installed and enabled httpd from the SCL provides the webserver virtual package so that it doesn't want to install the httpd package from base to fulfill the webserver virtual dependency?

Best Answer

With RPM Package Manager you can simply provide foo 4 bar. This is a stupid dummy spec example, purists will remove the rpmlint ;-) warnings:

$ cat ~/rpmbuild/SPECS/provides-httpd.spec 
Summary:   Dummy package to provide with httpd for httpd24
Name:      provides-httpd
Version:   0.1
Release:   1%{?dist}
License:   GPLv2
Requires:  httpd24-httpd
Provides:  httpd
BuildArch: noarch

%description
This is a no-brainer dummy package to provide httpd for SCL httpd24

You should read https://serverfault.com/questions/770417/make-yum-recognize-that-httpd24-httpd-from-scl-provides-the-webserver-virtual

%files

Build this with rpmdevtools and friends:

$ rpmbuild -ba ~/rpmbuild/SPECS/provides-httpd.spec

Install the dummy package:

$ sudo yum install ~/rpmbuild/RPMS/noarch/provides-httpd-0.1-1.el7.noarch.rpm