Skip to content

Commit

Permalink
Upstream debuginfo enablement
Browse files Browse the repository at this point in the history
All these years, enabling debuginfo has required distros to hijack the
spec %install section with a macro like this:

    %install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package}}}\
    %%install\
    %{nil}

This for a widely used, longtime upstream supported feature is just
gross, and also very non-obvious, feeble and whatnot. And totally
prevents the new append/prepend options from being used with %install.

Turn this isto a proper macro in __spec_install_template that drops the
package definition into a .SPECPART file. This way debuginfo can be part
of the %install script without messing up the parsing.

Fixes: rpm-software-management#2204
Fixes: rpm-software-management#1878
  • Loading branch information
ffesti committed Apr 22, 2024
1 parent 2e9d64a commit 341ac45
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 4 additions & 2 deletions macros.in
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,12 @@ package or when debugging this package.\
%{nil}

%debug_package \
%ifnarch noarch\
%global __debug_package 1\
%(cat > "%{specpartsdir}/rpm-debuginfo.specpart" << EOL\
%_debuginfo_template\
%{?_debugsource_packages:%_debugsource_template}\
%endif\
EOL\
)\
%{nil}

%_langpack_template() \
Expand Down Expand Up @@ -878,6 +879,7 @@ Supplements: (%{name} = %{version}-%{release} and langpacks-%{1})\
%{nil}
%__spec_install_template #!%{__spec_install_shell}\
%{__spec_install_pre}\
%[ "%{_target_cpu}" != "noarch" ? "%{?_enable_debug_packages:%{?buildsubdir:%{debug_package}}}" : ""]\
%{nil}

#%{__spec_install_body}\
Expand Down
4 changes: 0 additions & 4 deletions tests/data/macros.debug
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
%{__os_install_post}\
%{nil}

%install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package}}}\
%%install\
%{nil}

# Should missing buildids terminate a build?
%_missing_build_ids_terminate_build 1

Expand Down

0 comments on commit 341ac45

Please sign in to comment.