Apologies for missing this when the recommendation of %global over %define in Fedora guidelines was being discussed, but better late than never...
https://fedoraproject.org/wiki/Packaging/Guidelines#.25global_preferred_over... says "The two macro defining statements behave the same when they are a the top level of rpm's nesting level" but this is not correct:
The body of a %global macro is expanded at definition time, whereas the body of a %define is expanded only when used. For many uses it doesn't make any difference but identical they are not, even on top level - for example see the attached example spec:
$ rpmbuild -bp macroex.spec 2>/dev/null|grep ^case case1: first - second case2: second - %{xxx}
Another example of this difference (in case of parametrized macros): https://bugzilla.redhat.com/show_bug.cgi?id=495658
- Panu -
packaging@lists.fedoraproject.org