]> git.pld-linux.org Git - packages/python-cffi.git/blob - python-cffi.spec
125d2ae04b39fcf610e9174c3a274a2ba9a02885
[packages/python-cffi.git] / python-cffi.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # CPython 2.x module
4 %bcond_without  python3 # CPython 3.x module
5 %bcond_without  doc     # Sphinx based documentation
6 %bcond_without  tests   # unit tests
7 #
8 Summary:        Foreign Function Interface for Python 2 calling C code
9 Summary(pl.UTF-8):      Interfejs funkcji obcych (FFI) dla Pythona 2 wywołującego kod w C
10 Name:           python-cffi
11 Version:        1.14.4
12 Release:        1
13 License:        MIT
14 Group:          Libraries/Python
15 #Source0Download: https://pypi.org/simple/cffi/
16 Source0:        https://files.pythonhosted.org/packages/source/c/cffi/cffi-%{version}.tar.gz
17 # Source0-md5:  ad3d8537b1516bad6bcdc36c458788be
18 URL:            http://cffi.readthedocs.org/
19 BuildRequires:  libffi-devel >= 3
20 BuildRequires:  pkgconfig
21 %if %{with python2}
22 BuildRequires:  python >= 1:2.6
23 BuildRequires:  python-devel >= 1:2.6
24 %if %{with tests}
25 BuildRequires:  python-pycparser
26 BuildRequires:  python-pytest
27 %endif
28 %endif
29 %if %{with python3}
30 BuildRequires:  python3 >= 1:3.2
31 BuildRequires:  python3-devel >= 1:3.2
32 %if %{with tests}
33 BuildRequires:  python3-pycparser
34 BuildRequires:  python3-pytest
35 %endif
36 %endif
37 BuildRequires:  rpm-pythonprov
38 BuildRequires:  rpmbuild(macros) >= 1.714
39 %{?with_doc:BuildRequires:      sphinx-pdg}
40 Requires:       python-modules >= 1:2.6
41 Requires:       python-pycparser
42 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43
44 %description
45 Foreign Function Interface for Python calling C code. The aim of this
46 project is to provide a convenient and reliable way of calling C code
47 from Python without learning additional language or API.
48
49 This package contains Python 2 module.
50
51 %description -l pl.UTF-8
52 CFFI to interfejs funkcji obcych (FFI - foreign Function Interface) do
53 wywoływania kodu w C z Pythona. Celem projektu jest dostarczenie
54 wygodnego i wiarygodnego sposobu wywoływania kodu w C z Pythona bez
55 potrzeby nauki dodatkowego języka lub API.
56
57 Ten pakiet zawiera moduł Pythona 2.
58
59 %package -n python3-cffi
60 Summary:        Foreign Function Interface for Python 3 calling C code
61 Summary(pl.UTF-8):      Interfejs funkcji obcych (FFI) dla Pythona 3 wywołującego kod w C
62 Group:          Libraries/Python
63 Requires:       python3-modules >= 1:3.2
64 Requires:       python3-pycparser
65
66 %description -n python3-cffi
67 Foreign Function Interface for Python calling C code. The aim of this
68 project is to provide a convenient and reliable way of calling C code
69 from Python without learning additional language or API.
70
71 This package contains Python 3 module.
72
73 %description -n python3-cffi -l pl.UTF-8
74 CFFI to interfejs funkcji obcych (FFI - foreign Function Interface) do
75 wywoływania kodu w C z Pythona. Celem projektu jest dostarczenie
76 wygodnego i wiarygodnego sposobu wywoływania kodu w C z Pythona bez
77 potrzeby nauki dodatkowego języka lub API.
78
79 Ten pakiet zawiera moduł Pythona 3.
80
81 %package apidocs
82 Summary:        API documentation for Python CFFI module
83 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona CFFI
84 Group:          Documentation
85 %if "%{_rpmversion}" >= "5"
86 BuildArch:      noarch
87 %endif
88
89 %description apidocs
90 API documentation for Python CFFI module.
91
92 %description apidocs -l pl.UTF-8
93 Dokumentacja API modułu Pythona CFFI.
94
95 %prep
96 %setup -q -n cffi-%{version}
97
98 %build
99 %if %{with python2}
100 %py_build
101
102 %if %{with tests}
103 PYTHONPATH=$(pwd):$(echo $(pwd)/build-2/lib.linux-*) \
104 py.test-2 c testing
105 %endif
106 %endif
107
108 %if %{with python3}
109 %py3_build
110
111 %if %{with tests}
112 PYTHONPATH=$(pwd):$(echo $(pwd)/build-3/lib.linux-*) \
113 py.test-3 c testing
114 %endif
115 %endif
116
117 %if %{with doc}
118 %{__make} -C doc html
119 %endif
120
121 %install
122 rm -rf $RPM_BUILD_ROOT
123
124 %if %{with python2}
125 %py_install
126
127 %py_postclean
128 %endif
129
130 %if %{with python3}
131 %py3_install
132 %endif
133
134 %clean
135 rm -rf $RPM_BUILD_ROOT
136
137 %if %{with python2}
138 %files
139 %defattr(644,root,root,755)
140 %doc AUTHORS LICENSE README.md
141 %attr(755,root,root) %{py_sitedir}/_cffi_backend.so
142 %dir %{py_sitedir}/cffi
143 %{py_sitedir}/cffi/_cffi_errors.h
144 %{py_sitedir}/cffi/_cffi_include.h
145 %{py_sitedir}/cffi/_embedding.h
146 %{py_sitedir}/cffi/parse_c_type.h
147 %{py_sitedir}/cffi/*.py[co]
148 %{py_sitedir}/cffi-%{version}-py*.egg-info
149 %endif
150
151 %if %{with python3}
152 %files -n python3-cffi
153 %defattr(644,root,root,755)
154 %doc AUTHORS LICENSE README.md
155 %attr(755,root,root) %{py3_sitedir}/_cffi_backend.cpython-*.so
156 %dir %{py3_sitedir}/cffi
157 %{py3_sitedir}/cffi/_cffi_errors.h
158 %{py3_sitedir}/cffi/_cffi_include.h
159 %{py3_sitedir}/cffi/_embedding.h
160 %{py3_sitedir}/cffi/parse_c_type.h
161 %{py3_sitedir}/cffi/*.py
162 %{py3_sitedir}/cffi/__pycache__
163 %{py3_sitedir}/cffi-%{version}-py*.egg-info
164 %endif
165
166 %if %{with doc}
167 %files apidocs
168 %defattr(644,root,root,755)
169 %doc doc/build/html/{_static,*.html,*.js}
170 %endif
This page took 0.091081 seconds and 2 git commands to generate.