搜索

此内容没有您所选择的语言版本。

2.10.6. Software Collection Macro Files Support

download PDF
In some cases, you may need to ship macro files with your Software Collection packages. They are located in the %{?scl:%{_root_sysconfdir}}%{!?scl:%{_sysconfdir}}/rpm/ directory, which corresponds to the /etc/rpm/ directory for conventional packages. When shipping macro files, ensure that:
  • You rename the macro files by appending .%{scl} to their names so that they do not conflict with the files from the base system installation.
  • The macros in the macro files are either not expanded, or they are using conditionals, as in the following example:
    %__python2 %{_bindir}/python
    %python2_sitelib %(%{?scl:scl enable %scl '}%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"%{?scl:'})
As another example, there may be a situation where you need to create a Software Collection mypython that depends on a Software Collection python26. The python26 Software Collection defines the %{__python2} macro as in the above sample. This macro will evaluate to /opt/provider/mypython/root/usr/bin/python2, but the python2 binary is only available in the python26 Software Collection (/opt/provider/python26/root/usr/bin/python2).
To be able to build software in the mypython Software Collection environment, ensure that:
  • The macros.python.python26 macro file, which is a part of the python26-python-devel package, contains the following line:
    %__python26_python2 /opt/provider/python26/root/usr/bin/python2
  • And the macro file in the python26-build subpackage, and also the build subpackage in any depending Software Collection, contains the following line:
    %scl_package_override() {%global __python2 %__python26_python2}
    
This will redefine the %{__python2} macro only if the build subpackage from a corresponding Software Collection is present, which usually means that you want to build software for that Software Collection.
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.