From b64d465d459464d5aca168d2fd46214f3fc8d3bde5de0c2377e0b6abf91019ac Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Tue, 6 Dec 2016 12:05:45 +0000 Subject: [PATCH] Accepting request 443108 from home:termim:branches:devel:languages:python implement update-alternatives OBS-URL: https://build.opensuse.org/request/show/443108 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-blockdiag?expand=0&rev=2 --- python-blockdiag.changes | 5 +++++ python-blockdiag.spec | 19 +++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/python-blockdiag.changes b/python-blockdiag.changes index 1895398..aa8f238 100644 --- a/python-blockdiag.changes +++ b/python-blockdiag.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Dec 1 20:18:05 UTC 2016 - termim@gmail.com + +- use update-alternatives + ------------------------------------------------------------------- Thu May 12 07:12:05 UTC 2016 - tbechtold@suse.com diff --git a/python-blockdiag.spec b/python-blockdiag.spec index c8f1e60..a476a90 100644 --- a/python-blockdiag.spec +++ b/python-blockdiag.spec @@ -23,9 +23,12 @@ Summary: Generates block-diagram image from text License: Apache-2.0 Group: Development/Languages/Python Url: http://blockdiag.com/ -Source: https://pypi.python.org/packages/source/b/blockdiag/blockdiag-%{version}.tar.gz +Source: https://files.pythonhosted.org/packages/source/b/blockdiag/blockdiag-%{version}.tar.gz BuildRequires: python-devel BuildRequires: python-setuptools +BuildRequires: fdupes +Requires(post): update-alternatives +Requires(postun): update-alternatives Requires: python-Pillow Requires: python-funcparserlib Requires: python-webcolors @@ -50,11 +53,23 @@ python setup.py build %install python setup.py install --prefix=%{_prefix} --root=%{buildroot} +%fdupes %{buildroot}%{python_sitelib} +mv %{buildroot}%{_bindir}/blockdiag %{buildroot}%{_bindir}/blockdiag-%{py_ver} + +%post +update-alternatives \ + --install %{_bindir}/blockdiag blockdiag %{_bindir}/blockdiag-%{py_ver} 50 + +%postun +if [ $1 -eq 0 ] ; then + update-alternatives --remove blockdiag %{_bindir}/blockdiag-%{py_ver} +fi %files %defattr(-,root,root,-) %doc CHANGES.rst LICENSE README.rst -%{_bindir}/blockdiag +%{_bindir}/blockdiag-%{py_ver} %{python_sitelib}/* +%ghost %{_sysconfdir}/alternatives/blockdiag %changelog