【问题标题】:rpmbuild error file not found even though files are in the path即使文件在路径中,也找不到 rpmbuild 错误文件
【发布时间】:2016-05-18 17:01:08
【问题描述】:

我执行了以下操作,但在运行 rpmbuild 时出错

文件在路径中

感谢任何帮助或提示

谢谢

rpmbuild -vv --buildroot $PWD/root --target x86_64 -bb bin-show.spec
Building target platforms: x86_64
Building for target x86_64
Processing files: helloworld-1.0-1.x86_64
error: File not found: /nobackup/username/prod/packaging/redhat/bin-show/root/etc/testpackage.conf


RPM build errors:
    File not found: /nobackup/username/prod/packaging/redhat/bin-show/root/etc/testpackage.conf

在哪里 bin-show.spec

#
# Hello World Spec File
#
Summary: Hello world!
Name: helloworld
Version: 1.0
Release: 1
License: Proprietary
Group: Applications/Utilities

%description
This is my first RPM test package!

%files
/etc/testpackage.conf

和文件结构

pwd
/nobackup/username/prod/packaging/redhat/bin-show

find . -name \*

./bin-show.spec
./root
./root/etc
./root/etc/testpackage.conf

【问题讨论】:

    标签: linux build redhat rpm rpmbuild


    【解决方案1】:

    来自rpmbuild 的消息可能不明显。大概是在抱怨

    • 不是您的文件系统缺少该文件,
    • 而是BUILDROOT目录下不存在对应的路径名。

    它通常期望您的规范文件将在~/rpmbuild/BUILDROOT 下构造一组文件和目录,并将其收集到一个包中。您可以覆盖BUILDROOT 目录的位置(并且似乎已经这样做了)。但是您的包裹需要

    /etc/testpackage.conf
    

    并且(考虑到BUILDROOT 目录的明显位置)你已经给了它

    /root/etc/testpackage.conf
    

    【讨论】:

      【解决方案2】:

      Thomas 关于错误的根源几乎是正确的。

      然而 rpmbuild 期望该文件存在于

      %{buildroot}/%{_sysconfdir}/testpackage.conf
      

      您应该在%install 部分中创建它:

      %install
      echo some content > %{buildroot}/%{_sysconfdir}/testpackage.conf
      

      或作为 SourceX 提供:

      Source1:  testpackage.conf
      
      %install
      cp -a %{SOURCE1} %{buildroot}/%{_sysconfdir}/
      
      %files
      %{_sysconfdir}/testpackage.conf
      

      【讨论】:

        猜你喜欢
        • 2019-06-27
        • 1970-01-01
        • 1970-01-01
        • 2017-05-26
        • 2013-07-16
        • 2022-07-12
        • 2021-03-16
        • 1970-01-01
        • 2018-01-19
        相关资源
        最近更新 更多