Take these two input files:
(The testcase also works with Fedora 12, so don't mind the SUSE in there)
#------------------------- ~/.rpmmacros
%prep %?_suse_insert_debug_package%%prep
%package %?_suse_insert_debug_package%%package
%suse_insert_debug_package \
%global _suse_insert_debug_package \\\
%%undefine _suse_insert_debug_package \\\
%%debug_package
#------------------------- test.spec
Name: test
Version: 0
Release: 0
Group: test
Summary: test
License: test
%description
test
%prep
echo prep section
%build
gcc --version
%install
mkdir -p "%buildroot";
%files
#--------- What to do
Run:
rpmbuild -bb test.spec --eval '%suse_insert_debug_package'
It will produce a -debug package.
Now add --target=xyz (pick some xyz for your arch).
No debug package is produced. This seems like a bug, but I am not sure.
* rpm-4.7.1