17
0

Accepting request 205476 from home:dirkmueller:branches:devel:languages:python

- update to 1.3:
  * Improved Tests, add command line utilities
- add update-alternatives

OBS-URL: https://build.opensuse.org/request/show/205476
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-jsonpatch?expand=0&rev=7
This commit is contained in:
Denisart Benjamin
2013-11-01 00:04:04 +00:00
committed by Git OBS Bridge
parent 18eddeacf2
commit 49e2a92fd2
4 changed files with 36 additions and 6 deletions

View File

@@ -17,9 +17,9 @@
Name: python-jsonpatch
Version: 1.1
Version: 1.3
Release: 0
Summary: Apply JSON-Patches (according to draft 08)
Summary: Python - JSON-Patches
License: BSD-3-Clause
Group: Development/Languages/Python
Url: https://github.com/stefankoegl/python-json-patch
@@ -27,6 +27,8 @@ Source: http://pypi.python.org/packages/source/j/jsonpatch/jsonpatch-%{v
BuildRequires: python-devel
BuildRequires: python-jsonpointer
Requires: python-jsonpointer >= 1.0
Requires(post): update-alternatives
Requires(postun): 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()")}
@@ -35,7 +37,7 @@ BuildArch: noarch
%endif
%description
Apply JSON-Patches (according to draft 08)
Python module to apply JSON-Patches (according to RFC 6902).
%prep
%setup -q -n jsonpatch-%{version}
@@ -45,9 +47,30 @@ python setup.py build
%install
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}
done
%pre
[[ ! -L %{_bindir}/jsonpatch ]] && rm -f %{_bindir}/jsonpatch || :
[[ ! -L %{_bindir}/jsondiff ]] && rm -f %{_bindir}/jsondiff || :
%post
update-alternatives --install \
%{_bindir}/jsonpatch jsonpatch %{_bindir}/jsonpatch-%{py_ver} 20 \
--slave %{_bindir}/jsondiff jsondiff %{_bindir}/jsondiff-%{py_ver}
%preun
if [ $1 -eq 0 ] ; then
update-alternatives --remove jsonpatch %{_bindir}/jsonpatch-%{py_ver}
fi
%files
%defattr(-,root,root,-)
%ghost %{_bindir}/jsonpatch
%{_bindir}/jsonpatch-%{py_ver}
%ghost %{_bindir}/jsondiff
%{_bindir}/jsondiff-%{py_ver}
%{python_sitelib}/*
%changelog