title: RPM build errors:Bad exit status from /var/tmp/rpm-tmp.32XJLX (%install)
body: <p>Im trying to create a simple rpm package on centos 6.5.. But i cannot finish it as its giving me errors.. I have already followed these two threads.. <a href="https://stackoverflow.com/questions/21595748/bad-exit-status-from-var-tmp-rpm-tmp-b1dgat-build">Bad exit status from /var/tmp/rpm-tmp.b1DgAt (%build)</a> and <a href="https://stackoverflow.com/questions/9283380/bad-exit-status-from-var-tmp-rpm-tmp-ajkra4-prep">Bad exit status from /var/tmp/rpm-tmp.ajKra4 (%prep)</a> .. yet no luck... </p>
  
  <p>I cannot figure out what i'm missing here.. please help me to fix this.. </p>
  
  <p>this is my </p>
  
  <pre><code>Name:   test
  Version: 1.0    
  Release:    1%{?dist}
  Summary: A test package 
  
  Group:      Testing
  License:    GPL
  URL:        http://www.yahoo.com
  Source0:        test-1.0.tar.gz
  BuildRoot:  %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
  
  BuildRequires:  /bin/rm, /bin/mkdir, /bin/cp
  Requires:   /bin/bash, /bin/date
  
  %description
  this is the test package build for rhche
  
  %prep
  %setup -q
  
  %build
  ./configure
  %install
  rm -rf $RPM_BUILD_ROOT
  make -p $RPM_BUILD_ROOT/usr/local/bin
  cp myscriptdate $RPM_BUILD_ROOT/usr/local/bin
  
  %clean
  rm -rf $RPM_BUILD_ROOT
  
  %files
  %defattr(-,root,root,-)
  %attr(0755,root,root)/usr/local/bin/myscriptdate
  
  %changelog
  * Thu Dec 09 2010 Forrest &lt;forrest@redhat.com&gt; 1.0-1
  -Initial RPM
  -Added /usr/local/bin/myscript
  </code></pre>
  
  <p>Source directory is /test1</p>
  
  <pre><code>[ara@catshit test1]$ pwd
  /test1
  [ara@catshit test1]$ ls -ls
  total 12
  4 drwxrwxrwx. 2 ara ara 4096 Dec  7 00:02 test-1.0
  4 -rw-rw-r--. 1 ara ara  210 Dec  7 00:09 test-1.0.tar.gz
  4 -rwxrwxrwx. 1 ara ara  742 Dec  7 00:17 test.spec
  [ara@catshit test1]$
  </code></pre>
  
  <p>test-1.0 is compressed as test-1.0.tar.gz.
  Inside test-1.0 I have script called myscriptdate which is having following simple code.. </p>
  
  <p>'#!/bin/bash</p>
  
  <p>date</p>
  
  <p>when i try <code>rpmbuild -ba test.spec</code> it gives me </p>
  
  <pre><code># Not a target:
  .f:
  #  Implicit rule search has not been done.
  #  Modification time never checked.
  #  File has not been updated.
  #  commands to execute (built-in):
      $(LINK.f) $^ $(LOADLIBES) $(LDLIBS) -o $@
  
  # Not a target:
  .f.o:
  #  Implicit rule search has not been done.
  #  Modification time never checked.
  #  File has not been updated.
  #  commands to execute (built-in):
      $(COMPILE.f) $(OUTPUT_OPTION) $&lt;
  
  # files hash-table stats:
  # Load=70/1024=7%, Rehash=0, Collisions=278/1660=17%
  # VPATH Search Paths
  
  # No `vpath' search paths.
  
  # No general (`VPATH' variable) search path.
  
  # # of strings in strcache: 0
  # # of strcache buffers: 0
  # strcache size: total = 0 / max = 0 / min = 4096 / avg = 0
  # strcache free: total = 0 / max = 0 / min = 4096 / avg = 0
  
  # Finished Make data base on Sun Dec  7 00:51:01 2014
  
  error: Bad exit status from /var/tmp/rpm-tmp.ZFlmeu (%install)
  
  
  RPM build errors:
      Bad exit status from /var/tmp/rpm-tmp.ZFlmeu (%install)
  </code></pre>
  
  <p>/var/tmp/rpm-tmp.ZFlmeu content is below  </p>
  
  <pre><code>#!/bin/sh
  
    RPM_SOURCE_DIR="/home/ara/rpmbuild/SOURCES"
    RPM_BUILD_DIR="/home/ara/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="test"
    RPM_PACKAGE_VERSION="1.0"
    RPM_PACKAGE_RELEASE="1.el6"
    export RPM_PACKAGE_NAME RPM_PACKAGE_VERSION RPM_PACKAGE_RELEASE
    LANG=C
    export LANG
    unset CDPATH DISPLAY ||:
    RPM_BUILD_ROOT="/home/ara/rpmbuild/BUILDROOT/test-1.0-1.el6.x86_64"
    export RPM_BUILD_ROOT
  
    PKG_CONFIG_PATH="/usr/lib64/pkgconfig:/usr/share/pkgconfig"
    export PKG_CONFIG_PATH
  
    set -x
    umask 022
    cd "/home/ara/rpmbuild/BUILD"
  cd 'test-1.0'
  rm -rf $RPM_BUILD_ROOT
  make -p $RPM_BUILD_ROOT/usr/local/bin
  cp myscriptdate $RPM_BUILD_ROOT/usr/local/bin
  
  
  
  
  
      /usr/lib/rpm/brp-compress 
      /usr/lib/rpm/brp-strip 
      /usr/lib/rpm/brp-strip-static-archive 
      /usr/lib/rpm/brp-strip-comment-note 
  </code></pre>