我正在尝试构建我的第一个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“时,我收到这个错误:
错误: /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 -1’“来删除任何旧的/不需要的目录,然后解压test-1.c55.tar.gz文件,然后尝试"cd test-1”,但是untar命令不会创建目录,所以脚本会出错。我不知道现在该怎么办。
我的spec文件: 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 有什么想法吗?
谢谢你的帮助
加里
发布于 2010-12-04 11:21:35
RPM (或者,准确地说,%setup宏)需要你的源码tarbal 1.c55...来包含目录test-1。
如果目录不同,可以使用以下命令进行修复
%setup -n yourdir有关更多详细信息,请参阅http://www.rpm.org/max-rpm/s1-rpm-inside-macros.html。
https://stackoverflow.com/questions/4261565
复制相似问题