我正在尝试构建我的第一个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”我收到此错误:
+ STATUS = 0
+'['0 -ne 0']'
+ cd test-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命令不会使目录生成脚本错误。我不知道现在该做什么。
我的spec文件:更多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
任何想法?
谢谢你的帮助
加里
答案 0 :(得分:5)
RPM(或者,确切地说,%setup宏)期望您的源tarbal test-1.c55 ....包含目录test-1。
如果目录不同,您可以使用
解决该问题%setup -n yourdir
有关详细信息,请参阅http://www.rpm.org/max-rpm/s1-rpm-inside-macros.html。