File wiretap.spec of Package wiretap

#
# spec file for package wiretap
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name:           wiretap
Version:        0.6.1
Release:        0
Summary:        VPN-like proxy server that tunnels traffic via WireGuard
License:        MIT-0
Group:          Productivity/Networking/Security
URL:            https://github.com/sandialabs/wiretap
Source:         %{name}-%{version}.tar.gz
Source1:        vendor.tar.gz
BuildRequires:  golang(API) >= 1.23

%description
Wiretap is a transparent, VPN-like proxy server that tunnels traffic via
WireGuard and requires no special privileges to run.

A Wiretap Server is any machine where a Wiretap binary is running the serve
command. Servers receive and relay network traffic on behalf of Wiretap Clients,
acting like a VPN exit node.

A Wiretap Client is any machine running the Wireguard configurations necessary
to send and receive network traffic through a Wiretap Server. It functions much
like a client in a VPN connection. Clients are also able to reconfigure parts of
the Wiretap network dynamically using the Wiretap binary.

%prep
%autosetup -a 1
# Go application sources are in subdir src
# choice in _service to use param subdir in service tar_scm OR go_modules
# sources have LICENSE.txt and README.md in top level directory
mv LICENSE.txt LICENSE
mv vendor src

%build
cd src
%ifnarch ppc64
export GOFLAGS="-buildmode=pie"
%endif
go build -ldflags "-X wiretap/cmd.Version=%{version}"

%check
# execute the binary as a basic check
./src/%{name} --help

%install
# Install the binary.
install -D -m 0755 src/%{name} "%{buildroot}/%{_bindir}/%{name}"

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

%changelog
openSUSE Build Service is sponsored by