From cbff04b16965635a8bc968213b9dde3044ffe32f5bbb369238dbc88cd4183751 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Tue, 3 Nov 2020 16:09:29 +0000 Subject: [PATCH] Accepting request 845737 from home:bnavigator:branches:devel:languages:python - move bash completion into separate package to avoid conflicts with multiple python flavors gh#openSUSE/python-rpm-macros#66 OBS-URL: https://build.opensuse.org/request/show/845737 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-tqdm?expand=0&rev=86 --- python-tqdm.changes | 6 ++++++ python-tqdm.spec | 26 +++++++++++++++++++++++--- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/python-tqdm.changes b/python-tqdm.changes index dff3c25..173fe45 100644 --- a/python-tqdm.changes +++ b/python-tqdm.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Nov 3 14:06:32 UTC 2020 - Benjamin Greiner + +- move bash completion into separate package to avoid conflicts + with multiple python flavors gh#openSUSE/python-rpm-macros#66 + ------------------------------------------------------------------- Fri Oct 23 13:47:03 UTC 2020 - pgajdos@suse.com diff --git a/python-tqdm.spec b/python-tqdm.spec index 19db456..c01b3ba 100644 --- a/python-tqdm.spec +++ b/python-tqdm.spec @@ -17,7 +17,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} -%define oldpython python +%define allpython python %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "test" %define test 1 @@ -60,9 +60,26 @@ any iterable with "tqdm(iterable)". tqdm's overhead is one order of magnitude less than python-progressbar and does not require ncurses. +%package -n %allpython-tqdm-bash-completion +Summary: Bash completion for python-tqdm +Requires: bash-completion +Supplements: ((%{lua: print(string.sub(rpm.expand("%{python_module tqdm or}"),0,-4))}) and bash) + +%description -n %allpython-tqdm-bash-completion +tqdm lets you output a progress meter from within loops by wrapping +any iterable with "tqdm(iterable)". +tqdm's overhead is one order of magnitude less than python-progressbar +and does not require ncurses. + +This package provides the completion file for bash + + %prep %setup -q -n tqdm-%{version} %patch0 -p1 +# remove bash shebang for completion script +sed -i '1 s/^#!.*/# bash completion for tqdm -*- shell-script -*-/' tqdm/completion.sh +chmod a-x tqdm/completion.sh %build %python_build @@ -77,7 +94,7 @@ install -m 644 -D tqdm/completion.sh %{buildroot}%{_datadir}/bash-completion/com %if !%{with test} %post -%{python_install_alternative tqdm tqdm.1} +%python_install_alternative tqdm %postun %python_uninstall_alternative tqdm @@ -99,8 +116,11 @@ install -m 644 -D tqdm/completion.sh %{buildroot}%{_datadir}/bash-completion/com %doc examples/ %license LICENCE %{python_sitelib}/tqdm/ -%{python_sitelib}/tqdm-%{version}-py*.egg-info +%{python_sitelib}/tqdm-%{version}*-info %python_alternative %{_bindir}/tqdm + +%files -n %allpython-tqdm-bash-completion +%license LICENCE %{_datadir}/bash-completion/completions/tqdm %endif