为什么 rpmbuild(1) 忽略以“Source:”命名的压缩 tar(1) 文件? RPM“规格”中的标签文件?
文件ldm.spec
Source: /web/ftp/pub/ldm/%{name}-%{version}.tar.gz
在其第一部分中包含该行。 %{name} 和 %{version} 设置正确。给定的文件确实存在。
命令 rpmbuild --nobuild ldm.spec
错误退出,并显示消息“
error: File /home/steve/rpmbuild/SOURCES/ldm-6.9.8.tar.gz: No such file or directory
必须做什么才能使其正常工作?”
附加信息:
$ uname -a
Linux gilda.unidata.ucar.edu 2.6.27.41-170.2.117.fc10.x86_64 #1 SMP Thu Dec 10 10:36:29 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
$ rpmbuild --version
RPM version 4.6.1
The file ldm.spec
contains the line
Source: /web/ftp/pub/ldm/%{name}-%{version}.tar.gz
in its first section. %{name} and %{version} are set correctly. The given file does exist.
The command rpmbuild --nobuild ldm.spec
error-exits with the message
error: File /home/steve/rpmbuild/SOURCES/ldm-6.9.8.tar.gz: No such file or directory
What must be done to get this to work?
Additional information:
$ uname -a
Linux gilda.unidata.ucar.edu 2.6.27.41-170.2.117.fc10.x86_64 #1 SMP Thu Dec 10 10:36:29 EST 2009 x86_64 x86_64 x86_64 GNU/Linux
$ rpmbuild --version
RPM version 4.6.1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
默认情况下,rpmbuild 期望源文件的 basename() 存在于 %_topdir/SOURCES 目录中,无论它在哪里另有说明。在规范文件中,您经常会看到一个 URL (wget.spec):
它不会在构建时获取它,即使它位于您自己的文件系统上。 “没有这样的文件或目录”错误来自 %setup 宏在默认位置查找文件,但没有看到它。
解决方案是将文件复制(或创建符号链接)到 rpmbuild/SOURCES 目录。
如果您出于某种原因不想将该文件复制到用户的 SOURCES 目录中,则可以使用 %setup mecro 的 -T 选项,它告诉它“不执行默认存档解包”
:如果您选择走这条路线,则必须在 %prep 部分自行解压存档。
By default, rpmbuild expects the basename() of the source file to exist in the %_topdir/SOURCES directory, regardless of where it otherwise states. In spec files you'll often see a URL (wget.spec):
It doesn't fetch it at build time, even if it was on your own filesystem. The "No such file or directory" error comes from the %setup macro looking for the file in the default location, and not seeing it.
The solution is to copy (or make a symlink) of the file to your rpmbuild/SOURCES directory.
If you, for whatever reason, don't want to have to copy that file to your user's SOURCES directory, you can use the the -T option to the %setup mecro, it tells it to "Not Perform Default Archive Unpacking":
You'll have to unpack the archive yourself in the %prep section, if you choose to go this route.