Sisyphus repository
Last update: 30 november 2022 | SRPMs: 17938 | Visits: 25425591
en ru br
ALT Linux repos
S:20221008-alt1

Group :: Networking/Other
RPM: kcptun

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

%define _unpackaged_files_terminate_build 1
%define _stripped_files_terminate_build 1
%set_verify_elf_method strict,lint=relaxed

%global import_path github.com/xtaci/kcptun
Name:     kcptun
Version:  20221008
Release:  alt1

Summary:  A Stable & Secure Tunnel based on KCP with N:M multiplexing and FEC
License:  MIT
Group:    Networking/Other
Url:      https://github.com/xtaci/kcptun

Source:   %name-%version.tar

BuildRequires(pre): rpm-build-golang
BuildRequires: golang
%{?!_without_check:%{?!_disable_check:BuildRequires: banner curl python3 iproute2}}

%description
%summary

KCP is a reliable (ARQ) transmission protocol (on top of UDP) with the
focus on low-latency in contrast to TCP which focus on bandwidth.

FEC is a forward error correction (using Reed-Solomon codes), achieving
reliability in the network with packet losses.

%prep
%setup

%build
export LDFLAGS="-X main.VERSION=%version"
export BUILDDIR="$PWD/.build"
export IMPORT_PATH="%import_path"
export GOPATH="$BUILDDIR:%go_path"

%golang_prepare

cd .build/src/%import_path
%golang_build client server

%install
export BUILDDIR="$PWD/.build"
export IGNORE_SOURCES=1

%golang_install

mv %buildroot%_bindir/server %buildroot%_bindir/%name-server
mv %buildroot%_bindir/client %buildroot%_bindir/%name-client
mkdir -p %buildroot%_sysconfdir/sysctl.d %buildroot%_sysconfdir/%name %buildroot%_unitdir
install -m0644 .gear/sysctl.conf* %buildroot%_sysconfdir/sysctl.d/88-%name.conf.example
install -m0644 .gear/%name.service %buildroot%_unitdir/%name-client.service
install -m0644 .gear/%name.service %buildroot%_unitdir/%name-server.service
install -m0640 .gear/*.json  %buildroot%_sysconfdir/%name

%check
.gear/kcptun-test.sh

%post
%post_service %name-client
%post_service %name-server

%preun
%preun_service %name-client
%preun_service %name-server

%files
%_bindir/%{name}*
%doc *.md
%attr(750,root,wheel) %dir %_sysconfdir/%name
%attr(640,root,wheel) %config(noreplace) %_sysconfdir/%name/*
%_sysconfdir/sysctl.d/*
%_unitdir/*.service

%changelog

Full changelog you can see here

 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin