|
| 1 | +%global _srcname linux-mcp-server |
| 2 | +%global _mcp_version 1.23.0 |
| 3 | + |
| 4 | +Name: python-%{_srcname} |
| 5 | +Version: 0.1.0a3 |
| 6 | +Release: %autorelease |
| 7 | +Summary: MCP server for read-only Linux system administration. |
| 8 | +License: Apache-2.0 |
| 9 | +URL: https://github.com/rhel-lightspeed/linux-mcp-server |
| 10 | +Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz |
| 11 | +Source1: %{pypi_source mcp %{_mcp_version}} |
| 12 | + |
| 13 | +BuildSystem: pyproject |
| 14 | +BuildOption(install): -l linux_mcp_server |
| 15 | +BuildOption(generate_buildrequires): -p |
| 16 | + |
| 17 | +BuildArch: noarch |
| 18 | +BuildRequires: python3-devel |
| 19 | +BuildRequires: tomcli |
| 20 | + |
| 21 | +# TODO(r0x0d): Vendoring the mcp dependency as of now since it is not |
| 22 | +# available in Fedora. |
| 23 | +Provides: bundled(python3dist(mcp)) = %{_mcp_version} |
| 24 | + |
| 25 | +%global _description %{expand: |
| 26 | +MCP server for read-only Linux system administration, diagnostics, and troubleshooting |
| 27 | +} |
| 28 | + |
| 29 | +%description %_description |
| 30 | + |
| 31 | +%package -n python3-%{_srcname} |
| 32 | +Summary: %{summary} |
| 33 | + |
| 34 | +%description -n python3-%{_srcname} %_description |
| 35 | + |
| 36 | +%prep -a |
| 37 | +# Drop the mcp dependency as we are bundling it from Source1. |
| 38 | +tomcli set pyproject.toml arrays delitem project.dependencies "mcp.*" |
| 39 | + |
| 40 | +# Extract mcp to _vendor |
| 41 | +tar -xzf %{SOURCE1} -C %{srcname}-%{version}/src/linux_mcp_server/_vendor/ --strip-components=1 |
| 42 | + |
| 43 | +export PIP_FIND_LINKS=$PWD/_vendor |
| 44 | +export PYTHONPATH=$PWD/_vendor:$PYTHONPATH |
| 45 | + |
| 46 | +%files -n python3-%{_srcname} -f %{pyproject_files} |
| 47 | + |
| 48 | +%changelog |
| 49 | +%autochangelog |
0 commit comments