2016-05-23 10:46:46 +00:00
#
# spec file for package python-pyftpdlib
#
2020-03-18 09:23:34 +00:00
# Copyright (c) 2020 SUSE LLC
2016-05-23 10:46:46 +00:00
# Copyright (c) 2016 LISA GmbH, Bingen, 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.
2018-12-04 13:50:54 +00:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
2017-06-22 14:54:05 +00:00
#
2016-05-23 10:46:46 +00:00
2017-06-22 14:54:05 +00:00
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
2020-04-20 10:42:08 +00:00
%bcond_without python2
2016-05-23 10:46:46 +00:00
Name : python-pyftpdlib
2020-03-18 09:23:34 +00:00
Version : 1.5.6
2016-05-23 10:46:46 +00:00
Release : 0
2017-07-06 11:30:42 +00:00
Summary : Asynchronous FTP server library for Python
2017-06-22 14:54:05 +00:00
License : MIT
2016-05-23 10:46:46 +00:00
Group : Development/Languages/Python
2018-05-02 10:30:31 +00:00
URL : https://github.com/giampaolo/pyftpdlib/
2017-06-22 14:54:05 +00:00
Source : https://files.pythonhosted.org/packages/source/p/pyftpdlib/pyftpdlib-%{version} .tar.gz
2018-05-09 01:35:26 +00:00
BuildRequires : %{python_module psutil}
2018-12-04 13:50:54 +00:00
BuildRequires : %{python_module pyOpenSSL}
2018-05-09 01:35:26 +00:00
BuildRequires : %{python_module pysendfile}
2020-08-16 07:53:43 +00:00
BuildRequires : %{python_module pytest}
2017-06-22 14:54:05 +00:00
BuildRequires : %{python_module setuptools}
2018-05-02 10:30:31 +00:00
BuildRequires : fdupes
2018-12-04 13:50:54 +00:00
BuildRequires : python-rpm-macros
2017-06-22 14:54:05 +00:00
Requires : python-pyOpenSSL
2020-05-20 11:29:30 +00:00
Requires(post) : update-alternatives
Requires(postun) : update-alternatives
2018-05-09 01:35:26 +00:00
Recommends: python-pysendfile
2020-04-20 10:42:08 +00:00
BuildArch : noarch
%if %{with python2}
BuildRequires : python-ipaddress
BuildRequires : python-mock
%endif
2018-05-09 01:35:26 +00:00
%if python2
Requires : python-ipaddress
%endif
2017-06-22 14:54:05 +00:00
%python_subpackages
2016-05-23 10:46:46 +00:00
%description
2017-07-06 11:30:42 +00:00
The Python FTP server library provides a high-level interface to
write very asynchronous FTP servers with Python.
2016-05-23 10:46:46 +00:00
%prep
%setup -q -n pyftpdlib-%{version}
%build
2017-06-22 14:54:05 +00:00
%python_build
2016-05-23 10:46:46 +00:00
%install
2017-06-22 14:54:05 +00:00
%python_install
2020-05-20 11:29:30 +00:00
%python_clone -a %{buildroot} %{_bindir} /ftpbench
2019-05-25 09:32:02 +00:00
%python_expand %fdupes %{buildroot} %{$python_sitelib}
2020-03-27 08:59:34 +00:00
# Note: Do not remove tests. Other packages import them
2016-05-23 10:46:46 +00:00
%check
2020-08-16 07:53:43 +00:00
# Tests reported as randomly failing in 2016 against v1.5.0:
# https://github.com/giampaolo/pyftpdlib/issues/386
# If they re-occur, please update the issue with backtraces,
# and disable only related tests.
2017-06-22 14:54:05 +00:00
export PYTHONPATH=$PWD
2020-08-16 07:53:43 +00:00
printf '[pytest]\naddopts = -rs -v -k "not (TestFtpStoreDataTLSMixin and test_rest_on_stor) and not (TestFtpStoreDataTLSMixin and test_stor_ascii)"' > pytest.ini
# %%pytest des not work. The tests parse CLI args and fail if there are any unknown program args
%python_exec -m pytest
2016-05-23 10:46:46 +00:00
2020-05-20 11:29:30 +00:00
%post
%python_install_alternative ftpbench
%postun
%python_uninstall_alternative ftpbench
2017-06-22 14:54:05 +00:00
%files %{python_files}
2018-05-02 10:30:31 +00:00
%license LICENSE
%doc README.rst
2020-05-20 11:29:30 +00:00
%python_alternative %{_bindir} /ftpbench
2016-05-23 10:46:46 +00:00
%{python_sitelib} /*
%changelog