Rpmbuild SPEC file - variable declaration

Reindl Harald h.reindl at thelounge.net
Sun Sep 13 13:53:53 UTC 2015



Am 13.09.2015 um 15:39 schrieb arnaud gaboury:
> On Sun, Sep 13, 2015 at 2:16 PM, Rex Dieter <rdieter at math.unl.edu> wrote:
>> arnaud gaboury wrote:
>>
>>> When declaring a variable value,  I wonder if the any difference/best
>>> practice between these methods:
>>>
>>> export VAR=MyValue
>>> %{define} VAR MyValue
>>> %{global} VAR MyValue
>>
>> best practice is to use global, it is explicitly mentioned here:
>> https://fedoraproject.org/wiki/Packaging:Guidelines#.25global_preferred_over_.25define
>
> Very good. TY for short and precise answer.
>
> Now, for build flags macros and variables, I want to add some options
> to the default one. I am not sure how to add options in a clean way.
> These extra flags are used because I build with Intel Compiler:
>
> export CFFLAGS= '-xHost -mavx -fp-model precise'
> %configure
>     CFFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \
>     ........
>
> Is above the the best way?

no

* there is no reason to mention CFLAGS in %configure again
* you don't want the default macro at the end because
   it would probably override your overrides
* export CFFLAGS="%optflags -xHost -mavx -fp-model precise"

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.fedoraproject.org/pipermail/devel/attachments/20150913/3116f940/attachment.sig>


More information about the devel mailing list