OS RedHat 8.4
I know that having %debug_package
macro in a spec
file will generate debuginfo for a package, and will produce mypackage-debuginfo-<VERSION>.<ARCH>
rpm. However the funny thing is that spec file I have does not have this macro and yet the debuginfo is built.
However, at the top of the spec
file there is a few global variables:
%global _hardened_build 1
%global sysrepo 0
%undefine _missing_build_ids_terminate_build
%define _unpackaged_files_terminate_build 0
I wonder if one of them enables %debug_package
macro?
Best Answer
TL;DR: Add the following line to your specfile:
You didn't mention what OS this is, but my experience is that debuginfo is generated automatically for binary packages, and you have to specifically disable it for non-noarch packages.
How to disable is documented here: https://docs.fedoraproject.org/en-US/packaging-guidelines/Debuginfo/#_useless_or_incomplete_debuginfo_packages_due_to_other_reasons
And if it doesn't work on your version, you can dig through the output of the following command:
On my Rocky 8.5 version I see that the
debug_package
macro is the one defining the extra package, so setting that to%{nil}
effectively disables it. You can also see hownoarch
packages have no debuginfo.