|
| 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: %{pypi_source linux_mcp_server} |
| 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: tomcli |
| 19 | +BuildRequires: git-core |
| 20 | +BuildRequires: python3dist(devel) |
| 21 | +BuildRequires: python3dist(pip) |
| 22 | + |
| 23 | +# TODO(r0x0d): Vendoring the mcp dependency as of now since it is not |
| 24 | +# available in Fedora. |
| 25 | +Provides: bundled(python3dist(mcp)) = %{_mcp_version} |
| 26 | + |
| 27 | +%global _description %{expand: |
| 28 | +MCP server for read-only Linux system administration, diagnostics, and troubleshooting |
| 29 | +} |
| 30 | + |
| 31 | +%description %_description |
| 32 | + |
| 33 | +%package -n python3-%{_srcname} |
| 34 | +Summary: %{summary} |
| 35 | + |
| 36 | +%description -n python3-%{_srcname} %_description |
| 37 | + |
| 38 | +%prep -a |
| 39 | +# Drop the mcp dependency as we are bundling it from Source1. |
| 40 | +tomcli set pyproject.toml arrays delitem project.dependencies "mcp.*" |
| 41 | + |
| 42 | +# Remove dynamic version from pyproject.toml (workaround for packit) |
| 43 | +tomcli set pyproject.toml del project.dynamic |
| 44 | + |
| 45 | +# Add version to pyproject.toml (workaround for packit) |
| 46 | +tomcli set pyproject.toml str project.version %{version} |
| 47 | + |
| 48 | +# Install mcp to _vendor |
| 49 | +%{python3} -m pip install %{SOURCE1} --target src/linux_mcp_server/_vendor |
| 50 | + |
| 51 | +export PIP_FIND_LINKS=$PWD/_vendor |
| 52 | +export PYTHONPATH=$PWD/_vendor:$PYTHONPATH |
| 53 | + |
| 54 | +%files -n python3-%{_srcname} -f %{pyproject_files} |
| 55 | + |
| 56 | +%changelog |
| 57 | +%autochangelog |
0 commit comments