Re: Running a command in spec file?

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

 



Dne 29.8.2013 10:19, Stanislav Ochotnicky napsal(a):
Quoting Dave Johansen (2013-08-28 21:58:38)
On Wed, Aug 28, 2013 at 9:13 AM, Remi Collet <Fedora@xxxxxxxxxxxxxxxxx> wrote:
Le 28/08/2013 18:09, Dave Johansen a écrit :
I'm trying to make a spec file that uses the devtoolset in RHEL 5/6 (
rhn.redhat.com/errata/RHEA-2013-0175.html ) but I haven't been able
to figure out how to enable devtoolset in the spec file. If I run 'scl
enable devtoolset-1.1 bash' before doing rpmbuild it works, but how do
I run a command like that in the spec file?
In %build:

. /opt/rh/<devtoolset-or-sclname>/enable
The enable script wasn't executable, but sourcing it worked like a charm.
Technically, yes...the above works but doesn't ensure it will keep working. I
believe normally this convoluted way is proper way to execute some commands in
an SCL within spec file:

%{?scl:scl enable %{scl} "}
# this is a shell
command 1
command 2
...
%{?scl:"}

This way you can use the same spec file as SCL and out of SCL.


Or using heredoc sytax:

%{?scl:scl enable %scl - << \EOF}
# this is a shell
command 1
command 2
...
%{?scl:EOF}



Vít
--
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