Why does rpmbuild (1) ignore the compressed tar (1) file, called the "Source:" tag in the RPM "spec" file?

The ldm.spec file contains the line

 Source: /web/ftp/pub/ldm/%{name}-%{version}.tar.gz 

in the first section. % {name} and% {version} are set correctly. This file exists.

rpmbuild --nobuild ldm.spec error-exit command with message

 error: File /home/steve/rpmbuild/SOURCES/ldm-6.9.8.tar.gz: No such file or directory 

What needs to be done to make this work?

Additional Information:

 $ uname -a Linux gilda.unidata.ucar.edu 2.6.27.41-170.2.117.fc10.x86_64 #1 SMP Thu Dec 10 10:36:29 EST 2009 x86_64 x86_64 x86_64 GNU/Linux $ rpmbuild --version RPM version 4.6.1 
+6
source share
1 answer

By default, rpmbuild expects the basename () of the source file to exist in the% _topdir / SOURCES directory, regardless of where it is otherwise. In specification files, you will often see the URL (wget.spec):

 Source: ftp://ftp.gnu.org/gnu/wget/wget-%{version}.tar.bz2 

It does not retrieve it at build time, even if it was on your own file system. The error "There is no such file or directory" arises from the% setup macro, which searches for the file in the default location and does not see it.

The solution is to copy (or make a symbolic link) the file to the rpmbuild / SOURCES directory.

If for some reason you do not want to copy this file to the SOURCES user directory, you can use the -T option in% setup mecro, it tells it "Do not build archives by default" ":

 %setup -T 

You will have to unzip the archive yourself in the% prep section if you decide to go along this route.

+6
source

Source: https://habr.com/ru/post/891250/


All Articles