There's a indeed a bug here but it's not what you think it is...
Macros are scoped so the _extension %define only exists in the {} block of this line:
%{!?_extension:%define _extension .gz}
Or rather, it's *supposed* to only exist in that block, but due to an ages old bug in the macro engine, it doesn't get undefined until you call a (possibly completely unrelated) parametrized macro, %with() in this case.
This is the correct way, not a workaround:
%{!?_extension:%global _extension .gz}
WONTFIX for RHEL 5 to avoid unnecessary breakage there, but fixed upstream now to enforce use of %global in such cases.
There's a indeed a bug here but it's not what you think it is... %define _extension .gz}
Macros are scoped so the _extension %define only exists in the {} block of this line:
%{!?_extension:
Or rather, it's *supposed* to only exist in that block, but due to an ages old bug in the macro engine, it doesn't get undefined until you call a (possibly completely unrelated) parametrized macro, %with() in this case.
This is the correct way, not a workaround: %global _extension .gz}
%{!?_extension:
WONTFIX for RHEL 5 to avoid unnecessary breakage there, but fixed upstream now to enforce use of %global in such cases.