rpm macro magic help

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Fri Nov 1 17:23:35 UTC 2013


On Fri, Nov 1, 2013 at 6:16 PM, Panu Matilainen
<pmatilai at laiskiainen.org> wrote:
> On 11/01/2013 05:12 PM, Sandro Mani wrote:
>>
>>
>> On 01.11.2013 16:09, Sandro Mani wrote:
>>>
>>>
>>> On 01.11.2013 16:07, Dridi Boukelmoune wrote:
>>>>
>>>> On Fri, Nov 1, 2013 at 3:59 PM, Sandro Mani <manisandro at gmail.com>
>>>> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> I'm trying to do some rpm macro magic:
>>>>>
>>>>> %define do_build() \
>>>>> mkdir build_win%{1}_%{2}; \
>>>>> (cd build_win%{1}_%{2}; \
>>>>> %{mingw%{1}_qmake_%{2}} 'PREFIX=%{mingw%{1}_prefix}'
>>>>> 'TARGET=quazip-%{2}'
>>>>> ../libquazip; \
>>>>> %{mingw%{1}_make} %{?_smp_mflags}; \
>>>>> )\
>>>>> %{nil}
>>>>
>>>> According to the guidelines you should use %global instead of %define.
>>>>
>>> Oh right, true.
>>>
>> Actually "macro functions" (if that is what one can call them) don't
>> seem to work with %global, only with %define.
>
>
> Yes, because the body of a %global is expanded at the time of definition,
> whereas %define is expanded at time of use. The guideline seems to cause at
> least as much confusion as it was supposed to eliminate, because everybody
> just remembers about the guideline is that "using %define is somehow bad"
> when that's not the case.

That being said, I wish Fedora's rpm documentation were better
referenced at the time I started packaging stuff for my $dayjob. It's
generally much more comprehensive than maximum rpm :)

>         - Panu -
>
> --
> devel mailing list
> devel at lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/devel
> Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct


More information about the devel mailing list