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:
`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. This section is the relevant area:
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. 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.
There was a similar question asked on Stack Overflow previously.