Hi,
I'm opening this thread to gather some feedback on an idea of
introducing `gnome-srpm-macros`.
Most of the GNOME applications use macros like `tarball_version`, which
replaces tilde to a dot in the %{version} field. It's to have
50.alpha/50.beta/50.rc as Version: 50~alpha/50~beta/50~rc
I saw few different "implementations" of that macro, spread across of
the GNOME packages. The rust provides its own macro for similar purpose
already.
Some define also `major_version` macro, which extracts only the major
version from the Version. It's useful in the `Source0`, because the
downloaded .tar.xz files are usually available at:
`https://download.gnome.org/sources/%{name}/%{major_version}/%{name}-%{tarball_version}.tar.xz`
I saw few different "implementations" of this macro as well.
I would add to the group of the macros also `major_minor_version`,
because some apps (and libraries) have the download URL with
`major.minor`, instead only with the `major` part of the Version.
As the alpha/beta/rc releases can be tricky, especially to remember to
use the tilde in the Version (I made such mistake multiple times in the
past), I would also add some macro which would verify this silly
mistake did not happen. That could be checked in the `%prep` or
otherwise, definitely sometime soon during the package build.
As these macros can diverge easily package by package and code
duplication is generally a bad idea. It had been suggested to me to
introduce the gnome-srpm-macros package. I do not know much about these
things, but from the less what had been shown to me by others, apart of
creating the package somewhere, I understood I'd also need to modify
redhat-rpm-macros or some such package, to have these macros available
always, not only after some explicit BuildRequires, or any such thing.
I noticed some project have a similar XXX-srpm-macros package generated
from some core package, but I'm not sure whether any good candidate is
available for the GNOME world. Some core things like gtk come to my
mind, but there is gtk3 and gtk4 and you do not want to have lost the
macros once say gtk4 is dropped from Fedora in the far far future.
These macros won't be different for gtk3 and gtk4 apps.
I'm also thinking of prefixing/namespacing the macros, thus they won't
clash with any current nor future macros provided by other packages.
That would be like adding a `gnome_` prefix to their names, say:
`tarball_version` => `gnome_tarball_version`
and so on. Lengthy name, but relatively safe, I guess.
Are there any opinions, good practices, advises, please?
Thanks and bye,
Milan