On 08/29/2013 12:04 PM, Dave Johansen wrote:This scriplet:
So does that mean that this is the correct statement to put in the .spec file?
%{?scl:scl enable %{scl} "}
source /opt/rh/devtoolset-1.1/enable
%{?scl:"}
What is the %{?scl} macro doing? And am I using it correctly in the above?
command 1
%{?scl:scl enable %{scl} "}
%{?scl:"}
basicaly expand to:
%if 0%{?scl}
scl enable "command 1"
%endif
Therefore your scriplet:would expand to:
%{?scl:scl enable %{scl} "}
source /opt/rh/devtoolset-1.1/enable
%{?scl:"}
%if 0%{?scl}
scl enable "source /opt/rh/devtoolset-1.1/enable"
%endif
which does not have sense.
I see that you want to enable SCL and from that moment you want to have collection enabled.
This is not recommended (and therefore there is no such tool to do that).
You must enable collection for each specific command. Or block of commands by heredoc syntax.
For operating on command line, you can do:
scl enable devtoolset-1.1 bash
which will open you shell where collection is enabled until you exit. But for spec file, please enable collection for each command/block.