From a8f8b2988b4834313b473b1caa4b19d5f046ec7f Mon Sep 17 00:00:00 2001 From: TheK0tYaRa Date: Mon, 23 Feb 2026 19:58:40 +0300 Subject: [PATCH] initial spec file and gear rules --- .gear/rules | 1 + lk-jwt-service.spec | 54 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 .gear/rules create mode 100644 lk-jwt-service.spec diff --git a/.gear/rules b/.gear/rules new file mode 100644 index 0000000..326ad81 --- /dev/null +++ b/.gear/rules @@ -0,0 +1 @@ +tar: @name@ diff --git a/lk-jwt-service.spec b/lk-jwt-service.spec new file mode 100644 index 0000000..161fbc1 --- /dev/null +++ b/lk-jwt-service.spec @@ -0,0 +1,54 @@ +Name: lk-jwt-service +Version: 0.4.1 +Release: alt1%{?dist} +Summary: Minimal service to issue LiveKit JWTs for MatrixRTC + +License: AGPL-3.0-only +URL: https://github.com/element-hq/lk-jwt-service +Source0: %{url}/archive/refs/tags/v%{version}.tar.gz + +# Vendored Go modules (directory "vendor/"), generated once with: +# tar -xzf v%{version}.tar.gz +# cd %{name}-%{version} +# GOTOOLCHAIN=local go mod vendor +# cd .. +# tar -cJf %{name}-%{version}-vendor.tar.xz %{name}-%{version}/vendor +Source1: %{name}-%{version}-vendor.tar.xz + +BuildRequires: golang >= 1.23 +Requires: ca-certificates + +%description +MatrixRTC Authorization Service: issues LiveKit JWTs for MatrixRTC clients. + +%prep +%autosetup -n %{name}-%{version} +# unpack vendored modules to avoid network during build +tar -xf %{SOURCE1} + +%build +# go.mod contains a "toolchain ..." directive; force using local Go toolchain (no auto-download) +export GOTOOLCHAIN=local +export GOPATH=%{_builddir}/%{name}-%{version}/_gopath +export GOCACHE=%{_builddir}/%{name}-%{version}/_gocache + +go build -trimpath -buildmode=pie -mod=vendor -o %{name} . + +%check +export GOTOOLCHAIN=local +export GOPATH=%{_builddir}/%{name}-%{version}/_gopath +export GOCACHE=%{_builddir}/%{name}-%{version}/_gocache + +go test -mod=vendor ./... + +%install +install -Dpm0755 %{name} %{buildroot}%{_bindir}/%{name} + +%files +%license LICENSE LICENSE-COMMERCIAL +%doc README.md +%{_bindir}/%{name} + +%changelog +* Mon Feb 23 2026 Your Name - 0.4.1-alt1 +- Initial package