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: 459dd3e685c4b7dfcf574ca05e5586eb
17 Patch0: %{name}-tests.patch
18 URL: https://github.com/giampaolo/pyftpdlib/
20 BuildRequires: python-modules >= 1:2.6
21 BuildRequires: python-setuptools
23 BuildRequires: python-pyOpenSSL
24 BuildRequires: python-pysendfile >= 1.5
28 BuildRequires: python3-modules >= 1:3.4
29 BuildRequires: python3-setuptools
31 BuildRequires: python3-pyOpenSSL
34 BuildRequires: rpm-pythonprov
35 BuildRequires: rpmbuild(macros) >= 1.714
36 Requires: python-modules >= 1:2.6
37 Suggests: python-pyOpenSSL
38 Suggests: python-pysendfile >= 1.5
40 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43 Python FTP server library provides a high-level portable interface to
44 easily write very efficient, scalable and asynchronous FTP servers
45 with Python. It is the most complete RFC-959 FTP server implementation
46 available for Python programming language.
48 %description -l pl.UTF-8
49 Biblioteka serwera FTP dla Pythona udostępnia wysokopoziomowy,
50 przenośny interfejs do łatwego tworzenia bardzo wydajnych,
51 skalowalnych i asynchronicznych serwerów FTP w Pythonie. Jest to
52 najpełniejsza implementacja serwera FTP wg RFC-959 dostępna dla tego
55 %package -n python3-pyftpdlib
56 Summary: Very fast asynchronous FTP server library for Python 3
57 Summary(pl.UTF-8): Bardzo szybka biblioteka asynchronicznego serwera FTP dla Pythona 3
58 Group: Libraries/Python
59 Requires: python3-modules >= 1:3.4
60 Suggests: python3-pyOpenSSL
62 %description -n python3-pyftpdlib
63 Python FTP server library provides a high-level portable interface to
64 easily write very efficient, scalable and asynchronous FTP servers
65 with Python. It is the most complete RFC-959 FTP server implementation
66 available for Python programming language.
68 %description -n python3-pyftpdlib -l pl.UTF-8
69 Biblioteka serwera FTP dla Pythona udostępnia wysokopoziomowy,
70 przenośny interfejs do łatwego tworzenia bardzo wydajnych,
71 skalowalnych i asynchronicznych serwerów FTP w Pythonie. Jest to
72 najpełniejsza implementacja serwera FTP wg RFC-959 dostępna dla tego
76 %setup -q -n pyftpdlib-%{version}
84 PYTHONPATH=$(pwd)/build-2/lib \
85 %{__python} pyftpdlib/test/runner.py
93 PYTHONPATH=$(pwd)/build-3/lib \
94 %{__python3} pyftpdlib/test/runner.py
99 rm -rf $RPM_BUILD_ROOT
105 %{__rm} $RPM_BUILD_ROOT%{_bindir}/ftpbench
106 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/pyftpdlib/test
111 %{__rm} $RPM_BUILD_ROOT%{_bindir}/ftpbench
112 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/pyftpdlib/test
115 # in case there are examples provided
117 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
118 cp -a demo/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
119 %{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+python(\s|$),#!%{__python}\1,' \
120 $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/*.py
123 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-pyftpdlib-%{version}
124 cp -a demo/* $RPM_BUILD_ROOT%{_examplesdir}/python3-pyftpdlib-%{version}
125 %{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+python(\s|$),#!%{__python3}\1,' \
126 $RPM_BUILD_ROOT%{_examplesdir}/python3-pyftpdlib-%{version}/*.py
130 rm -rf $RPM_BUILD_ROOT
134 %defattr(644,root,root,755)
135 %doc CREDITS HISTORY.rst LICENSE README.rst
136 %{py_sitescriptdir}/pyftpdlib
137 %{py_sitescriptdir}/pyftpdlib-%{version}-py*.egg-info
138 %{_examplesdir}/%{name}-%{version}
142 %files -n python3-pyftpdlib
143 %defattr(644,root,root,755)
144 %doc CREDITS HISTORY.rst LICENSE README.rst
145 %{py3_sitescriptdir}/pyftpdlib
146 %{py3_sitescriptdir}/pyftpdlib-%{version}-py*.egg-info
147 %{_examplesdir}/python3-pyftpdlib-%{version}