How to run a shell command in RPM spec file?

Amumu picture Amumu · May 21, 2012 · Viewed 8.7k times · Source

How do I run a shell command in spec file? I want to execute something similar like:

uname -r | sed s/(...stuff...)/(...stuff...)

Answer

Aaron D. Marasco picture Aaron D. Marasco · May 22, 2012

If you need it in something like a %define or %global or a macro, you can use "%(shell_command)". Note () not {}.