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