Specify RPM tag Source0 as a downloadable URL#116
Conversation
This makes it easier to build the RPM using a more conventional RPM building workflow, if one prefers to do that instead of relying on `buildme.pl`. Signed-off-by: Peter Oliver <git@mavit.org.uk>
| %if %{with release} | ||
| Source0: https://downloads.lms-community.org/LyrionMusicServer_v%{version}/%{src_basename}-%{version}.tgz | ||
| %else | ||
| Source0: https://downloads.lms-community.org/nightly/%{src_basename}-%{version}-%{_revision}.tgz | ||
| %endif |
There was a problem hiding this comment.
Huh?!? Are you trying to pull down the tarball from online, instead of using a local file? That file might not exist yet at this point.
There was a problem hiding this comment.
Unintuitively, if a Source tag contains a URL, rpmbuild will just use its basename. In other words, from rpmbuild's point of view, the above is entirely equivalent to:
%if %{with release}
Source0: %{src_basename}-%{version}.tgz
%else
Source0: %{src_basename}-%{version}-%{_revision}.tgz
%endifWhy change it, then? Because other tools can use the whole URL. For example, you could fetch sources with, e.g.,
spectool -gR redhat/lyrionmusicserver.specSome build systems, such as Copr, do this automatically as the first stage of the build.
My short term goal here is to make it slightly easier for me to work on the RPM in a way that I'm used to.
My longer term goal is to enable a future where we could generate the nightly tarball here with GitHub Actions as at present, then ping Copr to build RPMs for us specific to each CPU architecture, Perl version, etc.. It would put the resulting packages into easily consumable repositories from which users could get automatic updates along with the rest of their OS.
There was a problem hiding this comment.
And currently that would use a local copy of that tarball to build the RPM locally? That would be fine then. I guess we'd see failure quickly if not 😉.
| print "INFO: Building $buildDir/$destName.tgz for the RPM...\n"; | ||
|
|
||
| buildTarball($dirsToExcludeForRPM, "$buildDir/$defaultDestName"); | ||
| buildTarball($dirsToExcludeForRPM, "$buildDir/$destName"); | ||
|
|
||
| ## We already built a tarball, so now lets use it... | ||
| print "INFO: Moving $buildDir/$defaultDestName.tgz to $buildDir/rpm/SOURCES...\n"; | ||
| system("mv $buildDir/$defaultDestName.tgz $buildDir/rpm/SOURCES"); | ||
|
|
||
| print "INFO: Moving $buildDir/$destName.tgz to $buildDir/rpm/SOURCES/...\n"; | ||
| system("mv $buildDir/$destName.tgz $buildDir/rpm/SOURCES/"); | ||
| ## Copy the various SPEC< Config, etc files into the right dirs... |
There was a problem hiding this comment.
Can you explain this part of the change? It's using the fully formatted file name (including version etc.) rather than just the lyrionmusicserver?
There was a problem hiding this comment.
That's right. This is so that we create the tarball with a name that matches the basename of the URL in Source0.
|
Thanks! Let's give this a try. Please check in 36h or so whether we'll get tomorrow's build or not. |
This makes it easier to build the RPM using a more conventional RPM building workflow, if one prefers to do that instead of relying on
buildme.pl.