From 663313b434fa73b6c58ee1b5e964308105cdb7d30d0462da55fadf7b883c3626 Mon Sep 17 00:00:00 2001
From: Denisart Benjamin
Date: Fri, 25 Sep 2015 12:04:16 +0000
Subject: [PATCH] Accepting request 333739 from
home:posophe:branches:devel:languages:python
fix
OBS-URL: https://build.opensuse.org/request/show/333739
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-twine?expand=0&rev=4
---
python-twine.changes | 1 +
python-twine.spec | 17 +++++++++++++++++
2 files changed, 18 insertions(+)
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