]>
Commit | Line | Data |
---|---|---|
a5fba226 AF |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # Python 2.x module | |
4 | %bcond_without python3 # Python 3.x module | |
1c1e8382 JB |
5 | %bcond_without doc # Sphinx documentation |
6 | %bcond_with tests # unit tests (fail at the beginning as of 3.30.1) | |
63e1dd2b | 7 | |
a5fba226 | 8 | %define module pygobject |
a5fba226 AF |
9 | Summary: Python bindings for GObject library |
10 | Summary(pl.UTF-8): Wiązania Pythona do biblioteki GObject | |
7d22b890 | 11 | Name: python-pygobject3 |
9c72f25a | 12 | Version: 3.32.2 |
1c1e8382 | 13 | Release: 1 |
a5fba226 AF |
14 | License: LGPL v2+ |
15 | Group: Libraries/Python | |
9c72f25a | 16 | Source0: http://ftp.gnome.org/pub/GNOME/sources/pygobject/3.32/%{module}-%{version}.tar.xz |
ba21e75d | 17 | # Source0-md5: 92ffa25351782feb96362f0dace2089f |
14d87b6a | 18 | URL: https://wiki.gnome.org/Projects/PyGObject |
590b40c5 | 19 | BuildRequires: cairo-gobject-devel |
41b0cda2 | 20 | BuildRequires: glib2-devel >= 1:2.48.0 |
badcdbca | 21 | BuildRequires: gobject-introspection-devel >= 1.46.0 |
a5fba226 | 22 | BuildRequires: libffi-devel >= 3.0 |
a5fba226 AF |
23 | BuildRequires: pkgconfig |
24 | BuildRequires: rpm-pythonprov | |
1c1e8382 | 25 | %{?with_doc:BuildRequires: sphinx-pdg} |
a5fba226 AF |
26 | BuildRequires: tar >= 1:1.22 |
27 | BuildRequires: xz | |
28 | %if %{with python2} | |
205b0127 | 29 | BuildRequires: python-devel >= 1:2.7 |
01f4a943 | 30 | BuildRequires: python-pycairo-devel >= 1.11.1 |
1c1e8382 JB |
31 | BuildRequires: python-setuptools |
32 | %if %{with tests} | |
33 | BuildRequires: python-pytest | |
34 | %endif | |
a5fba226 AF |
35 | %endif |
36 | %if %{with python3} | |
1c1e8382 JB |
37 | BuildRequires: python3 >= 1:3.5 |
38 | BuildRequires: python3-devel >= 1:3.5 | |
39 | BuildRequires: python3-modules >= 1:3.5 | |
01f4a943 | 40 | BuildRequires: python3-pycairo-devel >= 1.11.1 |
1c1e8382 JB |
41 | BuildRequires: python3-setuptools |
42 | %if %{with tests} | |
43 | BuildRequires: python3-pytest | |
44 | %endif | |
a5fba226 | 45 | %endif |
41b0cda2 | 46 | Requires: glib2 >= 1:2.48.0 |
badcdbca | 47 | Requires: gobject-introspection >= 1.46.0 |
eebd4be2 | 48 | Requires: python-modules >= 1:2.7 |
23ea25eb | 49 | Conflicts: python-pygobject < 2.28.6-3 |
a5fba226 AF |
50 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
51 | ||
a5fba226 AF |
52 | %description |
53 | Python bindings for GObject library. | |
54 | ||
55 | %description -l pl.UTF-8 | |
56 | Wiązania Pythona do biblioteki GObject. | |
57 | ||
3955a8b7 AF |
58 | %package common-devel |
59 | Summary: Python bindings for GObject library | |
60 | Summary(pl.UTF-8): Wiązania Pythona do biblioteki GObject | |
61 | Group: Development/Languages/Python | |
62 | Requires: %{name} = %{version}-%{release} | |
41b0cda2 | 63 | Requires: glib2-devel >= 1:2.48.0 |
3955a8b7 AF |
64 | Requires: libffi-devel >= 3.0 |
65 | ||
d1050d12 | 66 | %description common-devel |
538a43f0 ŁK |
67 | This package contains headers files required to build wrappers for |
68 | GObject addon libraries so that they interoperate with Python | |
3955a8b7 AF |
69 | bindings. |
70 | ||
d1050d12 | 71 | %description common-devel -l pl.UTF-8 |
538a43f0 ŁK |
72 | Pakiet zawiera pliki nagłówkowe wymagane do zbudowania funkcji do |
73 | biblioteki GObject, tak by mogły te biblioteki kooperowaći z | |
74 | wiązaniami Pythona. | |
3955a8b7 | 75 | |
a5fba226 | 76 | %package devel |
e4d02b95 JB |
77 | Summary: Python 2 bindings for GObject library - development metapackage |
78 | Summary(pl.UTF-8): Wiązania Pythona 2 do biblioteki GObject - metapakiet programistyczny | |
a5fba226 AF |
79 | Group: Development/Languages/Python |
80 | Requires: %{name} = %{version}-%{release} | |
3955a8b7 | 81 | Requires: %{name}-common-devel = %{version}-%{release} |
41b0cda2 | 82 | Requires: glib2-devel >= 1:2.48.0 |
a5fba226 | 83 | Requires: libffi-devel >= 3.0 |
1c1e8382 | 84 | Requires: python-devel >= 1:2.7 |
a5fba226 AF |
85 | |
86 | %description devel | |
e4d02b95 JB |
87 | This metapackage gathers files required to develop GObject bindings |
88 | for Python 2. | |
a5fba226 AF |
89 | |
90 | %description devel -l pl.UTF-8 | |
e4d02b95 JB |
91 | Ten metapakiet gromadzi pliki wymagane do tworzenia wiązań biblioteki |
92 | GObject dla Pythona 2. | |
a5fba226 AF |
93 | |
94 | %package -n python3-pygobject3 | |
95 | Summary: Python 3.x bindings for GObject library | |
96 | Summary(pl.UTF-8): Wiązania Pythona 3.x do biblioteki GObject | |
97 | Group: Libraries/Python | |
41b0cda2 | 98 | Requires: glib2 >= 1:2.48.0 |
badcdbca | 99 | Requires: gobject-introspection >= 1.46.0 |
538a43f0 | 100 | Conflicts: python3-pygobject < 2.28.6-3 |
a5fba226 AF |
101 | |
102 | %description -n python3-pygobject3 | |
103 | Python 3.x bindings for GObject library. | |
104 | ||
105 | %description -n python3-pygobject3 -l pl.UTF-8 | |
106 | Wiązania Pythona 3.x do biblioteki GObject. | |
107 | ||
108 | %package -n python3-pygobject3-devel | |
e4d02b95 JB |
109 | Summary: Python 3 bindings for GObject library - development metapackage |
110 | Summary(pl.UTF-8): Wiązania Pythona 3 do biblioteki GObject - metapakiet programistyczny | |
a5fba226 | 111 | Group: Development/Languages/Python |
538a43f0 | 112 | Requires: %{name}-common-devel = %{version}-%{release} |
41b0cda2 | 113 | Requires: glib2-devel >= 1:2.48.0 |
a5fba226 | 114 | Requires: libffi-devel >= 3.0 |
1c1e8382 | 115 | Requires: python3-devel >= 1:3.5 |
97dc7172 | 116 | Requires: python3-pygobject3 = %{version}-%{release} |
a5fba226 AF |
117 | |
118 | %description -n python3-pygobject3-devel | |
e4d02b95 JB |
119 | This metapackage gathers files required to develop GObject bindings |
120 | for Python 3. | |
a5fba226 AF |
121 | |
122 | %description -n python3-pygobject3-devel -l pl.UTF-8 | |
e4d02b95 JB |
123 | Ten metapakiet gromadzi pliki wymagane do tworzenia wiązań biblioteki |
124 | GObject dla Pythona 3. | |
a5fba226 | 125 | |
1c1e8382 JB |
126 | %package apidocs |
127 | Summary: API documentation for Python GObject library | |
128 | Summary(pl.UTF-8): Dokumentacja biblioteki Pythona GObject | |
129 | Group: Documentation | |
130 | %if "%{_rpmversion}" >= "5" | |
131 | BuildArch: noarch | |
132 | %endif | |
133 | ||
134 | %description apidocs | |
135 | API documentation for Python GObject library. | |
136 | ||
137 | %description apidocs -l pl.UTF-8 | |
138 | Dokumentacja biblioteki Pythona GObject. | |
139 | ||
a5fba226 AF |
140 | %package examples |
141 | Summary: Example programs for GObject library | |
142 | Summary(pl.UTF-8): Programy przykładowe dla biblioteki GObject | |
143 | Group: Development/Languages/Python | |
144 | Requires: %{name}-devel = %{version}-%{release} | |
1c1e8382 JB |
145 | %if "%{_rpmversion}" >= "5" |
146 | BuildArch: noarch | |
147 | %endif | |
a5fba226 AF |
148 | |
149 | %description examples | |
150 | This package contains example programs for GObject library. | |
151 | ||
152 | %description examples -l pl.UTF-8 | |
153 | Ten pakiet zawiera przykładowe programy dla biblioteki GObject. | |
154 | ||
a5fba226 AF |
155 | %prep |
156 | %setup -q -n %{module}-%{version} | |
157 | ||
158 | %build | |
1c1e8382 JB |
159 | %if %{with python2} |
160 | %py_build %{?with_tests:test} | |
161 | %endif | |
162 | ||
a5fba226 | 163 | %if %{with python3} |
1c1e8382 | 164 | %py3_build %{?with_tests:test} |
a5fba226 | 165 | %endif |
1c1e8382 JB |
166 | |
167 | %if %{with doc} | |
168 | %{__make} -C docs | |
a5fba226 AF |
169 | %endif |
170 | ||
171 | %install | |
172 | rm -rf $RPM_BUILD_ROOT | |
173 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
174 | ||
a5fba226 | 175 | %if %{with python2} |
1c1e8382 | 176 | %py_install |
a5fba226 | 177 | |
e9ba7e96 | 178 | %py_postclean |
a5fba226 | 179 | %endif |
1c1e8382 | 180 | |
a5fba226 | 181 | %if %{with python3} |
1c1e8382 | 182 | %py3_install |
a5fba226 AF |
183 | %endif |
184 | ||
1c1e8382 JB |
185 | cp -a examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
186 | ||
a5fba226 AF |
187 | %clean |
188 | rm -rf $RPM_BUILD_ROOT | |
189 | ||
a5fba226 AF |
190 | %if %{with python2} |
191 | %files | |
192 | %defattr(644,root,root,755) | |
1c1e8382 | 193 | %doc NEWS README.rst |
a5fba226 | 194 | %dir %{py_sitedir}/gi |
decdeaaa ŁK |
195 | %attr(755,root,root) %{py_sitedir}/gi/_gi.so |
196 | %attr(755,root,root) %{py_sitedir}/gi/_gi_cairo.so | |
197 | %{py_sitedir}/gi/*.py[co] | |
a5fba226 AF |
198 | %dir %{py_sitedir}/gi/overrides |
199 | %{py_sitedir}/gi/overrides/*.py[co] | |
200 | %dir %{py_sitedir}/gi/repository | |
201 | %{py_sitedir}/gi/repository/*.py[co] | |
decdeaaa ŁK |
202 | %dir %{py_sitedir}/pygtkcompat |
203 | %{py_sitedir}/pygtkcompat/*.py[co] | |
1c1e8382 | 204 | %{py_sitedir}/PyGObject-%{version}-py*.egg-info |
a5fba226 | 205 | |
3955a8b7 | 206 | %files common-devel |
a5fba226 | 207 | %defattr(644,root,root,755) |
a5fba226 AF |
208 | %{_includedir}/pygobject-3.0 |
209 | %{_pkgconfigdir}/pygobject-3.0.pc | |
3955a8b7 AF |
210 | |
211 | %files devel | |
212 | %defattr(644,root,root,755) | |
a5fba226 AF |
213 | %endif |
214 | ||
215 | %if %{with python3} | |
216 | %files -n python3-pygobject3 | |
217 | %defattr(644,root,root,755) | |
1c1e8382 | 218 | %doc NEWS README.rst |
a5fba226 | 219 | %dir %{py3_sitedir}/gi |
205b0127 JB |
220 | %attr(755,root,root) %{py3_sitedir}/gi/_gi.cpython*.so |
221 | %attr(755,root,root) %{py3_sitedir}/gi/_gi_cairo.cpython*.so | |
7d22b890 | 222 | %{py3_sitedir}/gi/*.py |
decdeaaa | 223 | %{py3_sitedir}/gi/__pycache__ |
a5fba226 | 224 | %dir %{py3_sitedir}/gi/overrides |
7d22b890 | 225 | %{py3_sitedir}/gi/overrides/*.py |
decdeaaa | 226 | %{py3_sitedir}/gi/overrides/__pycache__ |
a5fba226 AF |
227 | %dir %{py3_sitedir}/gi/repository |
228 | %{py3_sitedir}/gi/repository/*.py* | |
decdeaaa | 229 | %{py3_sitedir}/gi/repository/__pycache__ |
decdeaaa | 230 | %dir %{py3_sitedir}/pygtkcompat |
7d22b890 | 231 | %{py3_sitedir}/pygtkcompat/*.py |
decdeaaa | 232 | %{py3_sitedir}/pygtkcompat/__pycache__ |
1c1e8382 | 233 | %{py3_sitedir}/PyGObject-%{version}-py*.egg-info |
a5fba226 AF |
234 | |
235 | %files -n python3-pygobject3-devel | |
236 | %defattr(644,root,root,755) | |
a5fba226 AF |
237 | %endif |
238 | ||
1c1e8382 JB |
239 | %if %{with doc} |
240 | %files apidocs | |
241 | %defattr(644,root,root,755) | |
242 | %doc docs/_build/{_images,_static,devguide,guide,*.html,*.js} | |
243 | %endif | |
244 | ||
a5fba226 AF |
245 | %files examples |
246 | %defattr(644,root,root,755) | |
247 | %{_examplesdir}/%{name}-%{version} |