新手rpmbuild错误

发布于 2024-10-04 05:51:28 字数 1623 浏览 6 评论 0原文

我正在尝试构建我的第一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

天邊彩虹 2024-10-11 05:51:29

RPM(或者准确地说,%setup 宏)期望您的源 tarbal test-1.c55.... 包含目录 test-1。

如果目录不同,您可以使用

%setup -n yourdir

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

%setup -n yourdir

See http://www.rpm.org/max-rpm/s1-rpm-inside-macros.html for more details.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文