Update setup.py for older distributions

Use explicit setup.py build commands
Resolves: RHEL-119895

Signed-off-by: John Kacur <jkacur@redhat.com>
This commit is contained in:
John Kacur 2025-11-24 15:33:00 -05:00
parent 372d6d729f
commit 7636166183
2 changed files with 18 additions and 14 deletions

View File

@ -1,4 +1,4 @@
From c19382fe2faa38e4245b83e42dd67fc810b01dba Mon Sep 17 00:00:00 2001
From db0befabfdecefc8ba3ef8f86d0704a5cf7ace9f Mon Sep 17 00:00:00 2001
From: John Kacur <jkacur@redhat.com>
Date: Wed, 19 Nov 2025 11:12:44 -0500
Subject: [PATCH] python-linux-procfs: Add setup.py for older distributions
@ -13,17 +13,17 @@ on RPM-based systems.
Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
---
setup.py | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
setup.py | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)
create mode 100644 setup.py
diff --git a/setup.py b/setup.py
new file mode 100644
index 000000000000..7a711331607f
index 000000000000..d048571c3b5c
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,52 @@
+#!/usr/bin/env python3
@@ -0,0 +1,51 @@
+#!/usr/bin/python
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# setup.py - Legacy setup script for older distributions
@ -59,9 +59,11 @@ index 000000000000..7a711331607f
+ maintainer_email="jkacur@redhat.com",
+ url="https://www.kernel.org/pub/software/libs/python/python-linux-procfs",
+ license="GPL-2.0-only",
+ long_description="""\
+Abstractions to extract information from the Linux kernel /proc files.
+""",
+ packages=find_packages(include=["procfs*"]),
+ scripts=["pflags"],
+ python_requires=">=3.10",
+ install_requires=[],
+ classifiers=[
+ "Development Status :: 4 - Beta",
@ -69,9 +71,6 @@ index 000000000000..7a711331607f
+ "License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
+ "Operating System :: POSIX :: Linux",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11",
+ "Programming Language :: Python :: 3.12",
+ "Topic :: System :: Operating System Kernels :: Linux",
+ ],
+)

View File

@ -1,6 +1,6 @@
Name: python-linux-procfs
Version: 0.7.4
Release: 1%{?dist}
Release: 2%{?dist}
License: GPLv2
Summary: Linux /proc abstraction classes
URL: https://git.kernel.org/pub/scm/libs/python/%{name}/%{name}.git
@ -21,7 +21,7 @@ Patch0: python-linux-procfs-Add-setup.py-for-older-distributions.patch
Summary: %summary
%{?python_provide:%python_provide python3-linux-procfs}
Requires: python3 >= 3.10
Requires: python3
%description -n python3-linux-procfs %_description
@ -29,11 +29,11 @@ Requires: python3 >= 3.10
%autosetup -p1
%build
%py3_build
%{__python3} setup.py build
%install
rm -rf %{buildroot}
%py3_install
%{__python3} setup.py install --root=%{buildroot}
%files -n python3-linux-procfs
%defattr(0755,root,root,0755)
@ -44,6 +44,11 @@ rm -rf %{buildroot}
%license COPYING
%changelog
* Sun Nov 24 2025 John Kacur <jkacur@redhat.com> - 0.7.4-2
- Update setup.py for older distributions
- Use explicit setup.py build commands
Resolves: RHEL-119895
* Wed Nov 19 2025 John Kacur <jkacur@redhat.com> - 0.7.4-1
- Rebase to upstream python-linux-procfs-0.7.4
Resolves: RHEL-119895