Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions buildme.pl
Original file line number Diff line number Diff line change
Expand Up @@ -627,14 +627,14 @@ sub buildRPM {
}

## Now we need to build a tarball ...
print "INFO: Building $buildDir/$defaultDestName.tgz for the RPM...\n";
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...
Comment on lines +630 to 638

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain this part of the change? It's using the fully formatted file name (including version etc.) rather than just the lyrionmusicserver?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right. This is so that we create the tarball with a name that matches the basename of the URL in Source0.

copy("$buildDir/platforms/redhat/lyrionmusicserver.config", "$buildDir/rpm/SOURCES");
copy("$buildDir/platforms/redhat/lyrionmusicserver.logrotate", "$buildDir/rpm/SOURCES");
Expand Down
12 changes: 10 additions & 2 deletions redhat/lyrionmusicserver.spec
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ Summary: Lyrion Music Server

License: GPL and proprietary
URL: https://www.lyrion.org
Source0: %{src_basename}.tgz
%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
Comment on lines +79 to +83

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
%endif

Why change it, then? Because other tools can use the whole URL. For example, you could fetch sources with, e.g.,

spectool -gR redhat/lyrionmusicserver.spec

Some 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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 😉.

Source1: %{shortname}.config
Source3: %{shortname}.logrotate
Source4: %{shortname}.service
Expand Down Expand Up @@ -165,7 +169,11 @@ player. It supports MP3, AAC, WMA, FLAC, Ogg Vorbis, WAV and more!
As of version 7.7 it also supports UPnP clients.

%prep
%setup -q -n %{src_basename}
%if %{with release}
%autosetup -n %{src_basename}-%{version}
%else
%autosetup -n %{src_basename}-%{version}-%{_revision}
%endif


%build
Expand Down