Search code examples
rpmbuildrpm-spec

Using rpmbuild when source tar directory doesn't correspond to name-version


I'm trying to build an rpm from source-1.4.3-linux.tgz (that is downloaded so I don't control the name) and the file untars into the directory source-1.4.3-linux. In my source.spec file, I have

Name: source
Version: 1.4.3 

So it is probably quite logical that I am getting an error:

cd: source-1.4.3: No such file or directory.  

I tried tacking -linux onto the version, but rpmbuild wants only a number there. What do I have to do to tell rpmbuild that the source files are untarred into source-1.4.3-linux?


Solution

  • Just use the setup macro.

    setup -n %{name}-%{version}.linux