[英]Cannot create RPM package
I'm trying to create RPM spec file. 我正在尝试创建RPM规范文件。 Unfortunately I can't find how to fix this issue.
不幸的是,我找不到解决此问题的方法。
I created the rpm build directories using the command rpmdev-setuptree
and I created simple spec file. 我使用命令
rpmdev-setuptree
创建了rpm构建目录,并创建了简单的spec文件。 I placed the source file under SOURCES/test-one-1.0.tar.gz 我将源文件放在SOURCES / test-one-1.0.tar.gz下
This is the spec file: 这是规格文件:
Name: test
Version: 1.0
Release: 1%{?dist}
Summary: test installation script
Group: Utilities
License: GPL
URL: http://oracle-base.com/articles/linux/linux-build-simple-rpm-packages.php
Source0: test-one-1.0.tar.gz
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
#BuildRequires:
#Requires:
%description
test installation script
%prep
%setup -q
%build
%configure
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
#install -d $RPM_BUILD_ROOT/opt/mytest
%clean
rm -rf $RPM_BUILD_ROOT
%files
%dir /opt/mytest
%defattr(-,root,root,-)
%doc
%changelog
When I run the command rpmbuild -bb -v rpm/SPECS/kernel.spec
当我运行命令
rpmbuild -bb -v rpm/SPECS/kernel.spec
I get this output: 我得到以下输出:
[user@laptop ~]$ rpmbuild -bb -v rpm/SPECS/kernel.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.Hqq4KB
+ umask 022
+ cd /home/rcbandit/rpm/BUILD
+ cd /home/rcbandit/rpm/BUILD
+ rm -rf test-1.0
+ /usr/bin/gzip -dc /home/rcbandit/rpm/SOURCES/test-one-1.0.tar.gz
+ /bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd test-1.0
/var/tmp/rpm-tmp.Hqq4KB: line 34: cd: test-1.0: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.Hqq4KB (%prep)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.Hqq4KB (%prep)
[user@laptop ~]$
Can you help me to fix this issue? 您能帮我解决这个问题吗?
%setup
assumes that extracting the source creates a directory with the same name as %name
. %setup
假定提取源会创建一个与%name
同名的目录。 If this is not the case then you should use the -n
argument to specify an alternate directory name. 如果不是这种情况,则应使用
-n
参数指定备用目录名称。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.