]> git.pld-linux.org Git - packages/python-pysendfile.git/blob - python-pysendfile.spec
rebuild with python 3.10
[packages/python-pysendfile.git] / python-pysendfile.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # unit tests
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6
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
10 Version:        2.0.1
11 Release:        7
12 License:        MIT
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
18 %if %{with python2}
19 BuildRequires:  python-devel >= 1:2.5
20 BuildRequires:  python-setuptools
21 %endif
22 %if %{with python3}
23 BuildRequires:  python3-devel >= 1:3.2
24 BuildRequires:  python3-setuptools
25 %endif
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)
30
31 %description
32 Python 2 interface to sendfile(2).
33
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).
40
41 %description -l pl.UTF-8
42 Interfejs Pythona 2 do wywołania sendfile(2)
43
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).
50
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
56
57 %description -n python3-pysendfile
58 Python 3 interface to sendfile(2).
59
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).
66
67 %description -n python3-pysendfile -l pl.UTF-8
68 Interfejs Pythona 3 do wywołania sendfile(2)
69
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).
76
77 %prep
78 %setup -q -n pysendfile-%{version}
79
80 %build
81 %if %{with python2}
82 %py_build
83
84 %if %{with tests}
85 PYTHONPATH=$(pwd)/$(echo build-2/lib.*) \
86 %{__python} test/test_sendfile.py
87 %endif
88 %endif
89
90 %if %{with python3}
91 %py3_build
92
93 %if %{with tests}
94 PYTHONPATH=$(pwd)/$(echo build-3/lib.*) \
95 %{__python3} test/test_sendfile.py
96 %endif
97 %endif
98
99 %install
100 rm -rf $RPM_BUILD_ROOT
101
102 %if %{with python2}
103 %py_install
104 %endif
105
106 %if %{with python3}
107 %py3_install
108 %endif
109
110 %clean
111 rm -rf $RPM_BUILD_ROOT
112
113 %if %{with python2}
114 %files
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
119 %endif
120
121 %if %{with python3}
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
127 %endif
This page took 0.102926 seconds and 3 git commands to generate.