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