【问题标题】:rpmbuild Installed (but unpackaged) files sourcerpmbuild 已安装(但未打包)的文件源
【发布时间】:2023-03-15 22:25:01
【问题描述】:

我正在尝试从 REDHAT 6 系统上的二进制文件构建 RPM。我将所有文件都包含在 %files 部分 (find /path/to/fake/install -type f >> specfile)

当我运行 rpmbuild -bb specfile --target x86_64 时,我得到了

Checking for unpackaged file(s): /usr/lib/rpm/check-files /path/to/rpmbuild/BUILDROOT/Package-1.0.0-1.el6.x86_64
error: Installed (but unpackaged) file(s) found:

RPM build errors:
    Installed (but unpackaged) file(s) found:

请注意,错误消息中未列出任何文件。我不确定出了什么问题,有什么想法吗?

【问题讨论】:

    标签: linux packaging redhat rpm rpmbuild


    【解决方案1】:

    您可以通过使用忽略这些类型的错误

    %define _unpackaged_files_terminate_build 0
    

    See also

    【讨论】:

    • 致从谷歌来到这里的人:上面的答案很危险,应该非常小心地使用。在使用此方法之前,请仔细查看您的 %build 和 %install 部分,并确保您已经考虑了它们在 %files 部分中生成的每个文件
    【解决方案2】:

    我猜你的 /path/to/fake/install 不正确。

    %files 部分中的路径必须是最终安装文件的路径,例如/usr/local/bin/myprog。在 rpm 构建期间,在 %build 部分中,您需要确保将文件放在您在 %files 部分中指定的相同位置,或者使用 rpmbuildbuildroot 选项并使用 @987654328您的规范文件中的 @ 变量,其子路径与 %files 列表匹配,在此示例中为 $RPM_BUILD_ROOT/usr/local/bin/myprog。详情请见http://www.rpm.org/max-rpm-snapshot/ch-rpm-anywhere.html

    【讨论】:

    • 请注意,我是从现有的二进制文件生成 RPM(没有 %build)。我的 %files 看起来像: /usr/share/foo /opt/foo/bar 我的目录结构是: /path/to/rpmbuild/usr/share/foo /path/to/rpmbuild/opt/foo/bar
    • 在运行 rpmbuild 时是否将 buildroot 选项设置为 /pat/to/rpmbuild?
    【解决方案3】:

    可能发生这种情况的一个示例:假设在%post 部分有一个%install_info,而在%postun 部分有一个关联的%install_info_delete。这需要在%install 部分中使用rm -f %{buildroot}/%{_infodir}/dir 之类的命令显式删除信息文件的中间目录。

    【讨论】:

      猜你喜欢
      • 2017-06-20
      • 2013-05-10
      • 2011-11-03
      • 2013-12-21
      • 2023-03-23
      • 1970-01-01
      • 1970-01-01
      • 2020-12-02
      • 2012-01-05
      相关资源
      最近更新 更多