How do I get rpmbuild to download all of the sources for a particular .spec?

joeforker picture joeforker · Oct 16, 2015 · Viewed 18.9k times · Source

I am adding some sources to an existing rpm .spec file by URL and don't have them downloaded yet. Is there a way to get rpmbuild to download the sources rather than doing it manually?

Answer

joeforker picture joeforker · Oct 16, 2015

The spectool utility from the rpmdevtools package can do this. Just install rpmdevtools and point spectools at the .spec like so:

spectool -g -R SPECS/nginx.spec

It will download any missing sources into rpm's %{_sourcedir} (usually SOURCES) directory.