Accepting request 419468 from home:TheBlackCat:branches:devel:languages:python

Fix update-alternatives implementation.

OBS-URL: https://build.opensuse.org/request/show/419468
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-jmespath?expand=0&rev=19
This commit is contained in:
Robert Schweikert 2016-08-15 16:11:16 +00:00 committed by Git OBS Bridge
parent fc960be3a2
commit 59bc0a70e4
2 changed files with 16 additions and 7 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon Aug 15 14:51:56 UTC 2016 - toddrme2178@gmail.com
- Fix update-alternatives implementation.
-------------------------------------------------------------------
Mon Feb 1 11:24:14 UTC 2016 - toddrme2178@gmail.com

View File

@ -29,7 +29,7 @@ Source0: https://pypi.python.org/packages/source/j/%{baseName}/%{baseName
Requires: python-base
Requires: python-ply >= 3.4
Requires(post): update-alternatives
Requires(postun): update-alternatives
Requires(preun): update-alternatives
BuildRequires: python-devel
BuildRequires: python-ply >= 3.4
BuildRequires: python-setuptools
@ -86,25 +86,29 @@ python setup.py build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot} --install-scripts=%{_bindir}
pushd %{buildroot}/%{_bindir}
mv jp.py jp-%{py_ver}
popd
# Prepare for update-alternatives usage
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
mv %{buildroot}%{_bindir}/jp.py %{buildroot}%{_bindir}/jp-%{py_ver}
ln -s -f %{_sysconfdir}/alternatives/jp %{buildroot}%{_bindir}/jp
%check
nosetests tests
%post
"%_sbindir/update-alternatives" --install %{_bindir}/jp jp %{_bindir}/jp-%{py_ver} 30
%_sbindir/update-alternatives --install %{_bindir}/jp jp %{_bindir}/jp-%{py_ver} 30
%postun
%preun
if [ $1 -eq 0 ] ; then
"%_sbindir/update-alternatives" --remove jp %{_bindir}/jp-%{py_ver}
%_sbindir/update-alternatives --remove jp %{_bindir}/jp-%{py_ver}
fi
%files
%defattr(-,root,root,-)
%doc LICENSE.txt README.rst
%{_bindir}/jp
%{_bindir}/jp-%{py_ver}
%ghost %{_sysconfdir}/alternatives/jp
%{python_sitelib}/jmespath/
%{python_sitelib}/%{baseName}-%{version}-py%{py_ver}.egg-info/