From 80eeaee860400269e475c01044f865578223dc1573d075bca5a2fc29ddef170a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Thu, 27 Mar 2025 09:32:56 +0000 Subject: [PATCH] Accepting request 1256247 from home:nkrapp:branches:devel:languages:python - Use libalternatives instead of update-alternatives, bsc#1240097 - No more greedy globs in %files. - Use python3 in pyinotify script OBS-URL: https://build.opensuse.org/request/show/1256247 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyinotify?expand=0&rev=37 --- pyinotify | 2 +- python-pyinotify.changes | 7 +++++++ python-pyinotify.spec | 20 ++++++++++++++++++-- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/pyinotify b/pyinotify index 36c8976..44134b2 100644 --- a/pyinotify +++ b/pyinotify @@ -1,2 +1,2 @@ #!/bin/sh -python -m pyinotify "$@" +python3 -m pyinotify "$@" diff --git a/python-pyinotify.changes b/python-pyinotify.changes index 2e9a185..0947089 100644 --- a/python-pyinotify.changes +++ b/python-pyinotify.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Mar 26 11:57:29 UTC 2025 - Nico Krapp + +- Use libalternatives instead of update-alternatives, bsc#1240097 +- No more greedy globs in %files. +- Use python3 in pyinotify script + ------------------------------------------------------------------- Fri Mar 21 10:42:17 UTC 2025 - Pablo Suárez Hernández diff --git a/python-pyinotify.spec b/python-pyinotify.spec index b3fc770..b55133a 100644 --- a/python-pyinotify.spec +++ b/python-pyinotify.spec @@ -16,7 +16,12 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif + %{?sle15_python_module_pythons} Name: python-pyinotify Version: 0.9.6 @@ -31,8 +36,13 @@ Source1: pyinotify Patch0: make_asyncore_support_optional.patch BuildRequires: %{python_module setuptools} BuildRequires: python-rpm-macros +%if %{with libalternatives} +Requires: alts +BuildRequires: alts +%else Requires(post): update-alternatives Requires(postun): update-alternatives +%endif BuildArch: noarch %python_subpackages @@ -67,6 +77,10 @@ sed -i "s|#!%{_bindir}/env python|#!%__python3|" python3/examples/*py install -D -m 0755 %{SOURCE1} %{buildroot}%{_bindir}/pyinotify %python_clone -a %{buildroot}%{_bindir}/pyinotify +%pre +# If libalternatives is used: Removing old update-alternatives entries. +%python_libalternatives_reset_alternative pyinotify + %post %python_install_alternative pyinotify @@ -79,6 +93,8 @@ install -D -m 0755 %{SOURCE1} %{buildroot}%{_bindir}/pyinotify %doc old/ChangeLog old/NEWS %doc python3/examples %python_alternative %{_bindir}/pyinotify -%{python_sitelib}/* +%{python_sitelib}/pyinotify.py +%{python_sitelib}/pyinotify-%{version}*.egg-info +%pycache_only %{python_sitelib}/__pycache__ %changelog