In construct like %ifarch someotherarch %define foo bar %endif the %define is expanded (thus %foo defined) even though it shouldn't. The fix is that if spec->readStack->reading is 0, we skip the definition. This may be done on low level (in %define, %global, ... definitions) or at higher level: we simply don't call expandMacros() in copyNextLine() function. I like the latter more, see the attached patch.
Created attachment 248 [details] a fix
Fixed in rpm-4.0-0.43 and rpm-3.0.5-0.4. Thanks for another critical fix.