File mcphost.spec of Package mcphost
#
# spec file for package mcphost
#
# Copyright (c) 2025 SUSE LLC
#
# 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/
#
Name: mcphost
Version: 0.31.0
Release: 4.mge
Summary: A CLI host application for the Model Context Protocol (MCP)
License: MIT and Apache-2.0 and BSD-2-Clause and BSD-3-Clause
URL: https://github.com/mark3labs/mcphost
Source0: %{name}-%{version}.tar.gz
Source1: %{name}-%{version}-vendor.tar.gz
BuildRequires: go >= 1.24
%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.
%prep
# Setup the main source code
%setup -q -n %{name}-%{version}
%patch -P 0 -p 1
# Extract the vendored Go modules provided by the _service file
tar xf %{SOURCE1} -C .
sed -i -e "s/go .*/go 1.24/g" go.mod
sed -i -e "s/go 1.23.4/go 1.24/g" go.mod
sed -i -e "s/go 1.23.9/go 1.24/g" go.mod
sed -i -e "s/go 1.24.5/go 1.24/g" go.mod
sed -i -e "s/go1.24.5/go1.24/g" go.mod
go version
%build
go build -buildmode=pie -mod=vendor
%install
install -D -m 0755 mcphost %{buildroot}%{_bindir}/mcphost
%files
%license LICENSE
%{_bindir}/%{name}
%changelog