2

I have a series of RPM spec files and no debuginfo directive set in them. When I run rpmbuild, some packages generate a debuginfo rpm, some do not. What is the criteria used by rpm to decide if a debuginfo is generated? It seems to me that:

  • only arch packages generate debuginfo (noarch packages do not)
  • only main package in spec generates debuginfo (subpackages do not)

Someone can confirm if these rules are valid and if there are any others?

I have redhat-rpm-config installed, what is a prerequisite to generate debuginfo packages, according to https://fedoraproject.org/wiki/Packaging:Debuginfo?rd=Packaging/Debuginfo.

1
  • 2
    If what you're really wanting to know is 'why isn't my debug package being build', then you might also check for (wrongly) commented entries like the following: #%define debug_package 1 That looks like a comment, but is not quite. Struck me once; I wrote about it at distracted-it.blogspot.co.nz/2014/08/… Apr 10, 2015 at 11:20

3 Answers 3

2

In order to generate debuginfo RPMs, the directive %debug_package needs to be added to the .spec file (usually, after all package and sub-package definitions and before the %prep section, surrounded by empty lines).

reference: https://trac.netlabs.org/rpm/wiki/RpmHowToPackagers#Generatingdebuginfopackages

another good blog: https://distracted-it.blogspot.com/2014/08/building-rpm-debuginfo-package-not.html

1

%debug_package has to be included in .spec file. I used to write it before %prep stage. Also, __debug_package macro has to be 1.

2
  • how do you set __debug_package macro?
    – explorer
    Sep 20, 2020 at 18:59
  • you dont need to set up __debug_package macro has to be 1. Only setting %debug_package has to be included in .spec file will work.
    – explorer
    Sep 20, 2020 at 19:07
1

Updated answer for 2022.

Debuginfo is automatically generated for binary (architecture is not noarch) packages, unless disabled with the following:

%global debug_package %{nil}

Reference https://docs.fedoraproject.org/en-US/packaging-guidelines/Debuginfo/#_missing_debuginfo_packages

It is normal for noarch package builds to not produce a debuginfo package. If it’s missing in other cases (where it has not been explicitly disabled), something’s wrong. One such case is a missing %build section with some rpmbuild versions.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .