]> git.pld-linux.org Git - packages/python-pyftpdlib.git/blob - python-pyftpdlib.spec
a5418f25ef1a982a2aaae5db9f75e59e25282edb
[packages/python-pyftpdlib.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.6
11 Release:        3
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:  459dd3e685c4b7dfcf574ca05e5586eb
17 Patch0:         %{name}-tests.patch
18 URL:            https://github.com/giampaolo/pyftpdlib/
19 %if %{with python2}
20 BuildRequires:  python-modules >= 1:2.6
21 BuildRequires:  python-setuptools
22 %if %{with tests}
23 BuildRequires:  python-pyOpenSSL
24 BuildRequires:  python-pysendfile >= 1.5
25 %endif
26 %endif
27 %if %{with python3}
28 BuildRequires:  python3-modules >= 1:3.4
29 BuildRequires:  python3-setuptools
30 %if %{with tests}
31 BuildRequires:  python3-pyOpenSSL
32 %endif
33 %endif
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
39 BuildArch:      noarch
40 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
42 %description
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.
47
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
53 języka programowania.
54
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
61
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.
67
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
73 języka programowania.
74
75 %prep
76 %setup -q -n pyftpdlib-%{version}
77 %patch0 -p1
78
79 %build
80 %if %{with python2}
81 %py_build
82
83 %if %{with tests}
84 PYTHONPATH=$(pwd)/build-2/lib \
85 %{__python} pyftpdlib/test/runner.py
86 %endif
87 %endif
88
89 %if %{with python3}
90 %py3_build
91
92 %if %{with tests}
93 PYTHONPATH=$(pwd)/build-3/lib \
94 %{__python3} pyftpdlib/test/runner.py
95 %endif
96 %endif
97
98 %install
99 rm -rf $RPM_BUILD_ROOT
100
101 %if %{with python2}
102 %py_install
103
104 %py_postclean
105 %{__rm} $RPM_BUILD_ROOT%{_bindir}/ftpbench
106 %{__rm} -r $RPM_BUILD_ROOT%{py_sitescriptdir}/pyftpdlib/test
107 %endif
108
109 %if %{with python3}
110 %py3_install
111 %{__rm} $RPM_BUILD_ROOT%{_bindir}/ftpbench
112 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitescriptdir}/pyftpdlib/test
113 %endif
114
115 # in case there are examples provided
116 %if %{with python2}
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
121 %endif
122 %if %{with python3}
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
127 %endif
128
129 %clean
130 rm -rf $RPM_BUILD_ROOT
131
132 %if %{with python2}
133 %files
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}
139 %endif
140
141 %if %{with python3}
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}
148 %endif
This page took 0.0929 seconds and 2 git commands to generate.