Linux rpmbuild 已安装(但未打包)的文件源
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13401727/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
rpmbuild Installed (but unpackaged) files source
提问by Trevor
I'm trying to build an RPM from binaries on a REDHAT 6 system. I have all the files included in the %files section (find /path/to/fake/install -type f >> specfile)
我正在尝试从 REDHAT 6 系统上的二进制文件构建 RPM。我有 %files 部分中包含的所有文件(find /path/to/fake/install -type f >> specfile)
When I run rpmbuild -bb specfile --target x86_64 I get
当我运行 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:
检查未打包的文件:/usr/lib/rpm/check-files /path/to/rpmbuild/BUILDROOT/Package-1.0.0-1.el6.x86_64 错误:找到已安装(但未打包)的文件:
RPM build errors: Installed (but unpackaged) file(s) found:
RPM 构建错误:找到已安装(但未打包)的文件:
Note that no files are listed in the error message. I'm not sure what's wrong, and ideas?
请注意,错误消息中未列出任何文件。我不确定出了什么问题,有什么想法?
回答by Bernhard
I would guess your /path/to/fake/install is not correct.
我猜你的 /path/to/fake/install 不正确。
The path in the %files
section must be the path where the files will eventually be installed, e.g. /usr/local/bin/myprog
. During the rpm build, in the %build
section you need to make sure you put the files to the very same place you specify in the %files
section, or you use the buildroot
option of rpmbuild
and use $RPM_BUILD_ROOT
variable in your spec file with a sub-path matching the %files
list, in this example $RPM_BUILD_ROOT/usr/local/bin/myprog
. See http://www.rpm.org/max-rpm-snapshot/ch-rpm-anywhere.htmlfor details.
该%files
部分中的路径必须是文件最终安装的路径,例如/usr/local/bin/myprog
. 在 rpm 构建期间,在该%build
部分中,您需要确保将文件放在您在该%files
部分中指定的相同位置,或者在您的规范文件中使用buildroot
选项rpmbuild
和使用$RPM_BUILD_ROOT
变量,并使用与%files
列表匹配的子路径,在这个例子中$RPM_BUILD_ROOT/usr/local/bin/myprog
。有关详细信息,请参阅http://www.rpm.org/max-rpm-snapshot/ch-rpm-anywhere.html。
回答by Like
You can ignore this kind of errors by
您可以通过以下方式忽略此类错误
%define _unpackaged_files_terminate_build 0
%define _unpackaged_files_terminate_build 0
See also http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch09s05s07.html
另见 http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch09s05s07.html