title: Bad exit status from /var/tmp/rpm-tmp.ajKra4 (%prep)
body: <p>I am having a weird RPM issue, I am new to it so bear with me... I have the spec file created and when I run to do the build I get an error:</p>
  
  <p>/var/tmp/rpm-tmp.ajKra4: line 36: cd: hero-01: No such file or directory
  error: Bad exit status from /var/tmp/rpm-tmp.ajKra4 (%prep)</p>
  
  <p>Then I check that temp file and it is trying to CD to a directory that does not exist..  Should it be creating this in the spec file? if so where?</p>
  
  <p>Here is my spec file:</p>
  
  <pre><code>    Summary: Install Hero
      Name: hero
      Version: 01 
      Release: 1
      Group: Billing reporting
      Source: %{name}-%{version}.tar.gz
      License: SLA
  
      %description
      Hero billing reports system
  
      %prep
      rm -rf %{_topdir}/BUILD/*
  
      %setup
  
      %install
      mkdir -p /opt/%{name}
      cp -r * /opt/%{name}
  
      %post
      find /opt/%{name} -type d -exec chmod 755 {} \;
      find /opt/%{name} -type f -exec chmod 644 {} \;
      chmod -R 755 /opt/%{name}/bin
  
  
  
      %files 
      /opt/%{name}
      %defattr(-,root,root,0755)
  
      %clean
      rm -rf $RPM_BUILD_ROOT
  
      %postun
      rm -rf /opt/%{name}
  </code></pre>
  
  <p>Perhaps I am missing something?  Would not be the first lol, thanks </p>
  
  <p>Here is also what that tmp file is outputting:</p>
  
  <pre><code>    #!/bin/sh
  
        RPM_SOURCE_DIR="/root/rpmbuild/SOURCES"
        RPM_BUILD_DIR="/root/rpmbuild/BUILD"
        RPM_OPT_FLAGS="-O2 -g"
        RPM_ARCH="x86_64"
        RPM_OS="linux"
        export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS
        RPM_DOC_DIR="/usr/share/doc"
        export RPM_DOC_DIR
        RPM_PACKAGE_NAME="hero"
        RPM_PACKAGE_VERSION="01"
        RPM_PACKAGE_RELEASE="1"
        export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE
        LANG=C
        export LANG
        unset CDPATH DISPLAY ||:
        RPM_BUILD_ROOT="/root/rpmbuild/BUILDROOT/hero-01-1.x86_64"
        export RPM_BUILD_ROOT
  
        PKG_CONFIG_PATH="/usr/lib64/pkgconfig:/usr/share/pkgconfig"
        export PKG_CONFIG_PATH
  
        set -x
        umask 022
        cd "/root/rpmbuild/BUILD"
      rm -rf /root/rpmbuild/BUILD/*
  
      cd '/root/rpmbuild/BUILD'
      rm -rf 'hero-01'
      /usr/bin/gzip -dc '/root/rpmbuild/SOURCES/hero-01.tar.gz' | /bin/tar -xvvf -
      STATUS=$?
      if [ $STATUS -ne 0 ]; then
        exit $STATUS
      fi
      cd 'hero-01'
      /bin/chmod -Rf a+rX,u+w,g-w,o-w .
  
      exit 0
  </code></pre>