简体   繁体   English

我正在尝试使用SPEC文件创建自定义RPM。

[英]I'm trying to create custom RPM using SPEC file.

demo.spec 演示规范

Name:           demo
Version:        1
Release:        0
Summary:        demo apss

Group:          Applications/Archiving

License:        GPLv2+

URL:            http://xyz.co.in

Source0:        %{name}-%{version}.%{release}.tar.gz

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)


Requires:       tar

%description


%prep

%setup -q


%build

%configure

make %{?_smp_mflags}


%install

rm -rf $RPM_BUILD_ROOT

make install DESTDIR=$RPM_BUILD_ROOT


%clean

rm -rf $RPM_BUILD_ROOT


%files

%defattr(-,root,root,-)

%doc

/demo/


%changelog

Output Error : 输出错误

Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.IEtaZH

+ umask 022

+ cd /root/rpmbuild/BUILD

+ cd /root/rpmbuild/BUILD

+ rm -rf demo-1

+ /bin/tar -xf -

+ /usr/bin/gzip -dc /root/rpmbuild/SOURCES/demo-1.0.tar.gz

+ STATUS=0

+ '[' 0 -ne 0 ']'

+ cd demo-1

/var/tmp/rpm-tmp.IEtaZH: line 34: cd: demo-1: No such file or directory

**error: Bad exit status from /var/tmp/rpm-tmp.IEtaZH (%prep)**

RPM build errors : RPM构建错误

`Bad exit status from /var/tmp/rpm-tmp.IEtaZH (%prep)`

Please help me in solving this issue 请帮我解决这个问题

You are probably having an issue due to how your tarball is structure. 由于您的tarball的结构,您可能遇到了问题。 This section is the relevant area: 本节是相关领域:

+ /usr/bin/gzip -dc /root/rpmbuild/SOURCES/demo-1.0.tar.gz

+ STATUS=0

+ '[' 0 -ne 0 ']'

+ cd demo-1

So the failure is when you try to move into that directory with setup, it expects that directory (demo-1) to exist within your tarball. 因此,失败是当您尝试通过安装程序进入该目录时,它期望该目录(demo-1)存在于tarball中。 The spec file you have provided is incomplete and will continue to provide errors even after you resolve this. 您提供的规范文件不完整,即使您解决了该问题,它仍会继续提供错​​误。 You should review the TLDP and Fedora documentation before you attempt to build this again. 在尝试再次构建它之前,应查看TLDPFedora文档。

There was a similar question asked on Stack Overflow previously. 之前在Stack Overflow上曾问过类似的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM