[Fedora-packaging] define versus global !?

Farkas Levente lfarkas at lfarkas.org
Mon Jul 4 22:49:55 UTC 2011


On 06/28/2011 05:42 PM, Toshio Kuratomi wrote:
> On Tue, Jun 28, 2011 at 03:12:26PM +0200, Farkas Levente wrote:
>> On 06/28/2011 02:08 PM, Pierre-Yves Chibon wrote:
>>> On Tue, 2011-06-28 at 13:58 +0200, Farkas Levente wrote:
>>>> does anybody who can tell me the real reason of why:
>>>> ------------------------------------
>>>> %define __debug_install_post %{mingw_debug_install_post}
>>>> ------------------------------------
>>>> works why
>>>> ------------------------------------
>>>> %global __debug_install_post %{mingw_debug_install_post}
>>>> ------------------------------------
>>>> not? 
>>>
>>> Did you check:
>>> https://fedoraproject.org/wiki/Packaging/Guidelines#.25global_preferred_over_.25define
>>>
>>> There are some explanations there.
>>
>> yes but still don't know why can't be used at toplevel and why can't be
>> generated by script.
>>
> I can't tell you why without knowing more about what's being expanded but --
> %global is evaluated when it is defined whereas %define is evaluated when it
> is used.
> 
> Does that help?

not really. so why this line:
------------------------------------
%define __debug_install_post %{mingw_debug_install_post}
------------------------------------
run the %mingw_debug_install_post right after the %install phase, while
this two line do not:
------------------------------------
%global test 1
%{?test: %define __debug_install_post %{mingw_debug_install_post}}
------------------------------------
neither
------------------------------------
%define __debug_install_post %{mingw_debug_install_post}
------------------------------------
thanks.

-- 
  Levente                               "Si vis pacem para bellum!"


More information about the packaging mailing list