3 %bcond_with tests # unit tests (can fail under heavy system load)
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
7 Summary: Very fast asynchronous FTP server library for Python 2
8 Summary(pl.UTF-8): Bardzo szybka biblioteka asynchronicznego serwera FTP dla Pythona 2
13 Group: Libraries/Python
14 #Source0Download: https://pypi.python.org/simple/pyftpdlib/
15 Source0: https://files.pythonhosted.org/packages/source/p/pyftpdlib/pyftpdlib-%{version}.tar.gz
16 # Source0-md5: 7f8089520d60171bee5dab2b721e8d00
17 Patch0: %{name}-tests.patch
18 Patch1: %{name}-sendfile.patch
19 URL: https://github.com/giampaolo/pyftpdlib/
21 BuildRequires: python-modules >= 1:2.6
22 BuildRequires: python-setuptools
24 BuildRequires: python-pyOpenSSL
25 BuildRequires: python-pysendfile >= 1.5
29 BuildRequires: python3-modules >= 1:3.4
30 BuildRequires: python3-setuptools
32 BuildRequires: python3-pyOpenSSL
35 BuildRequires: rpm-pythonprov
36 BuildRequires: rpmbuild(macros) >= 1.714
37 Requires: python-modules >= 1:2.6
38 Suggests: python-pyOpenSSL
39 Suggests: python-pysendfile >= 1.5
41 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44 Python FTP server library provides a high-level portable interface to
45 easily write very efficient, scalable and asynchronous FTP servers
46 with Python. It is the most complete RFC-959 FTP server implementation
47 available for Python programming language.
49 %description -l pl.UTF-8
50 Biblioteka serwera FTP dla Pythona udostępnia wysokopoziomowy,
51 przenośny interfejs do łatwego tworzenia bardzo wydajnych,
52 skalowalnych i asynchronicznych serwerów FTP w Pythonie. Jest to
53 najpełniejsza implementacja serwera FTP wg RFC-959 dostępna dla tego
56 %package -n python3-pyftpdlib
57 Summary: Very fast asynchronous FTP server library for Python 3
58 Summary(pl.UTF-8): Bardzo szybka biblioteka asynchronicznego serwera FTP dla Pythona 3
59 Group: Libraries/Python
60 Requires: python3-modules >= 1:3.4
61 Suggests: python3-pyOpenSSL
63 %description -n python3-pyftpdlib
64 Python FTP server library provides a high-level portable interface to
65 easily write very efficient, scalable and asynchronous FTP servers
66 with Python. It is the most complete RFC-959 FTP server implementation
67 available for Python programming language.
69 %description -n python3-pyftpdlib -l pl.UTF-8
70 Biblioteka serwera FTP dla Pythona udostępnia wysokopoziomowy,
71 przenośny interfejs do łatwego tworzenia bardzo wydajnych,
72 skalowalnych i asynchronicznych serwerów FTP w Pythonie. Jest to
73 najpełniejsza implementacja serwera FTP wg RFC-959 dostępna dla tego
77 %setup -q -n pyftpdlib-%{version}
86 PYTHONPATH=$(pwd)/build-2/lib \
87 %{__python} pyftpdlib/test/runner.py
95 PYTHONPATH=$(pwd)/build-3/lib \
96 %{__python3} pyftpdlib/test/runner.py
101 rm -rf $RPM_BUILD_ROOT
107 %{__rm} $RPM_BUILD_ROOT%{_bindir}/ftpbench
108 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/pyftpdlib/test
113 %{__rm} $RPM_BUILD_ROOT%{_bindir}/ftpbench
114 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/pyftpdlib/test
117 # in case there are examples provided
119 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
120 cp -a demo/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
121 %{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+python(\s|$),#!%{__python}\1,' \
122 $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/*.py
125 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-pyftpdlib-%{version}
126 cp -a demo/* $RPM_BUILD_ROOT%{_examplesdir}/python3-pyftpdlib-%{version}
127 %{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+python(\s|$),#!%{__python3}\1,' \
128 $RPM_BUILD_ROOT%{_examplesdir}/python3-pyftpdlib-%{version}/*.py
132 rm -rf $RPM_BUILD_ROOT
136 %defattr(644,root,root,755)
137 %doc CREDITS HISTORY.rst LICENSE README.rst
138 %{py_sitescriptdir}/pyftpdlib
139 %{py_sitescriptdir}/pyftpdlib-%{version}-py*.egg-info
140 %{_examplesdir}/%{name}-%{version}
144 %files -n python3-pyftpdlib
145 %defattr(644,root,root,755)
146 %doc CREDITS HISTORY.rst LICENSE README.rst
147 %{py3_sitescriptdir}/pyftpdlib
148 %{py3_sitescriptdir}/pyftpdlib-%{version}-py*.egg-info
149 %{_examplesdir}/python3-pyftpdlib-%{version}