diff --git a/python-twine.changes b/python-twine.changes index cf9d427..ea63372 100644 --- a/python-twine.changes +++ b/python-twine.changes @@ -3,6 +3,7 @@ Fri Sep 25 11:27:26 UTC 2015 - p.drouand@gmail.com - Update to version 1.6.1 * bug:`130` Fix signing support for uploads +- Implement update-alternatives ------------------------------------------------------------------- Wed Jul 16 09:57:47 UTC 2014 - toddrme2178@gmail.com diff --git a/python-twine.spec b/python-twine.spec index edc19dd..cecbc0a 100644 --- a/python-twine.spec +++ b/python-twine.spec @@ -26,6 +26,8 @@ Url: https://github.com/dstufft/twine Source: https://pypi.python.org/packages/source/t/twine/twine-%{version}.tar.gz BuildRequires: python-devel BuildRequires: python-setuptools +Requires(post): update-alternatives +Requires(postun): update-alternatives Requires: python-pkginfo Requires: python-requests BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -80,11 +82,26 @@ python setup.py build %install python setup.py install --prefix=%{_prefix} --root=%{buildroot} +mv %{buildroot}%{_bindir}/twine %{buildroot}%{_bindir}/twine-%{py_ver} +mkdir -p %{buildroot}%{_sysconfdir}/alternatives +touch %{buildroot}%{_sysconfdir}/alternatives/twine +ln -s -f %{_sysconfdir}/alternatives/twine %{buildroot}%{_bindir}/twine + +%post +%_sbindir/update-alternatives \ + --install %{_bindir}/twine twine %{_bindir}/twine-%{py_ver} 30 + +%postun +if [ $1 -eq 0 ] ; then + %_sbindir/update-alternatives --remove twine %{_bindir}/twine-%{py_ver} +fi %files %defattr(-,root,root,-) %doc AUTHORS LICENSE README.rst %{_bindir}/twine +%{_bindir}/twine-%{py_ver} %{python_sitelib}/* +%ghost %{_sysconfdir}/alternatives/twine %changelog