- 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
This commit is contained in:
Robert Schweikert 2016-01-20 19:10:15 +00:00 committed by Git OBS Bridge
parent 914c2a0305
commit fde4e593d5
2 changed files with 30 additions and 9 deletions

View File

@ -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

View File

@ -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