Include remote sources to build RPM?

As I posted elsewhere, I’ve been working on building a RPM of Caddy that would include the DNS validation plugins (Caddy have an official RPM already, but it doesn’t include them). I figured it’d be fairly straightforward–track down their .spec file, patch it to add the plugins, and build away. And it mostly was. Except…

The .spec file calls for the sources by URL:

Source0:        https://raw.githubusercontent.com/caddyserver/caddy/%{tag}/cmd/caddy/main.go
# Use official resources for config, unit file, and welcome page.
# https://github.com/caddyserver/dist
Source1:        https://raw.githubusercontent.com/caddyserver/dist/master/config/Caddyfile
Source2:        https://raw.githubusercontent.com/caddyserver/dist/master/init/caddy.service
Source3:        https://raw.githubusercontent.com/caddyserver/dist/master/init/caddy-api.service
Source4:        https://raw.githubusercontent.com/caddyserver/dist/master/welcome/index.html
Source5:        https://raw.githubusercontent.com/caddyserver/dist/master/scripts/completions/bash-completion
Source6:        https://raw.githubusercontent.com/caddyserver/dist/master/scripts/completions/_caddy
# Since we are not using a traditional source tarball, we need to explicitly
# pull in the license file.
Source10:       https://raw.githubusercontent.com/caddyserver/caddy/%{tag}/LICENSE

So I’d foolishly expected that rpmbuild -ba caddy.spec would download these. It didn’t, of course. Should it have? Is there a way I can make it do this? Or are my expectations just off?

Obviously, downloading eight files isn’t overly burdensome–but it’d certainly be more convenient if the build system did it.

2 Likes

You can install rpmdevtools and use spectool -g <spec_file>.

6 Likes