From 56db6b673dcf83e9c7fcb4f1c48cf4a28123b6c5b1d099bfd5c1079f47f8c372 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Tue, 5 May 2020 22:19:03 +0000 Subject: [PATCH] - Don't use %python3_only command, but properly use alternatives. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pysrt?expand=0&rev=15 --- python-pysrt.changes | 5 +++++ python-pysrt.spec | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/python-pysrt.changes b/python-pysrt.changes index 255fe24..9724c1c 100644 --- a/python-pysrt.changes +++ b/python-pysrt.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue May 5 22:18:14 UTC 2020 - Matej Cepl + +- Don't use %python3_only command, but properly use alternatives. + ------------------------------------------------------------------- Fri Apr 17 11:45:05 UTC 2020 - Paolo Stivanin diff --git a/python-pysrt.spec b/python-pysrt.spec index 47750f3..f050275 100644 --- a/python-pysrt.spec +++ b/python-pysrt.spec @@ -31,6 +31,8 @@ BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-chardet +Requires(post): update-alternatives +Requires(postun): update-alternatives BuildArch: noarch %python_subpackages @@ -48,14 +50,21 @@ sed -e '1d' -i pysrt/commands.py %install %python_install +%python_clone -a %{buildroot}%{_bindir}/srt %python_expand %fdupes %{buildroot}%{$python_sitelib} %check %pytest +%post +%python_install_alternative srt + +%postun +%python_uninstall_alternative srt + %files %{python_files} %doc README.rst -%python3_only %{_bindir}/srt +%python_alternative %{_bindir}/srt %{python_sitelib}/pysrt %{python_sitelib}/pysrt-%{version}-py%{python_version}.egg-info