File mcp-server-uyuni.spec of Package mcp-server-uyuni

#
# spec file for package mcp-server-uyuni
#
# 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/
#


%{?sle15_python_module_pythons}
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
Name:           mcp-server-uyuni
Version:        0.4.0
Release:        0
Summary:        Model Context Protocol Server for Uyuni Server API
License:        Apache-2.0
URL:            https://github.com/uyuni-project/mcp-server-uyuni
Source:         mcp-server-uyuni-%{version}.tar.gz
Patch1:         0001-feat-security-add-write-enable-flag-to-control-state.patch
Patch2:         0002-Update-README.md.patch
Patch3:         0003-test-all-Automate-running-tests-cases.patch
Patch4:         0004-Update-CONTRIBUTING.md-with-mcphost-installation.patch
Patch5:         0005-Update-fastMCP-to-v2.patch
Patch6:         0006-fix-all-fix-update-fastmcp-v2-function-call.patch
Patch7:         0007-use-fastmcp-2.6-as-this-is-the-one-in-the-RPM.patch
Patch8:         0008-Fix-pydeps-versions-to-the-ones-that-are-packaged.patch

BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module wheel}
BuildRequires:  %{python_module hatchling}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
Requires:       python-fastmcp >= 2.6.0
# begin deps extracted from pyproject.toml
Requires:       python-annotated-types==0.7.0
Requires:       python-anyio==4.11.0
Requires:       python-attrs==25.3.0
Requires:       python-authlib==1.6.1
Requires:       python-certifi==2025.6.15
Requires:       python-cffi==1.17.1
Requires:       python-click==8.3.0
Requires:       python-cryptography==45.0.7
Requires:       python-exceptiongroup==1.3.0
Requires:       python-fastmcp==2.6.0
Requires:       python-h11==0.16.0
Requires:       python-httpcore==1.0.9
Requires:       python-httpx==0.28.1
Requires:       python-httpx-sse==0.4.0
Requires:       python-idna==3.10
Requires:       python-jsonschema==4.24.0
Requires:       python-jsonschema-specifications==2025.4.1
Requires:       python-markdown-it-py==3.0.0
Requires:       python-mcp==1.13.0
Requires:       python-mdurl==0.1.2
Requires:       python-openapi-pydantic==0.5.1
Requires:       python-pycparser==2.22
Requires:       python-pydantic==2.11.9
Requires:       python-pydantic-core==2.33.2
Requires:       python-pydantic-settings==2.10.1
Requires:       python-pygments==2.19.2
Requires:       python-python-dotenv==1.1.1
Requires:       python-python-multipart==0.0.20
Requires:       python-referencing==0.36.2
Requires:       python-rich==14.1.0
Requires:       python-rpds-py==0.26.0
Requires:       python-shellingham==1.5.4
Requires:       python-sniffio==1.3.1
Requires:       python-sse-starlette==2.3.6
Requires:       python-starlette==0.47.2
Requires:       python-typer==0.19.2
Requires:       python-typing-extensions==4.15.0
Requires:       python-typing-inspection==0.4.1
Requires:       python-uvicorn==0.36.0
Requires:       python-websockets==15.0.1
# end deps extracted from pyproject-toml

BuildArch:      noarch

%if %{with libalternatives}
BuildRequires:  alts
Requires:       alts
%else
Requires(post): update-alternatives
Requires(postun): update-alternatives
%endif
%python_subpackages

%description
Model Context Protocol Server for Uyuni Server API.

%prep
%autosetup -p1 -n mcp-server-uyuni-%{version}

%build
%pyproject_wheel

%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%python_clone -a %{buildroot}%{_bindir}/mcp-server-uyuni

%post
%python_install_alternative mcp-server-uyuni

%postun
%python_uninstall_alternative mcp-server-uyuni

%files %{python_files}
%license LICENSE
%python_alternative %{_bindir}/mcp-server-uyuni
%{python_sitelib}/mcp_server_uyuni*

%changelog
openSUSE Build Service is sponsored by