Re: rpmbuild --define - some rpm sorcerer around?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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    ricks@xxxxxxxxxxxxxx -
- AIM/Skype: therps2        ICQ: 226437340           Yahoo: origrps2 -
-                                                                    -
-                He who laughs last thinks slowest.                  -
----------------------------------------------------------------------
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxxxxxx/message/QQKIARPONU23CVC2WHTBTXSH4O7XSQU5/



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux