rpmbuild error file not found while installing MUNGE

366 Views Asked by At

I am following Munge installation guide I downloaded the tar.gz file but i am unable to create three rpm binaries as mentioned in the tutorials because of this

sudo rpmbuild -tb --clean munge-0.5.12-11-g4699a9f.tar.gz 
error: File /home/user1/Downloads/munge-0.5.12.tar.xz: No such file or directory

In home/rpmbuild/SPEC/munge.spec is created. But I am not getting where to edit. I referred answer to this question by Thomas Dickey it says to override the location of BUILDROOT directory not sure how one does that and according to answer by muschy we need to add %install so i did that as well

%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
touch %{buildroot}/%{_sysconfdir}/munge/munge.key
touch %{buildroot}/%{_localstatedir}/lib/munge/munge.seed
touch %{buildroot}/%{_localstatedir}/log/munge/munged.log
touch %{buildroot}/%{_localstatedir}/run/munge/munged.pid
rm -f %{buildroot}/%{_sysconfdir}/sysconfig/munge
rm -f %{buildroot}/%{_initddir}/munge

Any help greatly appreciated.

1

There are 1 best solutions below

0
On

Calling "rpmbuild -tb" is quite unusual and barely documented. So I think it does:

  1. extract any *.spec from tar file into ~/rpmbuild/SPECS/
  2. copy tar file to ~/rpmbuild/SOURCES/
  3. call rpmbuild -ba ~/rpmbuild/SOURCES/that_extracted.spec

And because you spec contains:

Source0: munge-%{version}.tar.xz

Then rpmbuild is looking for munge-0.5.12.tar.xz but your tar file is actually named munge-0.5.12-11-g4699a9f.tar.gz