2010-06-28 10:55:16 +00:00
|
|
|
#
|
2011-12-07 14:33:04 +00:00
|
|
|
# spec file for package python-zdaemon
|
2010-06-28 10:55:16 +00:00
|
|
|
#
|
2015-05-24 18:37:29 +00:00
|
|
|
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
|
2010-06-28 10:55:16 +00:00
|
|
|
#
|
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
|
#
|
|
|
|
|
|
2014-02-17 09:40:35 +00:00
|
|
|
|
2010-06-28 10:55:16 +00:00
|
|
|
%define modname zdaemon
|
|
|
|
|
|
2014-02-07 13:01:48 +00:00
|
|
|
Name: python-%{modname}
|
2015-05-24 18:37:29 +00:00
|
|
|
Version: 4.1.0
|
2011-12-07 14:33:04 +00:00
|
|
|
Release: 0
|
2010-06-28 10:55:16 +00:00
|
|
|
Summary: Daemon process control library and tools
|
2011-12-08 13:35:52 +00:00
|
|
|
License: ZPL-2.1
|
2014-02-07 13:01:48 +00:00
|
|
|
Group: Development/Languages/Python
|
2015-05-24 18:37:29 +00:00
|
|
|
Url: https://github.com/zopefoundation/zdaemon
|
|
|
|
|
Source: https://pypi.python.org/packages/source/z/zdaemon/%{modname}-%{version}.zip
|
2011-12-07 14:33:04 +00:00
|
|
|
BuildRequires: python-devel
|
2013-10-24 11:17:47 +00:00
|
|
|
BuildRequires: python-setuptools
|
2015-05-24 18:37:29 +00:00
|
|
|
BuildRequires: unzip
|
|
|
|
|
Requires(post): update-alternatives
|
|
|
|
|
Requires(postun): update-alternatives
|
2014-02-17 09:40:35 +00:00
|
|
|
Requires: python-ZConfig
|
2015-05-24 18:37:29 +00:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
|
%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
|
2010-06-28 10:55:16 +00:00
|
|
|
BuildArch: noarch
|
2015-05-24 18:37:29 +00:00
|
|
|
%endif
|
2010-06-28 10:55:16 +00:00
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
zdaemon is a Python package which provides APIs for managing
|
|
|
|
|
applications run as daemons. Its principal use to date has been to
|
|
|
|
|
manage the application server and storage server daemons for Zope / ZEO,
|
|
|
|
|
although it is not limited to running Python-based applications
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%setup -q -n %{modname}-%{version}
|
2014-02-07 13:01:48 +00:00
|
|
|
sed -i "s|%{modname} =|%{modname}-%{py_ver} =|" setup.py
|
2015-05-24 18:37:29 +00:00
|
|
|
# remove unwanted shebang
|
|
|
|
|
sed -i '1 { /^#!/ d }' src/zdaemon/tests/nokill.py
|
2010-06-28 10:55:16 +00:00
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
python setup.py build
|
|
|
|
|
|
|
|
|
|
%install
|
2014-02-07 13:01:48 +00:00
|
|
|
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
|
2014-02-07 17:59:04 +00:00
|
|
|
# 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}
|
2014-02-07 13:01:48 +00:00
|
|
|
|
|
|
|
|
%post
|
|
|
|
|
update-alternatives \
|
|
|
|
|
--install %{_bindir}/%{modname} %{modname} %{_bindir}/%{modname}-%{py_ver} 20
|
|
|
|
|
|
2015-05-24 18:37:29 +00:00
|
|
|
%postun
|
2014-02-07 13:01:48 +00:00
|
|
|
if [ $1 -eq 0 ] ; then
|
|
|
|
|
update-alternatives --remove %{modname} %{_bindir}/%{modname}-%{py_ver}
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
%files
|
2010-06-28 10:55:16 +00:00
|
|
|
%defattr(-,root,root)
|
2015-05-24 18:37:29 +00:00
|
|
|
%doc README.rst CHANGES.rst LICENSE.txt
|
2014-02-07 13:01:48 +00:00
|
|
|
%ghost %{_sysconfdir}/alternatives/%{modname}
|
2015-05-24 18:37:29 +00:00
|
|
|
%{python_sitelib}/*
|
2014-02-07 17:59:04 +00:00
|
|
|
%{_bindir}/%{modname}
|
2014-02-07 13:01:48 +00:00
|
|
|
%{_bindir}/%{modname}-%{py_ver}
|
2010-06-28 10:55:16 +00:00
|
|
|
|
2014-02-17 09:40:35 +00:00
|
|
|
%changelog
|