From 77cbd826ceef7fa584668c2be99f53dd6d35e993dcbcc1587d9ce9c1c1cac8ab Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 6 May 2020 09:55:27 +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-CommonMark?expand=0&rev=23 --- python-CommonMark.changes | 5 +++++ python-CommonMark.spec | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/python-CommonMark.changes b/python-CommonMark.changes index 402c84a..78030b7 100644 --- a/python-CommonMark.changes +++ b/python-CommonMark.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed May 6 09:55:17 UTC 2020 - Matej Cepl + +- Don't use %python3_only command, but properly use alternatives. + ------------------------------------------------------------------- Mon Mar 16 10:26:20 UTC 2020 - Tomáš Chvátal diff --git a/python-CommonMark.spec b/python-CommonMark.spec index 6faaa46..78fc7a5 100644 --- a/python-CommonMark.spec +++ b/python-CommonMark.spec @@ -30,6 +30,8 @@ BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-setuptools +Requires(post): update-alternatives +Requires(postun): update-alternatives Provides: python-commonmark = %{version} Obsoletes: python-commonmark < %{version} BuildArch: noarch @@ -60,6 +62,7 @@ CommonMark specification, using only native modules. %install %python_install +%python_clone -a %{buildroot}%{_bindir}/cmark %python_expand %fdupes %{buildroot}%{$python_sitelib} %check @@ -68,10 +71,16 @@ export LANG=en_US.UTF-8 # On python2 we error out on unicode issues PYTHONPATH=%{buildroot}%{python3_sitelib} python3 setup.py test +%post +%python_install_alternative cmark + +%postun +%python_uninstall_alternative cmark + %files %{python_files} %license LICENSE %doc README.rst %{python_sitelib}/* -%python3_only %{_bindir}/cmark +%python_alternative %{_bindir}/cmark %changelog