diff --git a/python-lesscpy.changes b/python-lesscpy.changes index a9dbc68..2f45a93 100644 --- a/python-lesscpy.changes +++ b/python-lesscpy.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Aug 15 14:51:56 UTC 2016 - toddrme2178@gmail.com + +- Fix update-alternatives implementation. + ------------------------------------------------------------------- Thu May 7 11:06:21 UTC 2015 - benoit.monin@gmx.fr diff --git a/python-lesscpy.spec b/python-lesscpy.spec index ec65d3e..9ec528c 100644 --- a/python-lesscpy.spec +++ b/python-lesscpy.spec @@ -36,7 +36,7 @@ BuildRequires: python-nose Requires: python-ply Requires: python-six Requires(post): update-alternatives -Requires(postun): update-alternatives +Requires(preun): update-alternatives %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 @@ -62,34 +62,28 @@ python setup.py build %install python setup.py install --prefix=%{_prefix} --root=%{buildroot} -mv %{buildroot}%{_bindir}/lesscpy{,-%{py_ver}} mkdir -p %{buildroot}%{_sysconfdir}/alternatives -touch %{buildroot}%{_sysconfdir}/alternatives/lesscpy +mv %{buildroot}%{_bindir}/lesscpy %{buildroot}%{_bindir}/lesscpy-%{py_ver} ln -sf %{_sysconfdir}/alternatives/lesscpy %{buildroot}%{_bindir}/lesscpy %check python setup.py -q test -%pre -# Since /usr/bin/lesscpy became ghosted to be used with update-alternatives, we -# have to get rid of the old binary: -[ -h %{_bindir}/lesscpy ] || rm -f %{_bindir}/lesscpy - %post -update-alternatives \ +%_sbindir/update-alternatives \ --install %{_bindir}/lesscpy lesscpy %{_bindir}/lesscpy-%{py_ver} 20 %preun if [ $1 -eq 0 ] ; then - update-alternatives --remove lesscpy %{_bindir}/lesscpy-%{py_ver} + %_sbindir/update-alternatives --remove lesscpy %{_bindir}/lesscpy-%{py_ver} fi %files %defattr(-,root,root,-) %doc LICENSE README.rst -%ghost %{_sysconfdir}/alternatives/lesscpy %{_bindir}/lesscpy %{_bindir}/lesscpy-%{py_ver} +%ghost %{_sysconfdir}/alternatives/lesscpy %{python_sitelib}/lesscpy %{python_sitelib}/lesscpy-%{version}-py%{py_ver}.egg-info