15
0

Accepting request 512939 from home:deadpoint:branches:devel:languages:python

convert to singlespec and update to 1.16

OBS-URL: https://build.opensuse.org/request/show/512939
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-jsonpatch?expand=0&rev=25
This commit is contained in:
2017-07-31 05:46:25 +00:00
committed by Git OBS Bridge
parent 301419c378
commit 173d9d0dfe
4 changed files with 32 additions and 32 deletions

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-jsonpatch
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,64 +16,58 @@
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_without test
Name: python-jsonpatch
Version: 1.14
Version: 1.16
Release: 0
Summary: Python - JSON-Patches
License: BSD-3-Clause
Group: Development/Languages/Python
Url: https://github.com/stefankoegl/python-json-patch
Source: https://pypi.io/packages/source/j/jsonpatch/jsonpatch-%{version}.tar.gz
BuildRequires: python-devel
BuildRequires: python-jsonpointer
Requires: python-jsonpointer >= 1.9
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: python-rpm-macros
%if %{with test}
BuildRequires: %{python_module jsonpointer >= 1.9}
%endif
Requires: %{python_module jsonpointer >= 1.9}
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()")}
%else
BuildArch: noarch
%endif
%python_subpackages
%description
Python module to apply JSON-Patches (according to RFC 6902).
%prep
%setup -q -n jsonpatch-%{version}
sed -i "s|entry_poimts|entry_points|" setup.py # Typo fix already in upstream git..
%build
python setup.py build
%python_build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
%python_install
# Prepare for update-alternatives usage
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
%python_clone -a %{buildroot}%{_bindir}/$p
done
%post
%_sbindir/update-alternatives \
--install %{_bindir}/jsonpatch jsonpatch %{_bindir}/jsonpatch-%{py_ver} 20 \
--slave %{_bindir}/jsondiff jsondiff %{_bindir}/jsondiff-%{py_ver}
%python_install_alternative jsonpatch jsondiff
%preun
if [ $1 -eq 0 ] ; then
%_sbindir/update-alternatives --remove jsonpatch %{_bindir}/jsonpatch-%{py_ver}
fi
%python_uninstall_alternative jsonpatch jsondiff
%files
%files %{python_files}
%defattr(-,root,root,-)
%{_bindir}/jsondiff
%{_bindir}/jsonpatch
%{_bindir}/jsondiff-%{py_ver}
%{_bindir}/jsonpatch-%{py_ver}
%ghost %{_sysconfdir}/alternatives/jsondiff
%ghost %{_sysconfdir}/alternatives/jsonpatch
%{python_sitelib}/jsonpatch*
%doc AUTHORS COPYING README.md
%python_alternative %{_bindir}/jsonpatch
%python_alternative %{_bindir}/jsondiff
%{python_sitelib}/*
%changelog