File tuios.spec of Package tuios

#
# spec file for package tuios
#
# Copyright (c) 2025 mantarimay
#
# 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/
#


%if "@BUILD_FLAVOR@" == "web"
Name:           tuios-web
Summary:        Web terminal server for TUIOS
%bcond_without web
%else
Name:           tuios
Summary:        Terminal UI Operating System
%bcond_with web
%endif
Version:        0
Release:        0
License:        MIT
URL:            https://github.com/Gaurav-Gosain/tuios
Source0:        tuios-%{version}.tar.zst
Source1:        vendor.tar.zst
BuildRequires:  golang-packaging
BuildRequires:  zstd

%description
%if %{with web}
Serves TUIOS through the browser.
%endif
TUIOS is a terminal-based window manager that provides a modern, efficient
interface for managing multiple terminal sessions. Built with Go using the
Charm stack (Bubble Tea v2 and Lipgloss v2), TUIOS offers a vim-like modal
interface with comprehensive keyboard shortcuts, workspace support, and
mouse interaction.

%prep
%autosetup -n tuios-%{version} -p1 -a1

%build
go build \
   -o build/%{name} \
   -mod=vendor \
   -ldflags="-s -w" \
   -buildmode=pie \
   ./cmd/%{name}

./build/%{name} completion bash > "%{name}.bash"
./build/%{name} completion fish > "%{name}.fish"
./build/%{name} completion zsh > "_%{name}"

%install
install -Dm755 build/%{name} -t %{buildroot}%{_bindir}
install -Dm644 %{name}.bash -t \
    %{buildroot}%{_datadir}/bash-completion/completions
install -Dm644 %{name}.fish -t \
    %{buildroot}%{_datadir}/fish/vendor_completions.d
install -Dm644 _%{name} -t \
    %{buildroot}%{_datadir}/zsh/site-functions

%files
%license LICENSE
%doc README.md
%{_bindir}/%{name}
%{_datadir}/bash-completion/completions
%{_datadir}/fish
%{_datadir}/zsh

%changelog
openSUSE Build Service is sponsored by