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

# Generated by go2rpm 1.6.0
%bcond_without check
%global debug_package %{nil}

# https://github.com/storj/drpc
%global goipath         storj.io/drpc
%global forgeurl        https://github.com/storj/drpc
Version:                0.0.31

%gometa

%global common_description %{expand:
Lightweight, drop-in replacement for gRPC.}

%global golicenses      LICENSE
%global godocs          README.md

Name:           %{goname}
Release:        %autorelease
Summary:        Lightweight, drop-in replacement for gRPC

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

%description
%{common_description}

%gopkg

%prep
%goprep
# Integration tests for drpc, adds multiple non packaged dependencies
rm -rf internal/grpccompat

%generate_buildrequires
%go_generate_buildrequires

%build
for cmd in cmd/* ; 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}/

%if %{with check}
%check
# backcompat tests fail with a panic
# panic: runtime error: invalid memory address or nil pointer dereference
%gocheck -d internal/backcompat -d internal/backcompat/oldservicedefs
%endif

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

%gopkgfiles

%changelog
* Tue Jun 21 2022 Maxwell G <gotmax@e.email> 0.0.31-2
- Rebuilt for CVE-2022-1996, CVE-2022-24675, CVE-2022-28327,
  CVE-2022-27191, CVE-2022-29526, CVE-2022-30629.

* Mon Jun 20 2022 Mikel Olasagasti Uranga <mikel@olasagasti.info> 0.0.31-1
- Update to 0.0.31 - Close: rhbz#1963535

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

* Sat Apr 16 2022 Fabio Alessandro Locati <me@fale.io> - 0.0.16-5
- Rebuilt for CVE-2022-27191

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

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

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

* Sat Jan 23 00:21:15 CET 2021 Robert-André Mauchin <zebob.m@gmail.com> - 0.0.16-1
- Update to 0.0.16

* Fri Aug 07 00:29:40 CEST 2020 Robert-André Mauchin <zebob.m@gmail.com> - 0.0.14-1
- Update to 0.0.14

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

* Sat Jun 20 15:19:09 CEST 2020 Robert-André Mauchin <zebob.m@gmail.com> - 0.0.13-1
- Initial package