Compat-db47, numpy and python-matplotlib not in Rocky Linux 8.6 repo

The only place that seems to have the compat-db47 seems to be CentOS 7. The source I did try was from there:

wget http://vault.centos.org/7.9.2009/os/Source/SPackages/compat-db-4.7.25-28.el7.src.rpm

In order to get mock, one has to have EPEL. Therefore,

  1. sudo dnf install epel-release
  2. sudo dnf install mock
  3. Add yourself to group ‘mock’ with: sudo usermod -a -G mock srout (if your account is srout)
  4. Existing session does not auto-detect new group memberships. Log out and log back in.

The mock has multiple target configurations that are stored in /etc/mock/. There is probably symbolic link /etc/mock/default.cfg that points to some config. For config that is used, mock creates a chroot sandbox, installs to it target’s tools and whatever the rebuild requires (but apparently it can fail).
See Building RPM packages with mock | Packagecloud Blog
Also, see man mock

Since the mock does not use host’s development tools, installation of ‘rpcgen’ (which was in glibc-common in el7) on the host does not help; it has to be installed into the chroot environment:

mock -r rocky+epel-8-x86_64 --init
mock -r rocky+epel-8-x86_64 --install rpcgen
mock -r rocky+epel-8-x86_64 --no-clean compat-db-4.7.25-28.el7.src.rpm

Alas, even with this the build fails. This time on compiler error:

../../repmgr/repmgr_net.c: In function '__repmgr_listen':
../../repmgr/repmgr_net.c:1139:2: error: format not a string literal and no format arguments [-Werror=format-security]
  __db_err(env, ret, why);
  ^~~~~~~~

The C compiler, gcc, is version 8.5 in Rocky 8 and has default -std=gnu17 GNU dialect of ISO C17.
The gcc in CentOS 7 has version 4.8 and has default -std=gnu90 GNU dialect of ISO C90 (including some C99 features). I’d guess this is the reason for the error. (The configure output did not show any explicit ‘-std=’ so defaults are likely.)

Can one pass additional compiler options into mock process? Honestly, I don’t know.

If the build had succeeded, then there would be RPM-files in directory /var/lib/mock/rocky+epel-8-x86_64/result/
One would still have to install them with the sudo dnf install name(s)-of-rpm-file(s)