## 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
%bcond_without check

# https://github.com/google/go-dap
%global goipath         github.com/google/go-dap
Version:                0.7.0

%gometa

%global common_description %{expand:
Go implementation of the Debug Adapter Protocol.}

%global golicenses      LICENSE
%global godocs          docs README.md cmd/gentypes/README.md

Name:           %{goname}
Release:        %autorelease
Summary:        Go implementation of the Debug Adapter Protocol

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

# Disable TestServer because it mocks a server and it fails during the RPM generation
Patch0001:      0001-Disable-TestServer.patch

%description
%{common_description}

%gopkg

%prep
%goprep
%patch0001 -p1

%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
%gocheck
%endif

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

%gopkgfiles

%changelog
* Wed Feb 01 2023 Alejandro Sáez <asm@redhat.com> 0.7.0-1
- Update to 0.7.0 and add autochangelog

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

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

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

* Wed Jun 29 2022 Alejandro Sáez <asm@redhat.com> 0.6.0-1
- Update to 0.6.0

* Sat Jun 18 2022 Robert-André Mauchin <zebob.m@gmail.com> 0.4.0-4
- 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.4.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

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

* Wed Mar 03 2021 Alejandro Sáez <asm@redhat.com> 0.4.0-1
- Initial import (#1896497).