]> git.pld-linux.org Git - SPECS.git/blob - python-pyftpdlib.spec
SPECS updated Sun 1 Aug 20:13:02 CEST 2021
[SPECS.git] / python-pyftpdlib.spec
1 #
2 # Conditional build:
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
6
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
9 Name:           python-pyftpdlib
10 Version:        1.5.5
11 Release:        4
12 License:        MIT
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/
20 %if %{with python2}
21 BuildRequires:  python-modules >= 1:2.6
22 BuildRequires:  python-setuptools
23 %if %{with tests}
24 BuildRequires:  python-pyOpenSSL
25 BuildRequires:  python-pysendfile >= 1.5
26 %endif
27 %endif
28 %if %{with python3}
29 BuildRequires:  python3-modules >= 1:3.4
30 BuildRequires:  python3-setuptools
31 %if %{with tests}
32 BuildRequires:  python3-pyOpenSSL
33 %endif
34 %endif
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
40 BuildArch:      noarch
41 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42
43 %description
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.
48
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
54 języka programowania.
55
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
62
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.
68
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
74 języka programowania.
75
76 %prep
77 %setup -q -n pyftpdlib-%{version}
78 %patch0 -p1
79 %patch1 -p1
80
81 %build
82 %if %{with python2}
83 %py_build
84
85 %if %{with tests}
86 PYTHONPATH=$(pwd)/build-2/lib \
87 %{__python} pyftpdlib/test/runner.py
88 %endif
89 %endif
90
91 %if %{with python3}
92 %py3_build
93
94 %if %{with tests}
95 PYTHONPATH=$(pwd)/build-3/lib \
96 %{__python3} pyftpdlib/test/runner.py
97 %endif
98 %endif
99
100 %install
101 rm -rf $RPM_BUILD_ROOT
102
103 %if %{with python2}
104 %py_install
105
106 %py_postclean
107 %{__rm} $RPM_BUILD_ROOT%{_bindir}/ftpbench
108 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/pyftpdlib/test
109 %endif
110
111 %if %{with python3}
112 %py3_install
113 %{__rm} $RPM_BUILD_ROOT%{_bindir}/ftpbench
114 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/pyftpdlib/test
115 %endif
116
117 # in case there are examples provided
118 %if %{with python2}
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
123 %endif
124 %if %{with python3}
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
129 %endif
130
131 %clean
132 rm -rf $RPM_BUILD_ROOT
133
134 %if %{with python2}
135 %files
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}
141 %endif
142
143 %if %{with python3}
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}
150 %endif
This page took 0.117371 seconds and 3 git commands to generate.