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

# https://github.com/facebookincubator/go2chef
%global goipath         github.com/facebookincubator/go2chef
Version:                1.0
%global tag             1.0

%gometa

%global common_description %{expand:
go2chef is a Go tool for bootstrapping Chef installations in a flexible and
self-contained way. With go2chef, our goal is to make bootstrapping any node
in a Chef deployment as simple as "get go2chef onto a machine and run it".}

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

Name:           %{goname}
Release:        %autorelease
Summary:        Tool to bootstrap a system from zero so that it's able to run Chef

# Upstream license specification: Apache-2.0
License:        ASL 2.0
URL:            %{gourl}
Source0:        %{gosource}

%description
%{common_description}

%package -n go2chef
Summary:        %{summary}

%description -n go2chef
%{common_description}

%gopkg

%prep
%goprep
# these examples aren't useful without the repository itself
rm -r examples/{custom_binary,plugins}
# fix permissions
chmod -x examples/bundles/{chefctl,chefrepo}/bundle.ps1

%generate_buildrequires
%go_generate_buildrequires

%build
%gobuild -o %{gobuilddir}/bin/go2chef %{goipath}/bin
%gobuild -o %{gobuilddir}/bin/go2chef-remote %{goipath}/scripts

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

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

%files -n go2chef
%license LICENSE
%doc examples CODE_OF_CONDUCT.md CONTRIBUTING.md README.md
%{_bindir}/*

%gopkgfiles

%changelog
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> 1.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> 1.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

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

* Sat Jul 09 2022 Maxwell G <gotmax@e.email> 1.0-2
- Rebuild for CVE-2022-{24675,28327,29526 in golang}

* Thu Apr 14 2022 Davide Cavalca <dcavalca@fedoraproject.org> 1.0-1
- Update to 1.0; Fixes: RHBZ#2075601

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

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

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

* Tue Jan  5 2021 Davide Cavalca <dcavalca@fedoraproject.org> - 0-0.1.20210105git576f5d4
- Update commit to pick up a fix for #1912666

* Mon Jan  4 2021 Davide Cavalca <dcavalca@fedoraproject.org> - 0-0.1.20210104git4dae637
- Initial package