File python-daemonize.spec of Package python-daemonize

#
# spec file for package python-daemonize
#
# Copyright (c) 2019 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
# 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 https://bugs.opensuse.org/
#


Name:           python-daemonize
Version:        2.4.7
Release:        %mkrel 1
Summary:        Python module to launch code as a daemon process
License:        MIT
Group:          Development/Languages/Python
Url:            https://github.com/thesharp/daemonize
Source:         https://files.pythonhosted.org/packages/source/d/daemonize/daemonize-%{version}.tar.gz
BuildArch:      noarch
BuildRequires:  pkgconfig(python2)
BuildRequires:  pythonegg(2)(setuptools)

%description
daemonize is a library for writing system daemons in Python.

%package -n python3-daemonize
Summary:        Python module to launch code as a daemon process
Group:          Development/Languages/Python
BuildArch:      noarch
BuildRequires:  pkgconfig(python3)
BuildRequires:  pythonegg(3)(setuptools)

%description -n python3-daemonize
daemonize is a library for writing system daemons in Python.

%prep
%setup -q -n daemonize-%{version}

cp -a . %{py3dir}

find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'

%build
%py2_build

pushd %{py3dir}
%py3_build
popd

%install
pushd %{py3dir}
%py3_install
popd

%py2_install

%files
%doc LICENSE README.rst
%{python2_sitelib}/*

%files -n python3-daemonize
%doc LICENSE README.rst
%{python3_sitelib}/*

%changelog
openSUSE Build Service is sponsored by