From 3bccacafc351cbe9ebd42ba46adc4c87ffc376d96fa4d38e06230f239c68a615 Mon Sep 17 00:00:00 2001
From: Denisart Benjamin
Date: Fri, 7 Feb 2014 17:59:04 +0000
Subject: [PATCH] Accepting request 221309 from
home:posophe:branches:devel:languages:python
fix update-alternatives
OBS-URL: https://build.opensuse.org/request/show/221309
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-zdaemon?expand=0&rev=18
---
python-zdaemon.changes | 5 +++++
python-zdaemon.spec | 21 +++++++--------------
2 files changed, 12 insertions(+), 14 deletions(-)
diff --git a/python-zdaemon.changes b/python-zdaemon.changes
index f60c9c1..7d4c03c 100644
--- a/python-zdaemon.changes
+++ b/python-zdaemon.changes
@@ -1,3 +1,8 @@
+-------------------------------------------------------------------
+Fri Feb 7 13:17:03 UTC 2014 - p.drouand@gmail.com
+
+- Fix wrong implementation
+
-------------------------------------------------------------------
Fri Feb 7 12:43:58 UTC 2014 - p.drouand@gmail.com
diff --git a/python-zdaemon.spec b/python-zdaemon.spec
index 2e752a5..1e876ff 100644
--- a/python-zdaemon.spec
+++ b/python-zdaemon.spec
@@ -15,7 +15,6 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
-
%define modname zdaemon
Name: python-%{modname}
@@ -29,8 +28,8 @@ Source: https://pypi.python.org/packages/source/z/zdaemon/%{modname}-%{v
BuildRequires: python-devel
BuildRequires: python-setuptools
BuildRequires: unzip
-Requires(post): update-alternatives
-Requires(postun): update-alternatives
+BuildRequires: update-alternatives
+Requires(pre): update-alternatives
BuildArch: noarch
%description
@@ -48,14 +47,10 @@ python setup.py build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
-ln -s %{_bindir}/%{modname}-%{py_ver} %{buildroot}%{_bindir}/%{modname}
-
-%pre
-# Since /usr/bin/zdaemon became ghosted to be used
-# with update-alternatives, we have to get rid of the old binary resulting from the
-# non-update-alternativies-ified package:
-[[ ! -L %{_bindir}/%{modname} ]] && rm -f %{_bindir}/%{modname}
-exit 0
+# create a dummy target for /etc/alternatives/zdaemon
+mkdir -p %{buildroot}%{_sysconfdir}/alternatives
+touch %{buildroot}%{_sysconfdir}/alternatives/%{modname}
+ln -s -f %{_sysconfdir}/alternatives/%{modname} %{buildroot}/%{_bindir}/%{modname}
%post
update-alternatives \
@@ -69,11 +64,9 @@ fi
%files
%defattr(-,root,root)
%doc README.txt CHANGES.txt
-%if 0%{?suse_version} >= 1230
%ghost %{_sysconfdir}/alternatives/%{modname}
-%endif
-%ghost %{_bindir}/%{modname}
%{python_sitelib}
+%{_bindir}/%{modname}
%{_bindir}/%{modname}-%{py_ver}
%changelog
\ No newline at end of file