On Thu, 27 Feb 2020 at 16:26, Nicolas Mailhot via devel
<devel(a)lists.fedoraproject.org> wrote:
> Le 2020-02-27 12:59, clime a écrit :
> Hi,
>
> > can you, please, show an example of such package? I was searching
> > through some
> > golang packages because I was curious how it works but couldn't
> > find
> > an example
>
> A Go example:
>
https://src.fedoraproject.org/rpms/golang-x-build
>
> A non-Go example:
>
https://src.fedoraproject.org/rpms/impallari-dancing-script-fonts
>
> In both cases the spec calls a macro (not the same one in both
> specs) that causes one or several distprefixNUMBER variables to be
> computed
>
> The result then ends in Release via
>
https://src.fedoraproject.org/rpms/fedora-release/blob/master/f/fedora-re...
>
> The font spec example calls the macro in redhat-rpm-config directly
> (%forgemeta), the Go example calls it through a Go-specific macro
> in go-rpm-macros (%gometa)
Okay, thanks :)!
At least my idea was that there should be a spec file preprocessor,
evaluating the macros that need git context, that would produce valid
rpm spec that will be evaluated by the rpm engine in the end so
everything related to %{dist} generation that is used in those
packages will work unchanged.
A small tweak in those spec files to allow dynamic release bumping
could be:
Release: 0.<<dynamic_release>>%{?dist}
or alternatively:
Release: <<dynamic_release prefix=0>>%{?dist} depending on the
implementation of the dynamic_release macro.
Yes, something like that would be possible, my worry was essentially
about not snipping commit info from automated changelogs.
%{dynrel} should default to 1 if buildsys info is not available
Regards,
--
Nicolas Mailhot