From 32f85cda153271a64af2d05e2c0f7366c1b337610fe521213dbbb2c49d841b4c Mon Sep 17 00:00:00 2001 From: Sai Karthik Date: Wed, 5 Nov 2025 15:50:21 +0530 Subject: [PATCH] add shell completions & basic binary %check --- mcphost.changes | 5 +++++ mcphost.spec | 56 ++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 60 insertions(+), 1 deletion(-) diff --git a/mcphost.changes b/mcphost.changes index 003b9b2..e4998d6 100644 --- a/mcphost.changes +++ b/mcphost.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Nov 5 10:17:13 UTC 2025 - Sai Karthik Karra + +- Add shell completions & basic %check during build time + ------------------------------------------------------------------- Fri Oct 10 12:43:31 UTC 2025 - Egbert Eich diff --git a/mcphost.spec b/mcphost.spec index e968f1a..2b3f000 100644 --- a/mcphost.spec +++ b/mcphost.spec @@ -36,12 +36,43 @@ BuildRequires: go >= 1.24 %if 0%{?suse_version} >= 1500 BuildRequires: golang-packaging %endif - + %description A CLI host application that enables Large Language Models (LLMs) to interact with external tools through the Model Context Protocol (MCP). Currently supports both Claude 3.5 Sonnet and Ollama models. +%package bash-completion +Summary: Bash Completion for %{name} +Group: System/Shells +Requires: bash-completion +BuildArch: noarch +Requires: %{name} +Supplements: (%{name} and bash-completion) + +%description bash-completion +The official bash completion script for %{name}, generated during the build. + +%package zsh-completion +Summary: ZSH Completion for %{name} +Group: System/Shells +BuildArch: noarch +Requires: %{name} +Supplements: (%{name} and zsh) + +%description zsh-completion +The official zsh completion script for %{name}, generated during the build. + +%package fish-completion +Summary: Fish Completion for %{name} +Group: System/Shells +BuildArch: noarch +Requires: %{name} +Supplements: (%{name} and fish) + +%description fish-completion +The official fish completion script for %{name}, generated during the build. + %prep # Setup the main source code %setup -q -n %{name}-%{version} @@ -56,8 +87,31 @@ sed -i -e "s/go1.24.5/go1.24/g" go.mod %install %{goinstall} +# Build the shell autocomplete files +%{buildroot}/%{_bindir}/%{name} completion bash > %{name}-autocomplete.bash +%{buildroot}/%{_bindir}/%{name} completion zsh > %{name}-autocomplete.zsh +%{buildroot}/%{_bindir}/%{name} completion fish > %{name}-autocomplete.fish + +# Install the shell autocomplete files +install -Dm 644 %{name}-autocomplete.bash %{buildroot}%{_datadir}/bash-completion/completions/%{name} +install -Dm 644 %{name}-autocomplete.zsh %{buildroot}%{_datadir}/zsh/site-functions/_%{name} +install -Dm 644 %{name}-autocomplete.fish %{buildroot}%{_datadir}/fish/completions/_%{name} + +%check +# execute the binary as a basic check +%{buildroot}/%{_bindir}/%{name} help + %files %license LICENSE %{_bindir}/%{name} +# completions +%files bash-completion +%{_datadir}/bash-completion + +%files zsh-completion +%{_datadir}/zsh + +%files fish-completion +%{_datadir}/fish %changelog -- 2.51.1