## START: Set by rpmautospec
## (rpmautospec version 0.3.0)
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 1;
    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 1.8.0
%bcond_without check

# https://github.com/zricethezav/gitleaks
%global forgeurl        https://github.com/zricethezav/gitleaks
%global goipath         github.com/zricethezav/gitleaks/v8
Version:                8.16.1

%gometa -f

%global common_description %{expand:
Scan git repos (or files) for secrets using regex and entropy}

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

Name:           gitleaks
Release:        %autorelease
Summary:        Scan git repos (or files) for secrets using regex and entropy

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

BuildRequires:  git-core
%description %{common_description}

%gopkg

%prep
%goprep

%generate_buildrequires
%go_generate_buildrequires

%build
%gobuild -o %{gobuilddir}/bin/gitleaks %{goipath}
%{gobuilddir}/bin/%{name} completion bash > %{name}.bash
%{gobuilddir}/bin/%{name} completion fish > %{name}.fish
%{gobuilddir}/bin/%{name} completion zsh  > %{name}.zsh


%install
%gopkginstall
install -m 0755 -vd                     %{buildroot}%{_bindir}
install -m 0755 -vp %{gobuilddir}/bin/* %{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
%gocheck
%endif

%files
%license LICENSE
%doc CONTRIBUTING.md README.md
%{_bindir}/*
%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
* Wed Mar 15 2023 Mikel Olasagasti Uranga <mikel@olasagasti.info> 8.16.1-1
- Update to 8.16.1 - Closes rhbz#2178394

* Mon Feb 27 2023 Mikel Olasagasti Uranga <mikel@olasagasti.info> 8.16.0-1
- Update to 8.16.0 - Closes rhbz#2173465

* Sat Feb 25 2023 Mikel Olasagasti Uranga <mikel@olasagasti.info> 8.15.4-1
- Update to 8.15.4 - Closes rhbz#2173323

* Mon Jan 23 2023 Mikel Olasagasti Uranga <mikel@olasagasti.info> 8.15.3-1
- Update to 8.15.3 - Closes rhbz#2163418

* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> 8.15.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Fri Dec 02 2022 Mikel Olasagasti Uranga <mikel@olasagasti.info> 8.15.2-1
- Update to 8.15.2 - Closes rhbz#2150265

* Mon Nov 21 2022 Mikel Olasagasti Uranga <mikel@olasagasti.info> 8.15.1-1
- Update to 8.15.1 - Closes rhbz#2144342

* Thu Oct 27 2022 Mikel Olasagasti Uranga <mikel@olasagasti.info> 8.15.0-1
- Update to 8.15.0 - Closes rhbz#2135004

* Wed Oct 12 2022 Mikel Olasagasti Uranga <mikel@olasagasti.info> 8.14.1-1
- Update to 8.14.1 - Closes rhbz#2133955

* Fri Sep 23 2022 Mikel Olasagasti Uranga <mikel@olasagasti.info> 8.13.0-1
- Update to 8.13.0 - Closes rhbz#2129224

* Wed Sep 07 2022 Mikel Olasagasti Uranga <mikel@olasagasti.info> 8.12.0-1
- Update to 8.12.0 - Closes rhbz#2124109

* Mon Aug 29 2022 Mikel Olasagasti Uranga <mikel@olasagasti.info> 8.11.2-1
- Update to 8.11.2 - Closes rhbz#2121280

* Thu Aug 18 2022 Mikel Olasagasti Uranga <mikel@olasagasti.info> 8.11.0-1
- Update to 8.11.0 - Closes rhbz#2118002

* Tue Aug 09 2022 Mikel Olasagasti Uranga <mikel@olasagasti.info> 8.10.1-1
- Initial package - Closes rhbz#2114921