gofed / go-macros

Rpm mechanics for Go packaging
4 stars 7 forks source link

date included in computed %{?dist} when packaging a stable version #55

Closed decathorpe closed 5 years ago

decathorpe commented 6 years ago

I want to update a package to the latest stable release, and to use the new macros. However, when I do this:

# https://github.com/cznic/ql
%global goipath github.com/cznic/ql
%global tag     v1.2.0

%gometa -i

Name:           %{goname}
Version:        1.2.0
Release:        1%{?dist}

I get a NEVR of golang-github-cznic-ql-1.2.0-1.20180813gitv1.2.0.fc29, when I would expect golang-github-cznic-ql-1.2.0-1.fc29 for a stable release like this.

Am I missing something, or is this a bug? I expect the value of %{?dist} to be 1.fcXX when packaging a normal tagged release and not a snapshot.

QuLogic commented 6 years ago

You need to set Version before %gometa, no?

decathorpe commented 6 years ago

Ok, that works, but having to specify "Version" even above "Name" doesn't seem right at all ... setting %tag is enough for the macros to determine that a stable version is packaged, and this is just redundant.

nim-nim commented 6 years ago

The clean way to package a release is to set version before the macro call and not use a tag.

Now, due to utter confusion in upstream projects, sometimes releases are not tagged with the release number but with vnumber or something else. That means, that in some cases, you will need to use a tag anyway, and it will often generate a distprefix (not always, because I've added some heuristics). Because there's no way rpm-side to detect if a tag is an exact release match or some other state.

decathorpe commented 6 years ago

While I don't particularly like it, I agree that the current implementation probably is the best compromise for dealing with both good and messy upstream projects.

nim-nim commented 5 years ago

That should be fixed for the current codebase used by Fedora

nim-nim commented 5 years ago

Please close if it is so, otherwise reopen on https://pagure.io/go-rpm-macros