Can I use nested macros in a .spec file ?
Sandro Mani
manisandro at gmail.com
Tue Mar 4 23:57:52 UTC 2014
On 04.03.2014 20:22, Sébastien Boisvert wrote:
> Hi,
>
>
> My package (Ray) relies on mpich2. The new name for mpich2 is mpich, but the name is still
> mpich2 in el6.
>
> So I defined a variable named mpichName.
>
> I was wondering why nested macros like this
> one are not working:
>
> %{_%{mpichName}_load}
>
>
> However, this works, but it is longer:
>
> %if %mpichName == "mpich"
> %{_mpich_load}
> %else
> %{_mpich2_load}
> %endif
>
>
> Is there a syntax to use "%{_%{mpichName}_load}" (or is there a better way to do it) ?
Yes, this should work:
%{expand:%%{_%{mpichName}_load}}
Sandro
More information about the devel
mailing list