File wireguard-go.spec of Package wireguard-go

# Generated by go2rpm 1.6.0
%bcond_without check

# https://git.zx2c4.com/wireguard-go
%global goipath         golang.zx2c4.com/wireguard
%global forgeurl        https://git.zx2c4.com/wireguard-go
%global commit          f9b48a961cd2
%global archivename     wireguard-go-%{commit}
%global topdir          %{archivename}

%gometa

%global goname          wireguard-go

%global common_description %{expand:
Go implementation of WireGuard VPN tunnel in userspace.}

%global golicenses      LICENSE
%global godocs          README.md

Name:           %{goname}
Version:        0~git20210604.%{commit}
Release:        1%{?dist}
Summary:        Go implementation of WireGuard VPN tunnel in userspace

License:        MIT
URL:            %{gourl}
Source0:        %{forgeurl}/snapshot/%{archivename}.tar.xz
Patch0:         wireguard-go-netstack.patch
BuildRequires:  go-rpm-macros

BuildRequires:  golang(golang.org/x/crypto/blake2s)
BuildRequires:  golang(golang.org/x/crypto/chacha20poly1305)
BuildRequires:  golang(golang.org/x/crypto/curve25519)
BuildRequires:  golang(golang.org/x/crypto/poly1305)
BuildRequires:  golang(golang.org/x/net/dns/dnsmessage)
BuildRequires:  golang(golang.org/x/net/ipv4)
BuildRequires:  golang(golang.org/x/net/ipv6)
BuildRequires:  golang(golang.org/x/sys/unix)
BuildRequires:  golang(gvisor.dev/gvisor/pkg/tcpip)
BuildRequires:  golang(gvisor.dev/gvisor/pkg/tcpip/adapters/gonet)
BuildRequires:  golang(gvisor.dev/gvisor/pkg/tcpip/buffer)
BuildRequires:  golang(gvisor.dev/gvisor/pkg/tcpip/header)
BuildRequires:  golang(gvisor.dev/gvisor/pkg/tcpip/network/ipv4)
BuildRequires:  golang(gvisor.dev/gvisor/pkg/tcpip/network/ipv6)
BuildRequires:  golang(gvisor.dev/gvisor/pkg/tcpip/stack)
BuildRequires:  golang(gvisor.dev/gvisor/pkg/tcpip/transport/tcp)
BuildRequires:  golang(gvisor.dev/gvisor/pkg/tcpip/transport/udp)

%description
%{common_description}

%gopkg

%prep
%goprep
%patch0 -p1
rm -f format_test.go

%build
%gobuild -o %{gobuilddir}/bin/wireguard-go %{goipath}

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

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

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

%gopkgfiles