## START: Set by rpmautospec
## (rpmautospec version 0.3.0)
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 13;
    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/WireGuard/wgctrl-go
%global goipath         golang.zx2c4.com/wireguard/wgctrl
%global forgeurl        https://github.com/WireGuard/wgctrl-go
%global commit          4253848d036c7873fa1fbdfbc2d10ff15dc81ccb

%gometa

%global goname          wgctrl

%global common_description %{expand:
Package Wgctrl enables control of WireGuard interfaces on multiple platforms.}

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

Name:           %{goname}
Version:        0
Release:        %autorelease -p
Summary:        Control of WireGuard interfaces on multiple platforms

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

BuildRequires:  golang(github.com/mdlayher/genetlink)
BuildRequires:  golang(github.com/mdlayher/netlink)
BuildRequires:  golang(github.com/mdlayher/netlink/nlenc)
BuildRequires:  golang(golang.org/x/crypto/curve25519)
BuildRequires:  golang(golang.org/x/sys/unix)

%if %{with check}
# Tests
BuildRequires:  golang(github.com/google/go-cmp/cmp)
BuildRequires:  golang(github.com/mdlayher/genetlink/genltest)
BuildRequires:  golang(github.com/mdlayher/netlink/nltest)
BuildRequires:  golang(github.com/mikioh/ipaddr)
%endif

%description
%{common_description}

%gopkg

%prep
%goprep

%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.md
%doc CONTRIBUTING.md README.md
%{_bindir}/*

%gopkgfiles

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

* Tue Jul 19 2022 Maxwell G <gotmax@e.email> 0-0.12
- 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-0.11
- Rebuilt for CVE-2022-1996, CVE-2022-24675, CVE-2022-28327,
  CVE-2022-27191, CVE-2022-29526, CVE-2022-30629

* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> 0-0.10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Wed Aug 11 2021 François Kooman <fkooman@tuxed.net> 0-0.9
- Bump to commit 4253848d036c7873fa1fbdfbc2d10ff15dc81ccb

* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Wed Jan 27 2021 François Kooman <fkooman@tuxed.net> - 0-0.5.20210127gitbd2cb78
- Update to commit bd2cb7843e1b98193f01eb288793e741a814a269

* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.4
- Second attempt - Rebuilt for
  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

* Wed Jul 17 22:28:10 CEST 2019 Robert-André Mauchin <zebob.m@gmail.com> - 0-0.1.20190729git28f4e24
- Initial package