I can build rpm, but they have debug symbols, how to handle this?

did my first rpm building, and it works.

but the problem is that the binaries/libraries in the package contain debug symbols,
this happens also with original openSUSE packages which I rebuild, (did this just for test and to see)

my question is therefore, how do I handle this?
I think it is not the right way to make a install-/strip or similar in the build script,
so the better way would possible be building an extra debug rpm.
but how does this work?

Add the following to your spec file after the header:


This will add the necessary stuff to build extra debugsource/debuginfo packages.

this works, great, thank you!

for later,
is there a way to pass this to rpmbuild?
if I test packages local, and when it works,
I submit them to obs build service, the may not contain the debug_macro in the spec file.
or am I wrong?

It is a macro that gets expanded to a package description, file list and so on, see /usr/lib/rpm/macros:

#       Template for debug information sub-package.%debug_package \
%global __debug_package 1\
%package debugsource\
Summary: Debug sources for package %{name}\
Group: Development/Debug\
AutoReqProv: 0\
%description debugsource\
This package provides debug sources for package %{name}.\
Debug sources are useful when developing applications that use this\
package or when debugging this package.\
%files debugsource -f debugsources.list\

But this should work on OBS as well.
If it is present, manually enabling/disabling the debug package build (in the WebUI in “Repositories” f.e.) doesn’t work of course, that is always enabled then.
You could enclose the macro inside in %if…%endif though if you want to.

great info thanks again!
I will test this

when I have more praxis with the macros, sounds very useful