#959 Clarification needed: It it allowed to have different version based on %{fedora}?
Closed: rejected 8 months ago by james. Opened 9 months ago by churchyard.

When I read the following guideline:

https://docs.fedoraproject.org/en-US/packaging-guidelines/DistTag/#_things_that_you_cannot_use_dist_for

%{fedora}, %{rhel}, %{rhl}, %{fc#}, %{el#} must never be used in the Name, Version, or Release fields.

It is obvious it is forbidden to do this:

Version: 3.5.%{fedora}

However, is it allowed to do this?

%if 0%{?fedora} >= 32
Version: 3.5.32
%else
Version: 3.5.31
%endif

I think it should be forbidden or strongly discouraged, because it brings problems with the SRPMs (when the SRPM is built on Fedora 31 or RHEL, it cannot be rebuilt on Fedora 32+). However, from the text it is not clear to me.


Yeah, I think this is not exactly forbidden by the letters of the Guidelines, but it definitely violates their spirit. As you pointed out, you could just do the %if spaghetti instead.

And since the %if spaghetti will cause problems (and definitely looks ugly), I think it should be forbidden, as well.

While I agree that this example goes against the spirit of the packaging guidelines, I wouldn't want an outright ban on conditionals in version or release.

I use the following for the "Release" in a couple of my RPMS, to make it easy to get the Release version correct for Beta or RC-type releases:

Release: %{?_rc:0.rc%{_rc}.}%{?_beta:0.beta%{_beta}.}1%{?dist}

I then have two globals (_rc and _beta) that I define only when necessary.

@jsmith sure, that's something else (and it actually saves you work and error-prone typing, I imagine), since those conditionals are not dependent on the value of %{fedora} etc., but on something that's defined within your .spec file and not by the "outside world".

Yeh, I'd say it's disallowed now ... but happy to change wording to be more explicit if we need to.

Metadata Update from @james:
- Issue tagged with: meeting

8 months ago

This was discussed in this weeks meeting (https://meetbot-raw.fedoraproject.org/fedora-meeting-1/2020-04-09/fpc.2020-04-09-16.00.txt):

  • #959 Is it ok to have different version based on %{fedora}?
    (geppetto, 16:40:34)
  • Nobody likes it, and if it is allowed nobody wants it to be.
    (geppetto, 17:00:08)

Metadata Update from @james:
- Issue close_status updated to: rejected
- Issue status updated to: Closed (was: Open)

8 months ago

Login to comment on this ticket.

Metadata