Using a software collection to satisfy an RPM build dependency

While this isn’t specifically a Rocky issue, I figure any answer would be helpful for those rebuilding packages on Rocky.

I want to rebuild the roundcubemail package from Rawhide for my CentOS 7 system, as the package has been removed from EPEL The ancient version had lots of vulnerabilities and updating to one without them would require a newer version of PHP. The latest roundcubemail in Rawhide, 1.6.1, requires PHP 7.3. There’s an rh-php73 in Software Collections. How do I get rpmbuild to accept that to satisfy the dependency? I tried “scl enable rh-php73 – rpmbuild -ba roundcubemail.spec” but that’s not going to see the SCL package to satisfy the dependency. (I also had to add a conditional to the spec file to suppress the Suggests tags that are unrecognized in the older rpmbuild command.)

(Once built, I’d run the package from rh73-php-fpm using a proxy directive in the Apache or nginx config file.)

I managed to get a test build to run to completion. I commented out the PHP >= 7.3 requirements and discovered an unspecified requirement for php-cli because it needs to parse one of the sources and the older PHP doesn’t like its syntax. So I installed rh-php73-php-cli and the package was built.

So I think I need to know how to change the BuildRequires and Requires tags to consider SCL packages.

You need to deep dive into the macro system of rpm. The spec file must provide the corresponding support, then the execution looks like:

rpmbuild --define 'scl rh-php73' --clean -ba --sign rc.spec

The stanza “scl” will be exploded by rpm etc. For an example take a look into:
https://git.remirepo.net/cgit/rpms/scl-php72/php72.git/tree/php72.spec

Do not forget to install the package rh-php73-build

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.