## START: Set by rpmautospec
## (rpmautospec version 0.3.0)
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 18;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

# Generated by go2rpm
%bcond_without check

# https://github.com/golang/lint
%global goipath         golang.org/x/lint
%global forgeurl        https://github.com/golang/lint
%global commit          83fdc39ff7b56453e3793356bcff3070b9b96445

%gometa

%global goaltipaths     github.com/golang/lint

%global common_description %{expand:
Golint is a linter for Go source code.}

%global golicenses      LICENSE
%global godocs          CONTRIBUTING.md README.md

%global vimfiles_root %{_datadir}/vim/vimfiles

Name:           %{goname}
Version:        0
Release:        %autorelease
Summary:        Linter for Go source code

# Upstream license specification: BSD-3-Clause
License:        BSD
URL:            %{gourl}
Source0:        %{gosource}

BuildRequires:  golang(golang.org/x/tools/go/ast/astutil)
BuildRequires:  golang(golang.org/x/tools/go/gcexportdata)

Obsoletes:      golint < 0-0.11
Provides:       golint = %{version}-%{release}

%description
%{common_description}

%gopkg

%package -n vim-golint

Requires:       %name
Requires:       vim-common

Summary: Golint vim plugin
%description -n vim-golint
%summary

# TODO package emacsXXXX package the emacs plug-in

%prep
%goprep

%build
for cmd in golint; do
  %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd
done

%install
%gopkginstall
install -m 0755 -vd                     %{buildroot}%{_bindir}
install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/

# vim plugin
mkdir -p %{buildroot}%{vimfiles_root}
cp -ar misc/vim/ftplugin %{buildroot}%{vimfiles_root}

%if %{with check}
%check
%gocheck
%endif

%files
%license LICENSE
%doc CONTRIBUTING.md README.md
%{_bindir}/*

%gopkgfiles

%files -n vim-golint
%{vimfiles_root}/ftplugin/*

%changelog
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> 0-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Tue Jul 19 2022 Maxwell G <gotmax@e.email> 0-17
- Rebuild for
  CVE-2022-{1705,32148,30631,30633,28131,30635,30632,30630,1962} in golang

* Sat Jun 18 2022 Robert-André Mauchin <zebob.m@gmail.com> 0-16
- Rebuilt for CVE-2022-1996, CVE-2022-24675, CVE-2022-28327,
  CVE-2022-27191, CVE-2022-29526, CVE-2022-30629

* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Sat Jan 23 02:26:47 CET 2021 Robert-André Mauchin <zebob.m@gmail.com> - 0-0.17.20210123git83fdc39
- Bump to commit 83fdc39ff7b56453e3793356bcff3070b9b96445

* Fri Aug 07 19:35:48 CEST 2020 Robert-André Mauchin <zebob.m@gmail.com> - 0-0.16.20200807git738671d
- Bump to commit 738671d3881b9731cc63024d5d88cf28db875626

* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Fri Feb 07 00:24:01 CET 2020 Robert-André Mauchin <zebob.m@gmail.com> - 0-0.14.20200207git910be7a
- Bump to commit 910be7a94367618fd0fd25eaabbee4fdc0ac7092

* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Wed Jul 10 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0-0.11.20190625git959b441
- Restore vim plugin subpackage
- Add Obsoletes for old name

* Tue Jun 25 20:30:06 CEST 2019 Robert-André Mauchin <zebob.m@gmail.com> - 0-0.2.20190625git959b441
- Add Provides/Obsoletes

* Mon Apr 29 16:51:10 CEST 2019 Robert-André Mauchin <zebob.m@gmail.com> - 0-0.1.20190625git959b441
- Initial package