RPM 构建在安装部分失败
我正在尝试构建我的第一个 rpm 包,它是一个简单的可执行文件 (mysh)。
我的规范文件:
Summary: bla <br>
Name: mysh <br>
Version: 1.0 <br>
Release: 1 <br>
Group: Applications <br>
Source: mysh-1.0.tar.gz <br>
URL: http://www.google.com <br>
Vendor: tadas sofware inc. <br>
Packager: tadas <br>
License: GPL
%description <br>
a very good program!
%prep <br>
rm -rf $RPM_BUILD_DIR/mysh-1.0 <br>
zcat $RPM_SOURCE_DIR/mysh-1.0.tar.gz | tar -xvf -
%build <br>
make
%install <br>
cp mysh /usr/local/bin/mysh
%files <br>
/usr/local/bin/mysh
它失败并出现以下错误:
cd: 8: can't cd to /home/tadzys/rpm/BUILDROOT/mysh-1.0-1.x86_64
当然该文件不存在。我已经尝试将其复制到那里仍然存在相同的错误。不确定我的安装部分是否应该将任何内容放入 BUILDROOT 文件夹中。
我使用的是 Ubuntu 11.04。
I am trying to build my first rpm package, which is one simple executable (mysh).
My spec file:
Summary: bla <br>
Name: mysh <br>
Version: 1.0 <br>
Release: 1 <br>
Group: Applications <br>
Source: mysh-1.0.tar.gz <br>
URL: http://www.google.com <br>
Vendor: tadas sofware inc. <br>
Packager: tadas <br>
License: GPL
%description <br>
a very good program!
%prep <br>
rm -rf $RPM_BUILD_DIR/mysh-1.0 <br>
zcat $RPM_SOURCE_DIR/mysh-1.0.tar.gz | tar -xvf -
%build <br>
make
%install <br>
cp mysh /usr/local/bin/mysh
%files <br>
/usr/local/bin/mysh
It fails with the following error:
cd: 8: can't cd to /home/tadzys/rpm/BUILDROOT/mysh-1.0-1.x86_64
Of course this file doesn't exist there. I've tried copying it there still there same error. Not sure if my install section should put anything to BUILDROOT folder.
I am on Ubuntu 11.04.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您在
%install
部分中引用目标计算机中的目录时,您需要引用与$RPM_BUILD_ROOT
(或%{buildroot}):
但是,
%files
部分不需要需要更新。另外,在复制文件时,您应该考虑使用
install
命令。它与cp
类似,但install
允许您设置目标文件的权限位:When you refer to directories in the target machine within the
%install
section, you need to reference everything relative to$RPM_BUILD_ROOT
(or%{buildroot}
):The
%files
section does not need to be updated, however.Also, you should consider using the
install
command when copying files around. It's similar tocp
, butinstall
allows you to set the permission bits for the target file: