rpmbuild: how to skip generation of "debuginfo" packages (without change SPEC file ; neither .rpmmacros)
Asked Answered
F

2

16

We need to (re)generated third party packages on EL7 but we don't want to change SPEC file as suggested (%define debug_package %{nil} https://www.redhat.com/archives/shrike-list/2003-April/msg00069.html) and neither changing the ~/.rpmmacros file as it is on a shared box for RPM build.

Is there any way to solve this via command line (additional parameter) with rpmbuild?

Faucher answered 2/5, 2016 at 12:58 Comment(0)
F
24

After many tests I found the solution. In fact, it is possible to define debug_package outside of the SPEC file, using --define. Which gives:

rpmbuild --define "debug_package %{nil}" -ba SPECS/original.spec

Result is: I don't modify the third party SPEC file and no RPM -debuginfo is generated.

Faucher answered 8/5, 2016 at 15:18 Comment(1)
AFAICT, this method doesn't work at all, any more. You cannot override this macro in the spec file or on the command line.Galahad
M
2

rpmbuild --rebuild --nodebuginfo file.src.rpm -- this still generates debuginfo rpms

Another solution:

cat /etc/rpm/macros 
%debug_package %{nil}
Mcferren answered 17/3, 2021 at 22:1 Comment(1)
This option works, as of today.Galahad

© 2022 - 2024 — McMap. All rights reserved.