How do I build custom rpm in scl environment?
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
%buildsection)
%build
cat <<DTS3_EOF_MACRO | scl enable devtoolset-3 --
./configure <...parameters...>
make clean
make
DTS3_EOF_MACRO
- METHOD B (just the
%buildsection)
%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, tools, and much more.