14
0

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
This commit is contained in:
Denisart Benjamin
2014-02-07 17:59:04 +00:00
committed by Git OBS Bridge
parent db503fec46
commit 3bccacafc3
2 changed files with 12 additions and 14 deletions

View File

@@ -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

View File

@@ -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