新手rpmbuild错误
我正在尝试构建我的第一个 RPM,但出现错误。我的 .rpmmarcos 文件如下所示:
%packager Your Name
%_topdir /home/snort/test
%_tmppath /home/snort/test/tmp
%_smp_mflags -j3
%__arch_install_post /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot
当我运行:“rpmbuild -v -bb SPECS/test.spec”时,我收到此错误:
+ 状态=0
+ '[' 0 -ne 0 ']'
+ cd 测试-1 /home/snort/test/tmp/rpm-tmp.55712: 第 36 行: cd: test-1: 没有这样的文件或目录
错误: /home/snort/test/tmp/rpm-tmp.55712 (%prep) 的退出状态错误
文件 rpm-tmp.55712 以此结束:
cd '/home/snort/test/BUILD'
rm -rf 'test-1'
/bin/gzip -dc '/home/snort/test/SOURCES/test-1.c55.tar.gz' | tar -xvvf -
STATUS=$?
if [ $STATUS -ne 0 ]; then
exit $STATUS
fi
cd 'test-1'
我猜 rpmbuild 会执行“rm -rf 'test-1' ” 删除任何旧的/不需要的目录,然后解压 test-1.c55.tar.gz 文件,然后尝试“cd test-1”,但解压命令不会创建该目录,因此脚本会出错。我不知道现在该怎么办。
我的规格文件:更多 SPECS/test.spec
Name: test
Version: 1
Release: .c55
Summary: Just a Test
Group: MyJunk
License: GPL
URL: http://www.somesite.com
Source0: test-1.c55.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%description
This is just a test
<br>
%prep
%setup BUILD
%build<br>
%configure<br>
make %{?_smp_mflags}<br>
%install<br>
rm -rf $RPM_BUILD_ROOT<br>
make install DESTDIR=$RPM_BUILD_ROOT
<br>
%clean<br>
rm -rf $RPM_BUILD_ROOT<br>
%files
%defattr(-,root,root,-)
%doc
%changelog
有什么想法吗?
感谢您的帮助
加里
I'm trying to build my first RPM, but getting an error. My .rpmmarcos files looks like this:
%packager Your Name
%_topdir /home/snort/test
%_tmppath /home/snort/test/tmp
%_smp_mflags -j3
%__arch_install_post /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot
When I run: "rpmbuild -v -bb SPECS/test.spec" I receive this error:
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd test-1
/home/snort/test/tmp/rpm-tmp.55712: line 36: cd: test-1: No such file or directory
error: Bad exit status from /home/snort/test/tmp/rpm-tmp.55712 (%prep)
File rpm-tmp.55712 ends with this:
cd '/home/snort/test/BUILD'
rm -rf 'test-1'
/bin/gzip -dc '/home/snort/test/SOURCES/test-1.c55.tar.gz' | tar -xvvf -
STATUS=$?
if [ $STATUS -ne 0 ]; then
exit $STATUS
fi
cd 'test-1'
I'm guessing rpmbuild does the "rm -rf 'test-1'" to remove any old/un-needed directories, then it untar's the test-1.c55.tar.gz file, then tries to "cd test-1" but the untar command doesn't make the directory so the scripts errors out. I'm not sure what to do now.
My spec file: more SPECS/test.spec
Name: test
Version: 1
Release: .c55
Summary: Just a Test
Group: MyJunk
License: GPL
URL: http://www.somesite.com
Source0: test-1.c55.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%description
This is just a test
<br>
%prep
%setup BUILD
%build<br>
%configure<br>
make %{?_smp_mflags}<br>
%install<br>
rm -rf $RPM_BUILD_ROOT<br>
make install DESTDIR=$RPM_BUILD_ROOT
<br>
%clean<br>
rm -rf $RPM_BUILD_ROOT<br>
%files
%defattr(-,root,root,-)
%doc
%changelog
Any ideas?
Thanks for the Help
Gary
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
RPM(或者准确地说,%setup 宏)期望您的源 tarbal test-1.c55.... 包含目录 test-1。
如果目录不同,您可以使用
See http 来修复该问题://www.rpm.org/max-rpm/s1-rpm-inside-macros.html 了解更多详细信息。
RPM (or, to be exact, %setup macro) expects your source tarbal test-1.c55.... to contain the directory test-1.
If the directory there is different, you can fix that by using
See http://www.rpm.org/max-rpm/s1-rpm-inside-macros.html for more details.