From 049b3f23a1589ae4fabee09ea432bc61db3af7d00264474b463f4ad9cfe69aa7 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Wed, 5 Jul 2017 11:38:22 +0000 Subject: [PATCH] Accepting request 508270 from home:tbechtold:branches:devel:languages:python - convert to singlespec OBS-URL: https://build.opensuse.org/request/show/508270 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-jsonpath-rw?expand=0&rev=7 --- python-jsonpath-rw.changes | 5 +++++ python-jsonpath-rw.spec | 36 +++++++++++++++++++++++------------- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/python-jsonpath-rw.changes b/python-jsonpath-rw.changes index 99e24bc..2278700 100644 --- a/python-jsonpath-rw.changes +++ b/python-jsonpath-rw.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Jul 5 08:35:57 UTC 2017 - tbechtold@suse.com + +- convert to singlespec + ------------------------------------------------------------------- Wed May 6 17:54:26 UTC 2015 - benoit.monin@gmx.fr diff --git a/python-jsonpath-rw.spec b/python-jsonpath-rw.spec index 1acd9e5..6c3f309 100644 --- a/python-jsonpath-rw.spec +++ b/python-jsonpath-rw.spec @@ -1,7 +1,7 @@ # # spec file for package python-jsonpath-rw # -# 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,6 +16,7 @@ # +%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-jsonpath-rw Version: 1.4.0 Release: 0 @@ -24,18 +25,20 @@ License: Apache-2.0 Group: Development/Languages/Python Url: https://github.com/kennknowles/python-jsonpath-rw Source: https://pypi.python.org/packages/source/j/jsonpath-rw/jsonpath-rw-%{version}.tar.gz -BuildRequires: python-devel -BuildRequires: python-ply -BuildRequires: python-setuptools -BuildRequires: python-six +BuildRequires: %{python_module devel} +BuildRequires: %{python_module ply} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module six} +BuildRequires: python-rpm-macros +Requires: python-decorator Requires: python-ply >= 3.4 Requires: python-six +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()")} -%else BuildArch: noarch -%endif + +%python_subpackages %description This library provides a robust and significantly extended implementation @@ -52,15 +55,22 @@ extend. (You can also execute them :-) sed -i '/^#!/ d' jsonpath_rw/bin/jsonpath.py %build -python setup.py build +%python_build %install -python setup.py install --prefix=%{_prefix} --root=%{buildroot} +%python_install +%python_clone -a %{buildroot}%{_bindir}/jsonpath.py -%files +%post +%python_install_alternative jsonpath.py + +%postun +%python_uninstall_alternative jsonpath.py + +%files %{python_files} %defattr(-,root,root,-) %doc README.rst -%{_bindir}/jsonpath.py +%python_alternative %{_bindir}/jsonpath.py %{python_sitelib}/* %changelog