From fde4e593d52610937824bdd08bfdc78d25e2d0a9b8d73f0bd5355e1d04179839 Mon Sep 17 00:00:00 2001 From: Robert Schweikert Date: Wed, 20 Jan 2016 19:10:15 +0000 Subject: [PATCH] - Manage the jp executable with update-alternatives now that python3-jmespath exists - spec file improvements OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-jmespath?expand=0&rev=14 --- python-jmespath.changes | 7 +++++++ python-jmespath.spec | 32 +++++++++++++++++++++++--------- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/python-jmespath.changes b/python-jmespath.changes index 475b7e2..4290a0d 100644 --- a/python-jmespath.changes +++ b/python-jmespath.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Jan 20 19:08:32 UTC 2016 - rjschwei@suse.com + +- Manage the jp executable with update-alternatives now that + python3-jmespath exists +- spec file improvements + ------------------------------------------------------------------- Wed May 27 17:04:07 UTC 2015 - rjschwei@suse.com diff --git a/python-jmespath.spec b/python-jmespath.spec index c2928a4..ce95534 100644 --- a/python-jmespath.spec +++ b/python-jmespath.spec @@ -1,7 +1,7 @@ # # spec file for package python-jmespath # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2016 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 @@ -28,10 +28,14 @@ Url: https://github.com/boto/jmespath Source0: https://pypi.python.org/packages/source/j/%{baseName}/%{baseName}-%{version}.tar.gz Requires: python Requires: python-ply >= 3.4 +Requires(post): update-alternatives +Requires(postun): update-alternatives BuildRequires: python BuildRequires: python-devel -BuildRequires: python-ply +BuildRequires: python-ply >= 3.4 BuildRequires: python-setuptools +# For testing +BuildRequires: python-nose 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()")} @@ -79,17 +83,27 @@ python setup.py build %install python setup.py install --prefix=%{_prefix} --root=%{buildroot} --install-scripts=%{_bindir} pushd %{buildroot}/%{_bindir} -ln -s jp.py jp +mv jp.py jp-%{py_ver} popd +%check +nosetests tests + +%post +"%_sbindir/update-alternatives" --install %{_bindir}/jp jp %{_bindir}/jp-%{py_ver} 30 + +%postun +if [ $1 -eq 0 ] ; then + "%_sbindir/update-alternatives" --remove jp %{_bindir}/jp-%{py_ver} +fi + %files %defattr(-,root,root,-) %doc LICENSE.txt README.rst -%dir %{python_sitelib}/jmespath -%dir %{python_sitelib}/%{baseName}-%{version}-py%{py_ver}.egg-info -%{_bindir}/jp -%{_bindir}/jp.py -%{python_sitelib}/jmespath/* -%{python_sitelib}/*egg-info/* +#%dir %{python_sitelib}/jmespath +#%dir %{python_sitelib}/%{baseName}-%{version}-py%{py_ver}.egg-info +%{_bindir}/jp-%{py_ver} +%{python_sitelib}/jmespath/ +%{python_sitelib}/%{baseName}-%{version}-py%{py_ver}.egg-info/ %changelog