title: How to solve No such file or directory error: Bad exit status from (%prep) while building an RPM?
body: <p>I am building an rpm please let me know where i am going wrong,</p>
  
  <p>My spec file is rpms.spec and the contents are:</p>
  
  <pre><code>Summary: GNU indent
  Name: rpms
  Version: 1
  Release: 1
  Source0: %{name}-%{version}.tar.gz
  License: GPL
  Group: Development/Tools
  %description
  The GNU indent program reformats C code to any of a variety of
  formatting standards, or you can define your own.
  %prep
  %setup -q
  %build
  ./configure
  make
  %install
  make install
  %files
  %defattr(-,root,root)
  /usr/local/bin/indent
  %doc /usr/local/info/indent.info
  %doc %attr(0444,root,root) /usr/local/man/man1/indent.1
  %doc COPYING AUTHORS README NEWS
  </code></pre>
  
  <p>I have copied the tar file to /usr/src/redhat/SOURCES/ also
  and then when i do rpmbuild -ba rpms.spec I get the following error</p>
  
  <pre><code>rpmbuild -ba rpms.spec  Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.87218
  + umask 022
  + cd /usr/src/redhat/BUILD
  + LANG=C
  + export LANG
  + unset DISPLAY
  + cd /usr/src/redhat/BUILD
  + rm -rf rpms-1
  + /bin/gzip -dc /usr/src/redhat/SOURCES/rpms-1.tar.gz
  + tar -xf -
  + STATUS=0
  + '[' 0 -ne 0 ']'
  + cd rpms-1 /var/tmp/rpm-tmp.87218: line 35: cd: rpms-1: No such file or directory error: Bad exit status from /var/tmp/rpm-tmp.87218 (%prep)
  </code></pre>
  
  <p>RPM build errors:
      Bad exit status from /var/tmp/rpm-tmp.87218 (%prep)</p>
  
  <p>There is no directory as rpms-1.I tried creating the directory in BUILd directory it didnt work.</p>