public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/ksc] rawhide: Convert to pyproject RPM macros (rhbz#2377303)
@ 2026-11-09 9:25
0 siblings, 0 replies; only message in thread
From: @ 2026-11-09 9:25 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/ksc
Branch : rawhide
Commit : 45a043abff8ddb9b4655ee1cec012a01802ba6b3
Author : Miro Hrončok <miro@hroncok.cz>
Date : 2026-11-06T13:48:56+01:00
Stats : +46/-9 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/ksc/c/45a043abff8ddb9b4655ee1cec012a01802ba6b3?branch=rawhide
Log:
Convert to pyproject RPM macros (rhbz#2377303)
This was converted en masse with other packages by LLM and then polished by me.
Assisted-By: Claude Sonnet 5
---
diff --git a/ksc-no-absolute-datafiles.patch b/ksc-no-absolute-datafiles.patch
new file mode 100644
index 0000000..c212b73
--- /dev/null
+++ b/ksc-no-absolute-datafiles.patch
@@ -0,0 +1,28 @@
+Use prefix-relative data_files paths instead of absolute ones to enable wheel-based installation
+
+setuptools' modern wheel-based build/install (as used by the pyproject
+RPM macros) does not honor absolute data_files paths the way the legacy
+"setup.py install" did -- it packs them into the wheel at its root, so
+pip ends up installing them under site-packages instead of their real
+locations.
+
+Making the paths relative to the install prefix fixes this for
+everything except /etc, which is not under the prefix; the RPM spec
+moves that file into place after install.
+
+--- a/setup.py
++++ b/setup.py
+@@ -29,8 +29,8 @@
+ author="Kushal Das, Samikshan Bairagya, Stanislav Kozina, Martin Lacko, Ziqian Sun",
+ author_email="kdas@redhat.com, sbairagy@redhat.com, skozina@redhat.com, mlacko@redhat.com, zsun@redhat.com",
+ license="http://www.gnu.org/copyleft/gpl.html",
+- data_files=[("/usr/bin", ['ksc']),
+- ('/etc', ['data/ksc.conf']),
+- ('/usr/share/ksc', ['ksc.py', 'utils.py']),
+- ('/usr/share/ksc/data', ['data/ksc.conf']),
+- ('/usr/share/ksc/bugzilla', bugzilla)])
++ data_files=[("bin", ['ksc']),
++ ('etc', ['data/ksc.conf']),
++ ('share/ksc', ['ksc.py', 'utils.py']),
++ ('share/ksc/data', ['data/ksc.conf']),
++ ('share/ksc/bugzilla', bugzilla)])
diff --git a/ksc.spec b/ksc.spec
index 950ee75..e380d88 100644
--- a/ksc.spec
+++ b/ksc.spec
@@ -3,12 +3,11 @@
%global commit 5955c6b2288353c5b093677221cc91a83a2c800c
%global shortcommit %(c=%{commit}; echo ${c:0:7})
-%{?python_enable_dependency_generator}
%forgemeta
Name: ksc
Version: 1.7
-Release: 15%{?dist}
+Release: 16%{?dist}
Summary: Kernel source code checker
Group: Development/Tools
AutoReqProv: no
@@ -20,35 +19,45 @@ Requires: binutils
Requires: kernel-devel
Requires: python3-requests
BuildRequires: python3-devel
-BuildRequires: python3-setuptools
Source0: https://github.com/RedHatOfficial/ksc/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
+# Use prefix-relative data_files paths instead of absolute ones to enable wheel-based installation
+# Not sent upstream yet
+# Requires %%install fixup for /etc
+Patch: ksc-no-absolute-datafiles.patch
+
%description
A kernel module source code checker to find usage of select symbols
%prep
-%forgesetup
+%forgeautosetup -p1
# Fix build with setuptools 62.1
# https://github.com/RedHatOfficial/ksc/issues/3
sed -i "15i packages=[]," setup.py
+%generate_buildrequires
+%pyproject_buildrequires
+
%build
-%py3_build
+%pyproject_wheel
%install
-%py3_install
+%pyproject_install
+%pyproject_save_files -l -M
+mv %{buildroot}%{_prefix}/etc %{buildroot}%{_sysconfdir}
install -D ksc.1 %{buildroot}%{_mandir}/man1/ksc.1
-%files
-%license COPYING
+%files -f %{pyproject_files}
%doc README PKG-INFO
%{_bindir}/ksc
%{_datadir}/ksc
%{_mandir}/man1/ksc.*
%config(noreplace) %{_sysconfdir}/ksc.conf
-%{python3_sitelib}/ksc-%{version}*.egg-info
%changelog
+* Thu Nov 05 2026 Miro Hrončok <miro@hroncok.cz> - 1.7-16
+- Convert to pyproject RPM macros (rhbz#2377303)
+
* Thu Jul 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 1.7-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-09 9:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-09 9:25 [rpms/ksc] rawhide: Convert to pyproject RPM macros (rhbz#2377303)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox