From cfa00326f1491feae12b09b97ab9149e5cfcf2f47caec7b78b02f080b2eb632e Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 12 Nov 2016 08:00:09 +0000 Subject: [PATCH] Accepting request 438953 from home:achimh Introduced update-alternatives so package plays nice with python3 package OBS-URL: https://build.opensuse.org/request/show/438953 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-argcomplete?expand=0&rev=12 --- python-argcomplete.changes | 6 ++++++ python-argcomplete.spec | 33 ++++++++++++++++++++------------- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/python-argcomplete.changes b/python-argcomplete.changes index 1123dc0..41da797 100644 --- a/python-argcomplete.changes +++ b/python-argcomplete.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Nov 02 20:50:53 UTC 2016 - achim.herwig@wodca.de + +- ported back from python3 package including + introduced update-alternatives to coexist with corresponding python3 package + ------------------------------------------------------------------- Sat Dec 12 17:49:43 UTC 2015 - mimi.vx@gmail.com diff --git a/python-argcomplete.spec b/python-argcomplete.spec index 5b9e86e..a87ee54 100644 --- a/python-argcomplete.spec +++ b/python-argcomplete.spec @@ -1,7 +1,7 @@ # # spec file for package python-argcomplete # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2013 Darin Perusich. # # All modifications and additions to the file contributed by third parties @@ -28,14 +28,7 @@ Source: http://pypi.python.org/packages/source/a/argcomplete/argcomplete BuildRequires: python-devel BuildRequires: python-setuptools BuildRoot: %{_tmppath}/%{name}-%{version}-build - -%if 0%{?suse_version} && 0%{?suse_version} <= 1110 -%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} -BuildRequires: python-argparse -Requires: python-argparse -%else BuildArch: noarch -%endif %description argcomplete - Bash completion for argparse @@ -62,20 +55,34 @@ python setup.py build %install python setup.py install --prefix=%{_prefix} --root=%{buildroot} rm -rf %{buildroot}%{python_sitelib}/test +rm %{buildroot}/usr/bin/activate-global-python-argcomplete +rm %{buildroot}/usr/bin/register-python-argcomplete +mv %{buildroot}/usr/bin/python-argcomplete-check-easy-install-script \ + %{buildroot}/usr/bin/python-argcomplete-check-easy-install-script-%{py_ver} mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d/ -install -p -m0644 %{buildroot}%{python_sitelib}/argcomplete/bash_completion.d/python-argcomplete.sh %{buildroot}%{_sysconfdir}/bash_completion.d/ +ln -sf %{_sysconfdir}/alternatives/python-argcomplete.sh %{buildroot}%{_sysconfdir}/bash_completion.d/ +ln -sf %{_sysconfdir}/alternatives/python-argcomplete-check-easy-install-script %{buildroot}%{_bindir}/python-argcomplete-check-easy-install-script %check python setup.py test +%post +update-alternatives \ + --install %{_sysconfdir}/bash_completion.d/python-argcomplete.sh python-argcomplete.sh \ + %{python_sitelib}/argcomplete/bash_completion.d/python-argcomplete.sh 20 \ + --slave %{_bindir}/python-argcomplete-check-easy-install-script \ + python-argcomplete-check-easy-install-script \ + %{_bindir}/python-argcomplete-check-easy-install-script-%{py_ver} + %files %defattr(-,root,root,-) %doc LICENSE.rst README.rst -%{_bindir}/activate-global-python-argcomplete -%{_bindir}/python-argcomplete-check-easy-install-script -%{_bindir}/register-python-argcomplete +%ghost %{_bindir}/python-argcomplete-check-easy-install-script +%{_bindir}/python-argcomplete-check-easy-install-script-%{py_ver} %{python_sitelib}/argcomplete-%{version}-py%{py_ver}.egg-info %{python_sitelib}/argcomplete -%config %{_sysconfdir}/bash_completion.d/python-argcomplete.sh +%{_sysconfdir}/bash_completion.d/python-argcomplete.sh +%ghost %{_sysconfdir}/alternatives/python-argcomplete.sh +%ghost %{_sysconfdir}/alternatives/python-argcomplete-check-easy-install-script %changelog