Re: Running a command in spec file?

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

 



On Thu, Aug 29, 2013 at 4:09 AM, Miroslav Suchý <msuchy@xxxxxxxxxx> wrote:
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.

Based on my understanding of what you said, this is my best guess at what the lines in the .spec should be:

%{?scl:scl enable devtoolset-1.1 "}
%configure --disable-static
%{?scl:"}

But that doesn't work, so I'm obviously doing something wrong.

If I just do these two lines, then it works:
source /opt/rh/devtoolset-1.1/enable
%configure --disable-static

But my understanding was that there was something wrong with doing that, so what is the proper way to enable the devtoolset-1.1 scl for use with the configure macro?

Thanks,
Dave
-- 
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