On 1/10/22 07:04, Maxwell G wrote:
Hi everyone,

I recently became a co-maintainer of gh, and I noticed that the package's 
`%goipath` is incorrectly set to `github.com/cli/cli` when, according to the 
go.mod, it should be `github.com/cli/cli/v2`. How should I go about correcting 
this? We have overridden the package's `%goname` to `gh`, so I can correct the 
`%goipath` without again having to go through the review process, but the 
`%godevelname` will change from `golang-github-cli-devel` to 
`golang-github-cli-2-devel`. Besides obsoleting the old package (see below), is 
there anything else I need to do?

```
%global godevelheader   %{expand:
Obsoletes:              golang-github-cli-devel < 2.4.0-3
}
```

Thank you for your input,
Maxwell


This is correct but add the Provides too. Added couple of tweaks but haven't tested them yet, especially the SOURCE_DATE_EPOCH. Try to build it and see if the output is coherent.

# Generated by go2rpm 1.5.0
%bcond_without check

# https://github.com/cli/cli
%global goipath         github.com/cli/cli/v2
%global forgeurl        https://github.com/cli/cli
Version:                2.4.0

%gometa

%global goname gh

%global godevelheader   %{expand:
Obsoletes:              golang-github-cli-devel < 2.4.0-3
Provides:               golang-github-cli-devel < %{version}-%{release}
}

%global common_description %{expand:
GitHub’s official command line tool.}

%global golicenses      LICENSE
%global godocs          README.md

Name:           %{goname}
Release:        %autorelease
Summary:        GitHub’s official command line tool

License:        MIT
URL:            %{gourl}
Source0:        %{gosource}

BuildRequires:  git
BuildRequires:  go-rpm-macros

%description
%{common_description}

%gopkg

%prep
%goprep

%generate_buildrequires
%go_generate_buildrequires

%build
export LDFLAGS="-X github.com/cli/cli/v2/internal/build.Version=%{version}-Fedora \ -X github.com/cli/cli/v2/internal/build.Date=$(date -d@"$SOURCE_DATE_EPOCH" +%Y-%m-%d)"

%gobuild -o %{gobuilddir}/cmd/%{name} %{goipath}/cmd/%{name}

%{gobuilddir}/cmd/%{name} completion bash > %{name}.bash
%{gobuilddir}/cmd/%{name} completion fish > %{name}.fish
%{gobuilddir}/cmd/%{name} completion zsh  > %{name}.zsh


%install
%gopkginstall
install -m 0755 -vd                           %{buildroot}%{_bindir}
install -m 0755 -vp %{gobuilddir}/cmd/%{name} %{buildroot}%{_bindir}/

install -Dp %{name}.bash %{buildroot}%{_datadir}/bash-completion/completions/%{name} install -Dp %{name}.fish %{buildroot}%{_datadir}/fish/vendor_completions.d/%{name}.fish
install -Dp %{name}.zsh  %{buildroot}%{_datadir}/zsh/site-functions/_%{name}


%if %{with check}
%check
# pkg/liveshare fails with golang-1.18
%gocheck -d pkg/liveshare
%endif

%files
%license LICENSE
%doc README.md
%{_bindir}/%{name}
%dir %{_datadir}/bash-completion
%dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/%{name}
%dir %{_datadir}/fish
%dir %{_datadir}/fish/vendor_completions.d
%{_datadir}/fish/vendor_completions.d/%{name}.fish
%dir %{_datadir}/zsh
%dir %{_datadir}/zsh/site-functions
%{_datadir}/zsh/site-functions/_%{name}

%gopkgfiles

%changelog
%autochangelog
_______________________________________________
golang mailing list -- golang@lists.fedoraproject.org
To unsubscribe send an email to golang-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/golang@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to