RPM build errors:Bad exit status from /var/tmp/rpm-tmp.32XJLX (%install)

Aravinda picture Aravinda · Dec 7, 2014 · Viewed 29.3k times · Source

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.. Bad exit status from /var/tmp/rpm-tmp.b1DgAt (%build) and Bad exit status from /var/tmp/rpm-tmp.ajKra4 (%prep) .. yet no luck...

I cannot figure out what i'm missing here.. please help me to fix this..

this is my

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 <[email protected]> 1.0-1
-Initial RPM
-Added /usr/local/bin/myscript

Source directory is /test1

[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]$

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..

'#!/bin/bash

date

when i try rpmbuild -ba test.spec it gives me

# 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) $<

# 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)

/var/tmp/rpm-tmp.ZFlmeu content is below

#!/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 

Answer

Etan Reisner picture Etan Reisner · Dec 7, 2014

The make -p $RPM_BUILD_ROOT/usr/local/bin line is your problem.

While not the problem you almost certainly don't want -p on that line. As it doesn't do anything useful for you during compilation and your rpm build process has no need to see the make database of rules.

The real problem is that you are telling make that you would like it to build the $RPM_BUILD_ROOT/usr/local/bin target which it is incredibly unlikely that make actually knows how to build (thus causing make to fail to build it and giving you an error). Removing the -p will help you see the actual error that make is spitting out as it will not also spit out the rule database stuff.

I think you meant mkdir -p there instead. (Which should be available as the %{__mkdir_p} macro.)