我正在尝试构建我的第一个 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: line 36: cd: test-1: No such file or directory
error: Bad exit status from /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
有任何想法吗?
感谢您的帮助
加里