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