Skip to content

Commit 5e12016

Browse files
committed
Add packit config and rpm specfile
Packit integration will help us to keep generating new copr builds from each pull request and main push automatically.
1 parent 45739b7 commit 5e12016

3 files changed

Lines changed: 85 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,4 @@ config.sh
5656

5757
.claude/settings.local.json
5858
CLAUDE.local.md
59+
prepare_sources_result*/

.packit.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# See the documentation for more information:
2+
# https://packit.dev/docs/configuration/
3+
4+
specfile_path: packaging/linux-mcp-server.spec
5+
6+
# name in upstream package repository or registry (e.g. in PyPI)
7+
upstream_package_name: linux-mcp-server
8+
# downstream (Fedora) RPM package name
9+
downstream_package_name: linux-mcp-server
10+
11+
srpm_build_deps: []
12+
13+
jobs:
14+
# Build RPMs for each pull request
15+
- job: copr_build
16+
trigger: pull_request
17+
owner: "@rhel-lightspeed"
18+
project: linux-mcp-server
19+
targets:
20+
# TODO(r0x0d): Remove this once packit updates `fedora-all`
21+
- fedora-42-x86_64
22+
- fedora-43-x86_64
23+
- fedora-rawhide-x86_64
24+
25+
# Build RPMs for main branch
26+
- job: copr_build
27+
trigger: commit
28+
branch: main
29+
owner: "@rhel-lightspeed"
30+
project: linux-mcp-server
31+
targets:
32+
# TODO(r0x0d): Remove this once packit updates `fedora-all`
33+
- fedora-42-x86_64
34+
- fedora-43-x86_64
35+
- fedora-rawhide-x86_64

packaging/linux-mcp-server.spec

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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

Comments
 (0)