Skip to content

Commit ab73b4a

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 ab73b4a

3 files changed

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

0 commit comments

Comments
 (0)