【问题标题】:Newbie rpmbuild error新手rpmbuild错误
【发布时间】:2011-05-14 18:39:49
【问题描述】:

我正在尝试构建我的第一个 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" 但 untar 命令不会创建目录,因此脚本会出错。我不知道现在该怎么办。

我的规范文件:更多 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  

有什么想法吗?
感谢您的帮助
加里

【问题讨论】:

    标签: rpmbuild


    【解决方案1】:

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

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

    %setup -n yourdir
    

    更多详情请见http://www.rpm.org/max-rpm/s1-rpm-inside-macros.html

    【讨论】:

    • m1tk4,宾果游戏!那是我所缺少的。我创建了一个 test-1 目录,将文件放入其中,然后对该目录进行 tar 处理。现在它因不同的原因而失败,但它不在主题范围内,我会在询问之前研究错误。谢谢!
    猜你喜欢
    • 2013-11-25
    • 2012-07-10
    • 1970-01-01
    • 2013-03-30
    • 2015-06-17
    • 2011-11-16
    • 2012-01-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多