3 %bcond_without tests # unit tests
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
7 Summary: Python 2 interface to sendfile(2)
8 Summary(pl.UTF-8): Interfejs Pythona 2 do wywołania sendfile(2)
9 Name: python-pysendfile
13 Group: Libraries/Python
14 #Source0Download: https://pypi.python.org/simple/pysendfile/
15 Source0: https://pypi.python.org/packages/source/p/pysendfile/pysendfile-%{version}.tar.gz
16 # Source0-md5: e7b301eddd703ab74a48c59a8fda1f97
17 URL: https://github.com/giampaolo/pysendfile
19 BuildRequires: python-devel >= 1:2.5
20 BuildRequires: python-setuptools
23 BuildRequires: python3-devel >= 1:3.2
24 BuildRequires: python3-setuptools
26 BuildRequires: rpm-pythonprov
27 BuildRequires: rpmbuild(macros) >= 1.714
28 Requires: python-libs >= 1:2.5
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32 Python 2 interface to sendfile(2).
34 sendfile(2) is a system call which provides a "zero-copy" way of
35 copying data from one file descriptor to another (a socket). The
36 phrase "zero-copy" refers to the fact that all of the copying of data
37 between the two descriptors is done entirely by the kernel, with no
38 copying of data into userspace buffers. This is particularly useful
39 when sending a file over a socket (e.g. FTP).
41 %description -l pl.UTF-8
42 Interfejs Pythona 2 do wywołania sendfile(2)
44 sendfile(2) to wywołanie systemowe zapewniające kopiowanie "bez
45 kopiowania" z jednego deskryptora pliku do innego (gniazda).
46 Sformułowanie "bez kopiowania" oznacza tu, że całe kopiowanie danych
47 między deskryptorami jest wykonywane całkowicie w jądrze, bez
48 kopiowania danych do buforów w przestrzeni użytkownika. Jest to
49 przydatne szczególnie przy wysyłaniu pliku po gnieździe (np. FTP).
51 %package -n python3-pysendfile
52 Summary: Python 3 interface to sendfile(2)
53 Summary(pl.UTF-8): Interfejs Pythona 3 do wywołania sendfile(2)
54 Group: Libraries/Python
55 Requires: python3-libs >= 1:3.2
57 %description -n python3-pysendfile
58 Python 3 interface to sendfile(2).
60 sendfile(2) is a system call which provides a "zero-copy" way of
61 copying data from one file descriptor to another (a socket). The
62 phrase "zero-copy" refers to the fact that all of the copying of data
63 between the two descriptors is done entirely by the kernel, with no
64 copying of data into userspace buffers. This is particularly useful
65 when sending a file over a socket (e.g. FTP).
67 %description -n python3-pysendfile -l pl.UTF-8
68 Interfejs Pythona 3 do wywołania sendfile(2)
70 sendfile(2) to wywołanie systemowe zapewniające kopiowanie "bez
71 kopiowania" z jednego deskryptora pliku do innego (gniazda).
72 Sformułowanie "bez kopiowania" oznacza tu, że całe kopiowanie danych
73 między deskryptorami jest wykonywane całkowicie w jądrze, bez
74 kopiowania danych do buforów w przestrzeni użytkownika. Jest to
75 przydatne szczególnie przy wysyłaniu pliku po gnieździe (np. FTP).
78 %setup -q -n pysendfile-%{version}
85 PYTHONPATH=$(pwd)/$(echo build-2/lib.*) \
86 %{__python} test/test_sendfile.py
94 PYTHONPATH=$(pwd)/$(echo build-3/lib.*) \
95 %{__python3} test/test_sendfile.py
100 rm -rf $RPM_BUILD_ROOT
111 rm -rf $RPM_BUILD_ROOT
115 %defattr(644,root,root,755)
116 %doc HISTORY.rst LICENSE README.rst
117 %attr(755,root,root) %{py_sitedir}/sendfile.so
118 %{py_sitedir}/pysendfile-%{version}-py*.egg-info
122 %files -n python3-pysendfile
123 %defattr(644,root,root,755)
124 %doc HISTORY.rst LICENSE README.rst
125 %attr(755,root,root) %{py3_sitedir}/sendfile.cpython-*.so
126 %{py3_sitedir}/pysendfile-%{version}-py*.egg-info