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