我执行了以下操作,但在运行rpmbuild时出错
文件在path中
如有任何帮助或提示,我们将不胜感激
谢谢
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发布于 2016-02-09 17:55:37
来自rpmbuild的消息可能比较模糊。它可能在抱怨
BUILDROOT目录下不存在相应的路径名。它通常期望您的规范文件在~/rpmbuild/BUILDROOT下构造一组文件和目录,并将这些文件和目录收集到一个包中。您可以覆盖BUILDROOT目录的位置(并且看起来已经这样做了)。但你的套餐要求
/etc/testpackage.conf并且(考虑到BUILDROOT目录的明显位置)您已经给了它
/root/etc/testpackage.conf发布于 2016-02-10 07:27:39
关于错误的起源,托马斯几乎是正确的。
但是,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.confhttps://stackoverflow.com/questions/35279698
复制相似问题