【问题标题】:rpmbuild spec file ignore file that does not existrpmbuild 规范文件忽略不存在的文件
【发布时间】:2010-01-11 11:21:00
【问题描述】:

如果文件列表中的文件不存在,是否可以告诉 rpmbuild 规范文件忽略该文件?

类似:

%files
%{existingfile}
if [ -f %{dtdfile} ]; then
%{dtdfile}
fi

【问题讨论】:

  • 请不要那样做。包含该文件或将其删除。
  • 这个规范文件是模板的一部分,被许多不同的包用作起点,包之间的唯一区别(就打包者而言)是有时一个特定文件将存在,有时不存在。目前,在 %prep 脚本中,我正在检查文件并在它不存在时触摸它,我只是认为可能有一种更优雅的方法。

标签: linux rpmbuild


【解决方案1】:

听起来子包可以帮助你。

在主包中可以包含所有公共文件,然后每个子包可以返回主包,还可以包含该包特有的任何附加文件。

http://fedoraproject.org/wiki/How_to_create_an_RPM_package#Subpackageshttp://www.rpm.org/max-rpm/s1-rpm-subpack-spec-file-changes.html

【讨论】:

    猜你喜欢
    • 2023-03-08
    • 2011-11-16
    • 2016-02-07
    • 2022-06-22
    • 2018-11-18
    • 2015-08-25
    • 2020-06-19
    • 2011-01-12
    • 2017-10-10
    相关资源
    最近更新 更多