diff --git a/.gitignore b/.gitignore index 5295ba4..6b67032 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -SOURCES/pyinotify-0.9.6.tar.gz -/pyinotify-0.9.6.tar.gz +pyinotify-0.9.6.tar.gz diff --git a/gating.yaml b/gating.yaml deleted file mode 100644 index 25fbd0d..0000000 --- a/gating.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- !Policy -product_versions: - - rhel-8 -decision_context: osci_compose_gate -rules: - - !PassingTestCaseRule {test_case_name: manual.sst_cs_system_management.python-inotify.legacy} diff --git a/pyinotify-python-3.12-fix.patch b/pyinotify-python-3.12-fix.patch new file mode 100644 index 0000000..565138b --- /dev/null +++ b/pyinotify-python-3.12-fix.patch @@ -0,0 +1,82 @@ +commit 478d595a7d086423733e9f5da5edfe9f1df48682 +Author: Troy Curtis Jr +Date: Thu Aug 10 21:51:15 2023 -0400 + + Make asyncore support optional for Python 3. + + Fixes #204. + +diff --git a/python3/pyinotify.py b/python3/pyinotify.py +index bc24313..f4a5a90 100755 +--- a/python3/pyinotify.py ++++ b/python3/pyinotify.py +@@ -68,7 +68,6 @@ from collections import deque + from datetime import datetime, timedelta + import time + import re +-import asyncore + import glob + import locale + import subprocess +@@ -1494,33 +1493,40 @@ class ThreadedNotifier(threading.Thread, Notifier): + self.loop() + + +-class AsyncNotifier(asyncore.file_dispatcher, Notifier): +- """ +- This notifier inherits from asyncore.file_dispatcher in order to be able to +- use pyinotify along with the asyncore framework. ++try: ++ import asyncore + +- """ +- def __init__(self, watch_manager, default_proc_fun=None, read_freq=0, +- threshold=0, timeout=None, channel_map=None): ++ class AsyncNotifier(asyncore.file_dispatcher, Notifier): + """ +- Initializes the async notifier. The only additional parameter is +- 'channel_map' which is the optional asyncore private map. See +- Notifier class for the meaning of the others parameters. ++ This notifier inherits from asyncore.file_dispatcher in order to be able to ++ use pyinotify along with the asyncore framework. + + """ +- Notifier.__init__(self, watch_manager, default_proc_fun, read_freq, +- threshold, timeout) +- asyncore.file_dispatcher.__init__(self, self._fd, channel_map) ++ def __init__(self, watch_manager, default_proc_fun=None, read_freq=0, ++ threshold=0, timeout=None, channel_map=None): ++ """ ++ Initializes the async notifier. The only additional parameter is ++ 'channel_map' which is the optional asyncore private map. See ++ Notifier class for the meaning of the others parameters. + +- def handle_read(self): +- """ +- When asyncore tells us we can read from the fd, we proceed processing +- events. This method can be overridden for handling a notification +- differently. ++ """ ++ Notifier.__init__(self, watch_manager, default_proc_fun, read_freq, ++ threshold, timeout) ++ asyncore.file_dispatcher.__init__(self, self._fd, channel_map) + +- """ +- self.read_events() +- self.process_events() ++ def handle_read(self): ++ """ ++ When asyncore tells us we can read from the fd, we proceed processing ++ events. This method can be overridden for handling a notification ++ differently. ++ ++ """ ++ self.read_events() ++ self.process_events() ++except ImportError: ++ # asyncore was removed in Python 3.12, but try the import instead of a ++ # version check in case the compatibility package is installed. ++ pass + + + class TornadoAsyncNotifier(Notifier): diff --git a/python-inotify.spec b/python-inotify.spec index 3b3e682..88cdc9a 100644 --- a/python-inotify.spec +++ b/python-inotify.spec @@ -3,52 +3,44 @@ Summary: Monitor filesystem events with Python under Linux Name: python-inotify Version: 0.9.6 -Release: 13%{?dist} +Release: 36%{?dist} License: MIT -Group: Development/Libraries URL: https://github.com/seb-m/pyinotify Source0: http://seb.dbzteam.org/pub/pyinotify/releases/pyinotify-%{version}.tar.gz Patch01: pyinotify-0.9.6-epoint.patch +# Upstream pull request https://github.com/seb-m/pyinotify/pull/205 +# Upstream issue https://github.com/seb-m/pyinotify/issues/204 +Patch02: pyinotify-python-3.12-fix.patch BuildRequires: gmp-devel -BuildRequires: python3-devel +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-setuptools BuildArch: noarch +%global _description \ +This is a Python module for watching filesystems changes. pyinotify \ +can be used for various kind of fs monitoring. Based on inotify which \ +is an event-driven notifier, where notifications are exported from \ +kernel space to user space. +%description %_description -%description -This is a Python module for watching filesystems changes. pyinotify -can be used for various kind of fs monitoring. pyinotify relies on a -recent Linux Kernel feature (merged in kernel 2.6.13) called -inotify. inotify is an event-driven notifier, its notifications are -exported from kernel space to user space. - -%package -n python3-inotify -Summary: Monitor filesystem events with Python under Linux -Group: Development/Languages -%{?python_provide:%python_provide python3-inotify} - -%description -n python3-inotify -This is a Python 3 module for watching filesystems changes. pyinotify -can be used for various kind of fs monitoring. pyinotify relies on a -recent Linux Kernel feature (merged in kernel 2.6.13) called -inotify. inotify is an event-driven notifier, its notifications are -exported from kernel space to user space. +%package -n python%{python3_pkgversion}-inotify +Summary: %{summary} +%{?python_provide:%python_provide python%{python3_pkgversion}-inotify} +%description -n python%{python3_pkgversion}-inotify %_description %prep -%setup -q -n %{oname}-%{version} -%patch01 -p1 -rm -rf %{py3dir} -cp -a . %{py3dir} +%autosetup -p1 -n %{oname}-%{version} +sed -i '1c#! %{__python3}' python3/pyinotify.py %build -pushd %{py3dir} %py3_build -popd %install -pushd %{py3dir} %py3_install -popd -%files -n python3-inotify +%check +%py3_check_import pyinotify + +%files -n python%{python3_pkgversion}-inotify %license COPYING %doc ACKS README.md %{_bindir}/%{oname} @@ -56,11 +48,85 @@ popd %{python3_sitelib}/__pycache__/%{oname}* %changelog -* Thu Nov 15 2018 Matej Marusak - 0.9.6-13 -- Only ship one executable (#1646714) +* Tue Oct 29 2024 Troy Dawson - 0.9.6-36 +- Bump release for October 2024 mass rebuild: + Resolves: RHEL-64018 -* Mon Apr 09 2018 Miroslav Suchy - 0.9.6-12 -- remove python2 subpackage +* Mon Jun 24 2024 Troy Dawson - 0.9.6-35 +- Bump release for June 2024 mass rebuild + +* Fri Jan 26 2024 Fedora Release Engineering - 0.9.6-34 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Mon Jan 22 2024 Fedora Release Engineering - 0.9.6-33 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Thu Aug 10 2023 Troy Curtis, Jr - 0.9.6-32 +- Fixes build for Python 3.12 (#2219556) + +* Fri Jul 21 2023 Fedora Release Engineering - 0.9.6-31 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Tue Jun 13 2023 Python Maint - 0.9.6-30 +- Rebuilt for Python 3.12 + +* Fri Jan 20 2023 Fedora Release Engineering - 0.9.6-29 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Fri Jul 22 2022 Fedora Release Engineering - 0.9.6-28 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Mon Jun 13 2022 Python Maint - 0.9.6-27 +- Rebuilt for Python 3.11 + +* Fri Jan 21 2022 Fedora Release Engineering - 0.9.6-26 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Fri Jul 23 2021 Fedora Release Engineering - 0.9.6-25 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Fri Jun 04 2021 Python Maint - 0.9.6-24 +- Rebuilt for Python 3.10 + +* Wed Jan 27 2021 Fedora Release Engineering - 0.9.6-23 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Wed Jul 29 2020 Fedora Release Engineering - 0.9.6-22 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue May 26 2020 Miro Hrončok - 0.9.6-21 +- Rebuilt for Python 3.9 + +* Thu Jan 30 2020 Fedora Release Engineering - 0.9.6-20 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Fri Nov 29 2019 Miro Hrončok - 0.9.6-19 +- Subpackages python2-inotify, python2-inotify-examples have been removed + See https://fedoraproject.org/wiki/Changes/RetirePython2 + +* Thu Oct 03 2019 Miro Hrončok - 0.9.6-18 +- Rebuilt for Python 3.8.0rc1 (#1748018) + +* Mon Aug 19 2019 Miro Hrončok - 0.9.6-17 +- Rebuilt for Python 3.8 + +* Fri Jul 26 2019 Fedora Release Engineering - 0.9.6-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Sat Feb 02 2019 Fedora Release Engineering - 0.9.6-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Tue Nov 06 2018 Miro Hrončok - 0.9.6-14 +- Only ship one executable (#1646926) + +* Sun Jul 15 2018 Terje Rosten - 0.9.4-14 +- Use correct python macros + +* Sat Jul 14 2018 Fedora Release Engineering - 0.9.6-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Tue Jun 19 2018 Miro Hrončok - 0.9.6-12 +- Rebuilt for Python 3.7 * Fri Feb 09 2018 Fedora Release Engineering - 0.9.6-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild