Build RPM using source directory, not tarball

rpm

In my organization, we deploy all our software to our production machines using RPM. Our build process (which is automated) involves checking out the source from version control, tarring that source directory up, then running rpmbuild using that source tarball. rpmbuild only uses that tarball to untar the sources to work on them. So, it seem like the whole taring and untaring business is just an unneeded extra step in the build process. Is there was a way to just specify the source directory in the spec file, avoiding those extra steps?

Best Answer

Yes, you can do that. Do not list any Sources. In the %prep section do not use the %setup macro (which untars the source); rather, just check out the source.

Note that you will not be able to build SRPMs if you do this.