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