From 8f667aa9e5c739e85ed714f7b0c04c55d122712b488da605028984d586eff68b Mon Sep 17 00:00:00 2001 From: Todd R Date: Mon, 15 Aug 2016 15:52:22 +0000 Subject: [PATCH] Accepting request 419455 from home:TheBlackCat:branches:devel:languages:python Fix update-alternatives implementation OBS-URL: https://build.opensuse.org/request/show/419455 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-jsonpointer?expand=0&rev=15 --- python-jsonpointer.changes | 5 +++++ python-jsonpointer.spec | 24 ++++++++++++------------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/python-jsonpointer.changes b/python-jsonpointer.changes index f34221d..fcc0fb5 100644 --- a/python-jsonpointer.changes +++ b/python-jsonpointer.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Aug 15 14:51:56 UTC 2016 - toddrme2178@gmail.com + +- Fix update-alternatives implementation. + ------------------------------------------------------------------- Mon Jun 22 14:49:05 UTC 2015 - tbechtold@suse.com diff --git a/python-jsonpointer.spec b/python-jsonpointer.spec index da4a5d5..bb3a3df 100644 --- a/python-jsonpointer.spec +++ b/python-jsonpointer.spec @@ -19,16 +19,15 @@ Name: python-jsonpointer Version: 1.9 Release: 0 -Summary: Identify specific nodes in a JSON document (according to draft 08) +Summary: Identify specific nodes in a JSON document License: BSD-3-Clause Group: Development/Languages/Python Url: https://github.com/stefankoegl/python-json-pointer Source: http://pypi.python.org/packages/source/j/jsonpointer/jsonpointer-%{version}.tar.gz BuildRequires: python-devel BuildRequires: python-setuptools -Requires(post): update-alternatives -Requires(postun): update-alternatives -Requires(pre): coreutils +Requires(post): update-alternatives +Requires(preun): update-alternatives 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()")} @@ -47,25 +46,26 @@ python setup.py build %install python setup.py install --prefix=%{_prefix} --root=%{buildroot} -mv %{buildroot}%{_bindir}/jsonpointer %{buildroot}%{_bindir}/jsonpointer-%{py_ver} -ln -s %{_bindir}/jsonpointer-%{py_ver} %{buildroot}%{_bindir}/jsonpointer -%pre -[ -h %{_bindir}/jsonpointer ] || rm -f %{_bindir}/jsonpointer +# Prepare for update-alternatives usage +mkdir -p %{buildroot}%{_sysconfdir}/alternatives +mv %{buildroot}%{_bindir}/jsonpointer %{buildroot}%{_bindir}/jsonpointer-%{py_ver} +ln -s -f %{_sysconfdir}/alternatives/jsonpointer %{buildroot}%{_bindir}/jsonpointer %post -update-alternatives --install \ - %{_bindir}/jsonpointer jsonpointer %{_bindir}/jsonpointer-%{py_ver} 20 +%_sbindir/update-alternatives \ + --install %{_bindir}/jsonpointer jsonpointer %{_bindir}/jsonpointer-%{py_ver} 20 %preun if [ $1 -eq 0 ] ; then - update-alternatives --remove jsonpointer %{_bindir}/jsonpointer-%{py_ver} + %_sbindir/update-alternatives --remove jsonpointer %{_bindir}/jsonpointer-%{py_ver} fi %files %defattr(-,root,root,-) -%ghost %{_bindir}/jsonpointer +%{_bindir}/jsonpointer %{_bindir}/jsonpointer-%{py_ver} +%ghost %{_sysconfdir}/alternatives/jsonpointer %{python_sitelib}/* %changelog