forked from pool/python-jsonpatch
Accepting request 419498 from home:TheBlackCat:branches:devel:languages:python
Fix update-alternatives implementation. OBS-URL: https://build.opensuse.org/request/show/419498 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-jsonpatch?expand=0&rev=21
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Aug 15 14:51:56 UTC 2016 - toddrme2178@gmail.com
|
||||||
|
|
||||||
|
- Fix update-alternatives implementation.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Jun 22 14:36:43 UTC 2015 - tbechtold@suse.com
|
Mon Jun 22 14:36:43 UTC 2015 - tbechtold@suse.com
|
||||||
|
|
||||||
|
|||||||
@@ -27,9 +27,8 @@ Source: http://pypi.python.org/packages/source/j/jsonpatch/jsonpatch-%{v
|
|||||||
BuildRequires: python-devel
|
BuildRequires: python-devel
|
||||||
BuildRequires: python-jsonpointer
|
BuildRequires: python-jsonpointer
|
||||||
Requires: python-jsonpointer >= 1.9
|
Requires: python-jsonpointer >= 1.9
|
||||||
Requires(post): update-alternatives
|
Requires(post): update-alternatives
|
||||||
Requires(postun): update-alternatives
|
Requires(preun): update-alternatives
|
||||||
Requires(pre): coreutils
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
|
%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()")}
|
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
||||||
@@ -49,31 +48,32 @@ python setup.py build
|
|||||||
|
|
||||||
%install
|
%install
|
||||||
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
|
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
|
||||||
for i in patch diff; do
|
|
||||||
mv %{buildroot}%{_bindir}/json$i %{buildroot}%{_bindir}/json$i-%{py_ver}
|
# Prepare for update-alternatives usage
|
||||||
ln -s %{_bindir}/json$i-%{py_ver} %{buildroot}%{_bindir}/json$i
|
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
|
||||||
|
for p in jsonpatch jsondiff ; do
|
||||||
|
mv %{buildroot}%{_bindir}/$p %{buildroot}%{_bindir}/$p-%{py_ver}
|
||||||
|
ln -s -f %{_sysconfdir}/alternatives/$p %{buildroot}%{_bindir}/$p
|
||||||
done
|
done
|
||||||
|
|
||||||
%pre
|
|
||||||
[ -h %{_bindir}/jsonpatch ] || rm -f %{_bindir}/jsonpatch
|
|
||||||
[ -h %{_bindir}/jsondiff ] || rm -f %{_bindir}/jsondiff
|
|
||||||
|
|
||||||
%post
|
%post
|
||||||
update-alternatives --install \
|
%_sbindir/update-alternatives \
|
||||||
%{_bindir}/jsonpatch jsonpatch %{_bindir}/jsonpatch-%{py_ver} 20 \
|
--install %{_bindir}/jsonpatch jsonpatch %{_bindir}/jsonpatch-%{py_ver} 20 \
|
||||||
--slave %{_bindir}/jsondiff jsondiff %{_bindir}/jsondiff-%{py_ver}
|
--slave %{_bindir}/jsondiff jsondiff %{_bindir}/jsondiff-%{py_ver}
|
||||||
|
|
||||||
%preun
|
%preun
|
||||||
if [ $1 -eq 0 ] ; then
|
if [ $1 -eq 0 ] ; then
|
||||||
update-alternatives --remove jsonpatch %{_bindir}/jsonpatch-%{py_ver}
|
%_sbindir/update-alternatives --remove jsonpatch %{_bindir}/jsonpatch-%{py_ver}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%ghost %{_bindir}/jsonpatch
|
%{_bindir}/jsondiff
|
||||||
%{_bindir}/jsonpatch-%{py_ver}
|
%{_bindir}/jsonpatch
|
||||||
%ghost %{_bindir}/jsondiff
|
|
||||||
%{_bindir}/jsondiff-%{py_ver}
|
%{_bindir}/jsondiff-%{py_ver}
|
||||||
|
%{_bindir}/jsonpatch-%{py_ver}
|
||||||
|
%ghost %{_sysconfdir}/alternatives/jsondiff
|
||||||
|
%ghost %{_sysconfdir}/alternatives/jsonpatch
|
||||||
%{python_sitelib}/jsonpatch*
|
%{python_sitelib}/jsonpatch*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
|||||||
Reference in New Issue
Block a user