On 06/08/2018 03:24 PM, Ulf Volmer wrote:
> On 08.06.2018 23:58, lejeczek via users wrote:
> 
>> $ _def1="_me 1"
>> $ rpmbuild --define=${_def1}
> 
> Try double quotes around your macro:
> 
> $ rpmbuild --define "${_def1}"

The man page specifies:

        --define='MACRO EXPR'

Meaning that the macro "%{MACRO}" in your script would be replaced with
the text "EXPR" (in this example case). Something like:

        --define='_my_macro `uname -r`'

means that "%{_my_macro}" in the script would be replaced with the
result of the "uname -r" command (the backticks around the uname command
are so the command is executed...just like in the shell).

In other words, the argument to the "--define=" flag consists of two
items: the macro name itself and its definition. The macro name and its
definition must be separated by a space. Because they must be separated
by a space, the whole bit after the "=" must be quoted somehow so the
shell doesn't consume them as two separate items.
----------------------------------------------------------------------
- Rick Stevens, Systems Engineer, AllDigital    ri...@alldigital.com -
- AIM/Skype: therps2        ICQ: 226437340           Yahoo: origrps2 -
-                                                                    -
-                He who laughs last thinks slowest.                  -
----------------------------------------------------------------------
_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org/message/QQKIARPONU23CVC2WHTBTXSH4O7XSQU5/

Reply via email to