From 8f691725b19f0a459df6bddd6a81832bdc24c96b40ae3ecc078ff496de64dbd6 Mon Sep 17 00:00:00 2001
From: Denisart Benjamin
Date: Thu, 10 Jul 2014 23:20:55 +0000
Subject: [PATCH] Accepting request 240116 from
home:MargueriteSu:branches:devel:languages:python
use update-alternatives, I think link /etc/alternatives/* to /usr/bin/* is the correct way(benoit_monin's SR linked /usr/bin/*-py2.7 to /usr/bin/*), but I'm not sure.
OBS-URL: https://build.opensuse.org/request/show/240116
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Markdown?expand=0&rev=11
---
python-Markdown.changes | 6 ++++++
python-Markdown.spec | 22 +++++++++++++++++++++-
2 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/python-Markdown.changes b/python-Markdown.changes
index ad99a4b..75f55af 100644
--- a/python-Markdown.changes
+++ b/python-Markdown.changes
@@ -1,3 +1,9 @@
+-------------------------------------------------------------------
+Wed Jul 9 18:12:04 UTC 2014 - i@marguerite.su
+
+- fix conflicts with python3-Markdown
+ * both use update-alternatives
+
-------------------------------------------------------------------
Mon May 26 21:40:35 UTC 2014 - hpj@urpla.net
diff --git a/python-Markdown.spec b/python-Markdown.spec
index d224501..282b342 100644
--- a/python-Markdown.spec
+++ b/python-Markdown.spec
@@ -28,6 +28,8 @@ BuildRequires: python-devel
BuildRequires: python-nose
BuildRequires: python-xml
Requires: python-xml
+Requires(post): update-alternatives
+Requires(postun): update-alternatives
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Provides: python-markdown = %{version}
Obsoletes: python-markdown < %{version}
@@ -55,15 +57,33 @@ python setup.py build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
+# update-alternatives
+mv %{buildroot}%{_bindir}/markdown_py %{buildroot}%{_bindir}/markdown_py-%{py_ver}
+mkdir -p %{buildroot}%{_sysconfdir}/alternatives
+touch %{buildroot}%{_sysconfdir}/alternatives/markdown_py
+ln -sf %{_sysconfdir}/alternatives/markdown_py %{buildroot}%{_bindir}/markdown_py
+
%if 0%{?suse_version} && 0%{?suse_version} > 1110
%check
python run-tests.py
%endif
+%post
+update-alternatives \
+ --install %{_bindir}/markdown_py markdown_py %{_bindir}/markdown_py-%{py_ver} 20
+
+%postun
+if [ $1 -eq 0 ] ; then
+ update-alternatives --remove markdown_py %{_bindir}/markdown_py-%{py_ver}
+fi
+
%files
%defattr(-,root,root,-)
%doc LICENSE.md README.md docs/*
+%ghost %{_sysconfdir}/alternatives/markdown_py
%{_bindir}/markdown_py
-%{python_sitelib}/*
+%{_bindir}/markdown_py-%{py_ver}
+%{python_sitelib}/Markdown-%{version}-py%{py_ver}.egg-info
+%{python_sitelib}/markdown
%changelog