From 62dafc2025b09bf8083033a89a3e649d93cb51526384f82a1944f1a7c8ec09ac Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 7 Mar 2016 20:40:21 +0000 Subject: [PATCH] Accepting request 367620 from home:KGronlund:branches:devel:languages:python - Add alternatives entry for parallax-askpass OBS-URL: https://build.opensuse.org/request/show/367620 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parallax?expand=0&rev=10 --- python-parallax.changes | 5 +++++ python-parallax.spec | 25 ++++++++++++++++++++----- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/python-parallax.changes b/python-parallax.changes index ef88c21..19d1ea8 100644 --- a/python-parallax.changes +++ b/python-parallax.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Mar 7 08:48:52 UTC 2016 - kgronlund@suse.com + +- Add alternatives entry for parallax-askpass + ------------------------------------------------------------------- Fri Jun 12 15:26:42 UTC 2015 - kgronlund@suse.com diff --git a/python-parallax.spec b/python-parallax.spec index 2cbfaa0..82c16ac 100644 --- a/python-parallax.spec +++ b/python-parallax.spec @@ -1,7 +1,7 @@ # # spec file for package python-parallax # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -28,11 +28,9 @@ BuildRequires: python-devel BuildRequires: python-setuptools BuildRoot: %{_tmppath}/%{name}-%{version}-build Requires: openssh -%if 0%{?suse_version} && 0%{?suse_version} <= 1110 -%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} -%else BuildArch: noarch -%endif +Requires(post): update-alternatives +Requires(postun): update-alternatives %description Parallax SSH provides an interface to executing commands on multiple @@ -48,11 +46,28 @@ python setup.py build %install python setup.py install --prefix=%{_prefix} --root=%{buildroot} +# create a dummy target for /etc/alternatives/parallax-askpass +mv %{buildroot}%{_bindir}/parallax-askpass %{buildroot}%{_bindir}/parallax-askpass-%{py_ver} +mkdir -p %{buildroot}%{_sysconfdir}/alternatives +touch %{buildroot}%{_sysconfdir}/alternatives/parallax-askpass +ln -s -f %{_sysconfdir}/alternatives/parallax-askpass %{buildroot}%{_bindir}/parallax-askpass + +%post +"%_sbindir/update-alternatives" --install \ + /%{_bindir}/parallax-askpass parallax-askpass %{_bindir}/parallax-askpass-%{py_ver} 20 + +%postun +if [ "$1" = 0 ] ; then + "%_sbindir/update-alternatives" --remove parallax-askpass %{_bindir}/parallax-askpass-%{py_ver} +fi + %files %defattr(-,root,root,-) %doc AUTHORS README.md COPYING %{python_sitelib}/parallax %{python_sitelib}/parallax-%{version}*.egg-info %{_bindir}/parallax-askpass +%{_bindir}/parallax-askpass-%{py_ver} +%ghost %_sysconfdir/alternatives/parallax-askpass %changelog