In the past, this has been a problem with EPEL packages as various software upstreams focus on newer toolkits to meet their development needs. This has lead to many packages to either be removed or left to mummify at some level. The problem occurs outside of EPEL also which is why Red Hat has created a product called Developer Toolset (DTS) which contains newer gcc and other tools. This product uses software collections which have had a mixed history with Fedora and EPEL but was considered useful in this limited use.
How to Use DTS in spec files
In order to use DTS in a spec file you will need to do the following:
- If you are not using mock and fedpkg to build packages, you will need to add either the Red Hat DTS channel to your system or if you are using CentOS/Scientific Linux, you can add the repository following these instructions.
- If you are using mock/fedpkg, the scl.org repository should be available in the epel mock configs.
- In the spec file add the following section to the top area:
Then in the build section add the following:%if 0%{?rhel} == 7 BuildRequires: devtoolset-7-toolchain, devtoolset-7-libatomic-devel %endif
%build %if 0%{?rhel} . /opt/rh/devtoolset-7/enable %endif
- Attempt to do a build using your favorite build tool (rpmbuild, mock -r , fedpkg mockbuild, etc).
This should start finding what things you might need to add in to the buildrequires similar problems. We in the EPEL Steering Committee would like to get feedback on this and work out what additions are needed to get this working for other developers.
Note:
There are several caveats to using the Developer ToolSet in EPEL.
- Packages may only have a BuildRequire: on the packages in the DTS. If your package will need to Require: something in the DTS or Software-collections, it can NOT be in EPEL at this time as many users do not have this enabled or used.
- This is only for EPEL-7. At the moment, I have not set up DTS for EL-6 because it was not asked for recently. The Steering Committee would like to hear from developers if they want it enabled in EL-6.
- The architectures where DTS exists are: x86_64, ppc64le, and aarc64. There is no DTS for ppc64 and we do not currently have an EPEL for s390x.
Thanks:
Our thanks to Tom Callaway and many other developers for his patience on getting this working.
CORRECTIONS:
- Originally the article stated that the text %if 0%{?rhel} == 7 should be used. That fails. The correct code is %if 0%{?rhel}
- If you build with mock, you are restricted to only pulling in the DTS packages. Currently koji does not have this limitation which is being fixed.
No comments:
Post a Comment