rpmbuild issues on CentOS - Bad exit status from /home/me/rpmbuild/tmp/rpm-tmp.58942

Coder1 picture Coder1 · Dec 28, 2012 · Viewed 9.3k times · Source

I'm trying to create a package that only updates files on the system, but I keep getting errors when rpmbuild is run. The error indicates a file is missing.

I've tried this on CentOS 5 and 6 with the same results.

I used rpmdev-setuptree to setup the file system, which also setup ~/.rpmmacros file. I then used rpmdev-newspec to initialize the spec file.

I am running as a non-root user.

I have the spec file in ~/rpmbuild/SPECS/test.spec and my source is: ~/rpmbuild/SOURCES/test-1.tar.gz . Extracting this file creates a directory named test-1 with 2 files inside of it. I've confirmed that it does get extracted to ~/rpmbuild/BUILD/test-1 when I try to build the package.

I run: rpmbuild -ba ~/rpmbuild/SPECS/test.spec

Then I get this error:

  • ./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --target=x86_64-redhat-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info /home/me/rpmbuild/tmp/rpm-tmp.58942: line 37: ./configure: No such file or directory error: Bad exit status from /home/me/rpmbuild/tmp/rpm-tmp.58942 (%build)

RPM build errors: Bad exit status from /home/me/rpmbuild/tmp/rpm-tmp.58942 (%build)

Here is my spec file:

Name:           test
Version:        1
Release:        1%{?dist}
Summary:        Test

Group:          Test
License:        GPL
URL:            http://example.com 
Source0:        test-1.tar.gz 
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

#BuildRequires:  
#Requires:       

%description
This is a test to push files.

%prep
%setup -q

%build
#%configure
#make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
#make install DESTDIR=$RPM_BUILD_ROOT
install -m 0755 -d $RPM_BUILD_ROOT/opt/test

%clean
rm -rf $RPM_BUILD_ROOT

%files
%dir /opt/test
%defattr(-,root,root,-)
%doc

Any ideas on what I might be doing wrong?

Answer

Aaron D. Marasco picture Aaron D. Marasco · Dec 28, 2012

Looks like the default GNU "./configure" script isn't there, so you can't use the default %setup macro in the spec file and will need a custom %prep section... (One source) (mirror)