Name:           livekit
Version:        1.9.11
Release:        alt1
Summary:        LiveKit WebRTC SFU media server
License:        Apache-2.0
Group:          System/Servers

Url:            https://github.com/livekit/livekit
VCS:            https://github.com/livekit/livekit

#https://github.com/livekit/livekit/archive/refs/tags/v%version.tar.gz
Source:         %name-%version.tar
Source1:        %name-development-%version.tar
Source2:        %name.service
Source3:        %name.sysusers

BuildRequires:  golang >= 1.24

%description
LiveKit is an open-source, scalable multi-user WebRTC SFU (Selective Forwarding Unit).

%prep
%setup -a1

%build
#export GOTOOLCHAIN=local
#export CGO_ENABLED=0

#export GOFLAGS="-mod=vendor -trimpath"

go build -buildvcs=false -o %name ./cmd/server

%install
install -Dpm0755 livekit %buildroot%_sbindir/livekit
install -Dpm0644 config-sample.yaml %buildroot%_sysconfdir/livekit/livekit.yaml
install -Dpm0644 %SOURCE2 %buildroot%_unitdir/livekit.service
#install -Dpm0644 %SOURCE3 %buildroot%_sysusersdir/livekit.conf

%pre
%sysusers_create_package livekit %SOURCE3

%files
%doc README.md CHANGELOG.md NOTICE LICENSE
%_sbindir/livekit
%config(noreplace) %_sysconfdir/livekit/livekit.yaml
%_unitdir/livekit.service
#%_sysusersdir/livekit.conf

%changelog
* Tue Feb 24 2026 Romenskiy Arseniy <romenskiy2012@altlinux.org> 1.9.11-alt1
- initial build
