How do I build custom rpm in scl environment?

Solution In Progress - Updated -

Issue

  • We are building an RPM that uses DevToolSet-3 (DTS3) for the compilation.
  • What's the recommended way to write its SPEC, in particular the %build section?
  • METHOD A (just the %build section)
%build
cat <<DTS3_EOF_MACRO | scl enable devtoolset-3 --
./configure <...parameters...>
make clean
make
DTS3_EOF_MACRO
  • METHOD B (just the %build section)
%build
. /opt/rh/devtoolset-3/enable
./configure <...parameters...>
make clean
make

Method A is the official way of using scl enable, but it has an annoying drawback: it starts a second shell, and hitting Ctrl-C while a build is running sometimes is not effective (it doesn't kill the rpmbuild).

Method B doesn't have the CTRL-C issue, but I haven't found any RH document approving this methodology.

Environment

  • Red Hat Enterprise Linux 6
  • Developer Toolset 3

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.