There is no easy to tell from a spec file if we are cross-building a rpm. You can use %if %{_target_cpu} != %{_build_cpu} ... %endif But it doesn't work with # rpm --target=i686 ... on ia32. I think we need _build_arch so that we can do %if %{_arch} != %{_build_arch} ... %endif
Created attachment 15785 [details] Add _build_arch
These are rpm-build, not rpm, issues ...
Fixed in my next checkin, should be in rpm-4.0.3-0.84.
I have added %if %{_arch} != %{_build_arch} %define cross_compile 1 %else %define cross_compile 0 %endif %{?do_cross_compile:%define cross_compile 1} to many spec files. It will be nice for rpm to define %{cross_compile} automatically.