]>
Commit | Line | Data |
---|---|---|
c34b1242 | 1 | # |
bada27ee JR |
2 | # TODO: versions 1.19.0+ support only python 3 |
3 | # | |
c34b1242 JB |
4 | # Conditional build: |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
7 | %bcond_without doc # Sphinx documentation | |
8 | %bcond_without tests # unit tests | |
9 | ||
4a451d0d | 10 | %define module pycairo |
c34b1242 JB |
11 | Summary: Python 2 Cairo bindings |
12 | Summary(pl.UTF-8): Dowiązania Pythona 2 dla Cairo | |
4a451d0d | 13 | Name: python-%{module} |
bada27ee JR |
14 | Version: 1.18.2 |
15 | Release: 1 | |
d13cde63 | 16 | License: LGPL v2.1 or MPL v1.1 |
c34b1242 | 17 | Group: Libraries/Python |
aae9ed85 | 18 | Source0: https://github.com/pygobject/pycairo/releases/download/v%{version}/%{module}-%{version}.tar.gz |
bada27ee | 19 | # Source0-md5: be2ba51f234270dec340f28f1695a95e |
7e045162 | 20 | URL: http://cairographics.org/ |
aae9ed85 | 21 | BuildRequires: cairo-devel >= 1.13.1 |
42756d91 | 22 | BuildRequires: pkgconfig |
c34b1242 JB |
23 | %if %{with python2} |
24 | BuildRequires: python >= 1:2.7 | |
25 | BuildRequires: python-devel >= 1:2.7 | |
26 | # python2 only for now | |
aae9ed85 | 27 | BuildRequires: python-xpyb-devel >= 1.3 |
c34b1242 JB |
28 | %if %{with tests} |
29 | BuildRequires: python-hypothesis | |
30 | BuildRequires: python-numpy | |
31 | BuildRequires: python-pytest | |
32 | %endif | |
33 | %endif | |
34 | %if %{with python3} | |
35 | BuildRequires: python3 >= 1:3.3 | |
36 | BuildRequires: python3-devel >= 1:3.3 | |
37 | %if %{with tests} | |
38 | BuildRequires: python3-hypothesis | |
39 | BuildRequires: python3-numpy | |
40 | BuildRequires: python3-pytest | |
41 | %endif | |
42 | %endif | |
9c0f8b4f | 43 | BuildRequires: rpm-pythonprov |
c34b1242 JB |
44 | BuildRequires: rpmbuild(macros) >= 1.714 |
45 | %if %{with doc} | |
46 | BuildRequires: python-Sphinx | |
9986d12b | 47 | BuildRequires: python-sphinx_rtd_theme |
c34b1242 JB |
48 | %endif |
49 | Requires: python-libs >= 1:2.7 | |
aae9ed85 | 50 | Requires: cairo >= 1.13.1 |
7e045162 | 51 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
52 | ||
53 | %description | |
c34b1242 | 54 | Python 2 Cairo bindings. |
7e045162 | 55 | |
1d2580e4 | 56 | %description -l pl.UTF-8 |
c34b1242 | 57 | Dowiązania Pythona 2 dla Cairo. |
7e045162 | 58 | |
872bde3c | 59 | %package devel |
c34b1242 JB |
60 | Summary: Development files for Python 2 pycairo |
61 | Summary(pl.UTF-8): Pliki programistyczne pycairo dla Pythona 2 | |
26d6d393 | 62 | Group: Development/Libraries |
63 | Requires: %{name} = %{version}-%{release} | |
aae9ed85 | 64 | Requires: cairo-devel >= 1.13.1 |
c34b1242 | 65 | Requires: python-devel >= 1:2.7 |
872bde3c | 66 | |
67 | %description devel | |
c34b1242 | 68 | Development files for Python 2 pycairo. |
872bde3c | 69 | |
1d2580e4 | 70 | %description devel -l pl.UTF-8 |
c34b1242 JB |
71 | Pliki programistyczne pycairo dla Pythona 2. |
72 | ||
73 | %package -n python3-%{module} | |
74 | Summary: Python 3 Cairo bindings | |
75 | Summary(pl.UTF-8): Dowiązania Pythona 3 dla Cairo | |
76 | Group: Libraries/Python | |
77 | Requires: cairo >= 1.13.1 | |
78 | Requires: python3-libs >= 1:3.3 | |
79 | ||
80 | %description -n python3-%{module} | |
81 | Python 3 Cairo bindings. | |
82 | ||
83 | %description -n python3-%{module} -l pl.UTF-8 | |
84 | Dowiązania Pythona 3 dla Cairo. | |
85 | ||
86 | %package -n python3-%{module}-devel | |
87 | Summary: Development files for Python 3 pycairo | |
88 | Summary(pl.UTF-8): Pliki programistyczne pycairo dla Pythona 3 | |
89 | Group: Development/Libraries | |
90 | Requires: cairo-devel >= 1.13.1 | |
91 | Requires: python3-%{module} = %{version}-%{release} | |
92 | Requires: python3-devel >= 1:3.3 | |
93 | ||
94 | %description -n python3-%{module}-devel | |
95 | Development files for Python 3 pycairo. | |
96 | ||
97 | %description -n python3-%{module}-devel -l pl.UTF-8 | |
98 | Pliki programistyczne pycairo dla Pythona 3. | |
99 | ||
100 | %package apidocs | |
101 | Summary: API documentation for Python Cairo bindings | |
102 | Summary(pl.UTF-8): Dokumentacja API dla wiązań Pythona do Cairo | |
103 | Group: Documentation | |
c34b1242 | 104 | BuildArch: noarch |
c34b1242 JB |
105 | |
106 | %description apidocs | |
107 | API documentation for Python Cairo bindings. | |
108 | ||
109 | %description apidocs -l pl.UTF-8 | |
110 | Dokumentacja API dla wiązań Pythona do Cairo. | |
872bde3c | 111 | |
7e045162 | 112 | %package examples |
26d6d393 | 113 | Summary: Example programs using Python Cairo bindings |
562246db | 114 | Summary(pl.UTF-8): Przykładowe programy w Pythonie używające Cairo |
26d6d393 | 115 | Group: Libraries/Python |
c34b1242 | 116 | Obsoletes: python3-pycairo-devel |
c34b1242 | 117 | BuildArch: noarch |
7e045162 | 118 | |
119 | %description examples | |
120 | Example programs using Python Cairo bindings. | |
121 | ||
1d2580e4 JR |
122 | %description examples -l pl.UTF-8 |
123 | Przykładowe programy w Pythonie używające Cairo. | |
7e045162 | 124 | |
125 | %prep | |
aae9ed85 | 126 | %setup -q -n pycairo-%{version} |
7e045162 | 127 | |
c34b1242 JB |
128 | %build |
129 | %if %{with python2} | |
130 | %py_build %{?with_tests:test} \ | |
131 | --enable-xpyb | |
aae9ed85 | 132 | %endif |
37c19a15 | 133 | |
c34b1242 JB |
134 | %if %{with python3} |
135 | %py3_build %{?with_tests:test} | |
136 | %endif | |
137 | ||
138 | %if %{with doc} | |
139 | %{__make} -C docs | |
140 | %endif | |
7e045162 | 141 | |
142 | %install | |
143 | rm -rf $RPM_BUILD_ROOT | |
144 | install -d $RPM_BUILD_ROOT%{_examplesdir} | |
145 | ||
c34b1242 | 146 | %if %{with python2} |
aae9ed85 | 147 | %py_install |
7e045162 | 148 | |
c34b1242 JB |
149 | %py_postclean |
150 | %endif | |
7e045162 | 151 | |
e2066932 | 152 | %if %{with python3} |
c34b1242 JB |
153 | %py3_install |
154 | %endif | |
155 | ||
156 | cp -a examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
7e045162 | 157 | |
158 | %clean | |
159 | rm -rf $RPM_BUILD_ROOT | |
160 | ||
c34b1242 | 161 | %if %{with python2} |
7e045162 | 162 | %files |
163 | %defattr(644,root,root,755) | |
aae9ed85 | 164 | %doc COPYING NEWS README.rst |
7e045162 | 165 | %dir %{py_sitedir}/cairo |
37c19a15 | 166 | %attr(755,root,root) %{py_sitedir}/cairo/_cairo.so |
c34b1242 JB |
167 | %{py_sitedir}/cairo/__init__.py[co] |
168 | %{py_sitedir}/cairo/__init__.pyi | |
aae9ed85 | 169 | %{py_sitedir}/cairo/include |
bada27ee | 170 | %{py_sitedir}/cairo/py.typed |
c34b1242 | 171 | %{py_sitedir}/pycairo-%{version}-py*.egg-info |
7e045162 | 172 | |
872bde3c | 173 | %files devel |
174 | %defattr(644,root,root,755) | |
c34b1242 JB |
175 | %dir %{_includedir}/pycairo |
176 | %{_includedir}/pycairo/pycairo.h | |
872bde3c | 177 | %{_pkgconfigdir}/pycairo.pc |
e2066932 | 178 | %endif |
218451c6 | 179 | |
c34b1242 JB |
180 | %if %{with python3} |
181 | %files -n python3-%{module} | |
182 | %defattr(644,root,root,755) | |
183 | %doc COPYING NEWS README.rst | |
184 | %dir %{py3_sitedir}/cairo | |
185 | %attr(755,root,root) %{py3_sitedir}/cairo/_cairo.cpython-*.so | |
186 | %{py3_sitedir}/cairo/__init__.py | |
187 | %{py3_sitedir}/cairo/__init__.pyi | |
188 | %{py3_sitedir}/cairo/__pycache__ | |
189 | %{py3_sitedir}/cairo/include | |
bada27ee | 190 | %{py3_sitedir}/cairo/py.typed |
c34b1242 JB |
191 | %{py3_sitedir}/pycairo-%{version}-py*.egg-info |
192 | ||
193 | %files -n python3-%{module}-devel | |
194 | %defattr(644,root,root,755) | |
195 | %dir %{_includedir}/pycairo | |
196 | %{_includedir}/pycairo/py3cairo.h | |
197 | %{_pkgconfigdir}/py3cairo.pc | |
198 | %endif | |
199 | ||
200 | %if %{with doc} | |
201 | %files apidocs | |
202 | %defattr(644,root,root,755) | |
203 | %doc docs/_build/{_images,_static,reference,*.html,*.js} | |
204 | %endif | |
205 | ||
7e045162 | 206 | %files examples |
207 | %defattr(644,root,root,755) | |
208 | %{_examplesdir}/%{name}-%{version} |