From c5b54d8e58d244ea5efdbbe96fa599163a84037bdfa01057b3e12005b29d7220 Mon Sep 17 00:00:00 2001 From: Denisart Benjamin Date: Fri, 7 Feb 2014 13:01:48 +0000 Subject: [PATCH 1/3] Accepting request 221236 from home:posophe:branches:devel:languages:python - Implement update-alternative OBS-URL: https://build.opensuse.org/request/show/221236 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-zdaemon?expand=0&rev=17 --- python-zdaemon.changes | 5 +++++ python-zdaemon.spec | 40 ++++++++++++++++++++++++++++++++-------- 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/python-zdaemon.changes b/python-zdaemon.changes index e4baf8b..f60c9c1 100644 --- a/python-zdaemon.changes +++ b/python-zdaemon.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Feb 7 12:43:58 UTC 2014 - p.drouand@gmail.com + +- Implement update-alternative + ------------------------------------------------------------------- Thu Oct 24 11:17:46 UTC 2013 - speilicke@suse.com diff --git a/python-zdaemon.spec b/python-zdaemon.spec index e593609..2e752a5 100644 --- a/python-zdaemon.spec +++ b/python-zdaemon.spec @@ -1,7 +1,7 @@ # # spec file for package python-zdaemon # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,19 +18,19 @@ %define modname zdaemon -Name: python-zdaemon +Name: python-%{modname} Version: 4.0.0a1 Release: 0 Summary: Daemon process control library and tools License: ZPL-2.1 -Group: Development/Libraries/Python +Group: Development/Languages/Python Url: http://pypi.python.org/pypi/zdaemon Source: https://pypi.python.org/packages/source/z/zdaemon/%{modname}-%{version}.zip -BuildRoot: %{_tmppath}/%{name}-%{version}-build -%{py_requires} BuildRequires: python-devel BuildRequires: python-setuptools BuildRequires: unzip +Requires(post): update-alternatives +Requires(postun): update-alternatives BuildArch: noarch %description @@ -41,15 +41,39 @@ although it is not limited to running Python-based applications %prep %setup -q -n %{modname}-%{version} +sed -i "s|%{modname} =|%{modname}-%{py_ver} =|" setup.py %build python setup.py build %install -python setup.py install --prefix=%{_prefix} --root=$RPM_BUILD_ROOT --record-rpm=INSTALLED_FILES +python setup.py install --prefix=%{_prefix} --root=%{buildroot} +ln -s %{_bindir}/%{modname}-%{py_ver} %{buildroot}%{_bindir}/%{modname} -%files -f INSTALLED_FILES +%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 + +%post +update-alternatives \ + --install %{_bindir}/%{modname} %{modname} %{_bindir}/%{modname}-%{py_ver} 20 + +%preun +if [ $1 -eq 0 ] ; then + update-alternatives --remove %{modname} %{_bindir}/%{modname}-%{py_ver} +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}-%{py_ver} -%changelog +%changelog \ No newline at end of file From 6876c67caf0dcd8ab80c492c8b5226be76d0613c50a1ad087d8646ad3d2380b5 Mon Sep 17 00:00:00 2001 From: Denisart Benjamin Date: Fri, 7 Feb 2014 17:59:04 +0000 Subject: [PATCH 2/3] 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 From 69d76b59de6a3078de3206453d46fe4dd10fbc13529113ebe0964666dd6f8cf5 Mon Sep 17 00:00:00 2001 From: Sascha Peilicke Date: Mon, 17 Feb 2014 09:40:35 +0000 Subject: [PATCH 3/3] Accepting request 222498 from home:poorboywilly:branches:devel:languages:python Update to 4.0.0 and add requirement for ZConfig. Update source URL (no .zip available for this version). Sorry I didn't realize it had a pending request until now. OBS-URL: https://build.opensuse.org/request/show/222498 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-zdaemon?expand=0&rev=19 --- python-zdaemon.changes | 8 ++++++++ python-zdaemon.spec | 9 +++++---- zdaemon-4.0.0.tar.gz | 3 +++ zdaemon-4.0.0a1.zip | 3 --- 4 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 zdaemon-4.0.0.tar.gz delete mode 100644 zdaemon-4.0.0a1.zip diff --git a/python-zdaemon.changes b/python-zdaemon.changes index 7d4c03c..0c8c908 100644 --- a/python-zdaemon.changes +++ b/python-zdaemon.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Sun Feb 16 18:16:37 UTC 2014 - os-dev@jacraig.com + +- Update to 4.0.0: + * Note / test support for Python 3.2. +- Add requirement for python-ZConfig, see setup.py. +- Update source URL, .zip not available for this version. + ------------------------------------------------------------------- Fri Feb 7 13:17:03 UTC 2014 - p.drouand@gmail.com diff --git a/python-zdaemon.spec b/python-zdaemon.spec index 1e876ff..80ef38b 100644 --- a/python-zdaemon.spec +++ b/python-zdaemon.spec @@ -15,21 +15,22 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # + %define modname zdaemon Name: python-%{modname} -Version: 4.0.0a1 +Version: 4.0.0 Release: 0 Summary: Daemon process control library and tools License: ZPL-2.1 Group: Development/Languages/Python Url: http://pypi.python.org/pypi/zdaemon -Source: https://pypi.python.org/packages/source/z/zdaemon/%{modname}-%{version}.zip +Source: https://pypi.python.org/packages/source/z/zdaemon/%{modname}-%{version}.tar.gz BuildRequires: python-devel BuildRequires: python-setuptools -BuildRequires: unzip BuildRequires: update-alternatives Requires(pre): update-alternatives +Requires: python-ZConfig BuildArch: noarch %description @@ -69,4 +70,4 @@ fi %{_bindir}/%{modname} %{_bindir}/%{modname}-%{py_ver} -%changelog \ No newline at end of file +%changelog diff --git a/zdaemon-4.0.0.tar.gz b/zdaemon-4.0.0.tar.gz new file mode 100644 index 0000000..4178246 --- /dev/null +++ b/zdaemon-4.0.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:82d7eaa4d831ff1ecdcffcb274f3457e095c0cc86e630bc72009a863c341ab9f +size 55486 diff --git a/zdaemon-4.0.0a1.zip b/zdaemon-4.0.0a1.zip deleted file mode 100644 index 61acb5d..0000000 --- a/zdaemon-4.0.0a1.zip +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c01a5fb2d438dcffc5e42aab25fe571c13eb7fbc4b0e3170b77f03aefcafda98 -size 69115