It looks like they disabled the %debug_package macro and added code to rpmbuild itself that, after writing out a binary subpackage, reads back its file list and gathers up the corresponding debuginfo files and build-id symlinks into a debuginfo subpackage. That's probably the most reasonable approach if one is willing to modify the C code.
Here is the OpenSUSE patch:
https:/ /build. opensuse. org/package/ view_file? file=debugsubpk g.diff& package= rpm&project= openSUSE% 3AFactory
It looks like they disabled the %debug_package macro and added code to rpmbuild itself that, after writing out a binary subpackage, reads back its file list and gathers up the corresponding debuginfo files and build-id symlinks into a debuginfo subpackage. That's probably the most reasonable approach if one is willing to modify the C code.