Re: Running a command in spec file?

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

 



On 08/29/2013 12:04 PM, Dave Johansen wrote:
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?

This scriplet:

%{?scl:scl enable %{scl} "}
command 1
%{?scl:"}

basicaly expand to:

%if 0%{?scl}
  scl enable "command 1"
%endif

Therefore your scriplet:

%{?scl:scl enable %{scl} "}
source /opt/rh/devtoolset-1.1/enable
%{?scl:"}

would expand to:

%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.

--
Miroslav Suchy, RHCE, RHCDS
Red Hat, Software Engineer, #brno, #devexp, #fedora-buildsys
--
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/devel
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux