diff --git a/python-jmespath.changes b/python-jmespath.changes index 0e1744e..f79527b 100644 --- a/python-jmespath.changes +++ b/python-jmespath.changes @@ -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 diff --git a/python-jmespath.spec b/python-jmespath.spec index bc8a8da..d410f87 100644 --- a/python-jmespath.spec +++ b/python-jmespath.spec @@ -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/