I’m successfully using Cmake version 3.9.1 (on CentOS 6.9) to build a C++ project, and then using CPack (from CMake) to build two RPMs, a RUNTIME and a DEVEL. I have set the DEVEL to depend upon the RUNTIME using:
This works exactly how I want it to; requiring that the DEVEL package have the exact same release version of RUNTIME installed.
I also use:
To make a separate debuginfo RPM for the code in my runtime RPM. This also works as intended, to a point. If a user has all three RPMs installed, then everything is fine. They then learn an update (of all three RPMs) has been placed in the repo, so they run ‘sudo yum update myRpm-devel’, knowing that this will also update the runtime package. Unfortunately this doesn’t update the debuginfo package, so they are no longer in-sync.
I searched around and tried to use a “CPACK_RPM_<COMPONENT_NAME>_DEBUGINFO_PACKAGE_REQUIRES” variable from CMake, but it didn’t work, and as I’m using CPack to generate my SPEC files I can’t see another way to modify them. CPack only generates two SPEC files, one for the DEVEL and one for the RUNTIME, and the additional instructions to generate the debuginfo are in the RUNTIME’s SPEC file.
Is there a way to set package-requires for debuginfo RPMs?