]> git.pld-linux.org Git - packages/python-pygobject.git/blob - python-pygobject.spec
- release 10 (libffi 3.4.x)
[packages/python-pygobject.git] / python-pygobject.spec
1 #
2 # Conditional build:
3 %bcond_without  python2         # Python 2.x module
4 %bcond_with     python3         # Python 3.x module
5
6 %define         module  pygobject
7 Summary:        Python bindings for GObject library
8 Summary(pl.UTF-8):      Wiązania Pythona do biblioteki GObject
9 Name:           python-%{module}
10 Version:        2.28.7
11 Release:        10
12 License:        LGPL v2+
13 Group:          Libraries/Python
14 Source0:        https://download.gnome.org/sources/pygobject/2.28/%{module}-%{version}.tar.xz
15 # Source0-md5:  ae48b60c690c4aa894e69e0c97802745
16 Patch0:         %{name}-pc.patch
17 Patch1:         %{name}-pyc.patch
18 Patch2:         gio.patch
19 URL:            https://pygobject.readthedocs.io/
20 BuildRequires:  autoconf >= 2.52
21 BuildRequires:  automake >= 1:1.12.5
22 BuildRequires:  glib2-devel >= 1:2.24.0
23 BuildRequires:  gobject-introspection-devel >= 0.10.2
24 BuildRequires:  libffi-devel >= 3.0
25 BuildRequires:  libtool
26 BuildRequires:  libxslt-progs >= 1.1.22
27 BuildRequires:  pkgconfig
28 BuildRequires:  rpm-pythonprov
29 BuildRequires:  tar >= 1:1.22
30 BuildRequires:  xz
31 %if %{with python2}
32 BuildRequires:  python-devel >= 1:2.5.2
33 BuildRequires:  python-pycairo-devel >= 1.2.0
34 Requires:       python-modules
35 %endif
36 %if %{with python3}
37 BuildRequires:  python3 >= 1:3.2
38 BuildRequires:  python3-devel >= 1:3.2
39 BuildRequires:  python3-modules >= 1:3.2
40 BuildRequires:  python3-pycairo-devel >= 1.8.10
41 %endif
42 Requires:       glib2 >= 1:2.24.0
43 Requires:       gobject-introspection >= 0.9.5
44 Provides:       python-pygtk-gobject
45 Obsoletes:      python-pygtk-glarea < 1:2.2.0
46 Obsoletes:      python-pygtk-gobject < 2:2.9.0
47 Conflicts:      python-pygtk < 1:1.0
48 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
49
50 # python provides Py* and _Py* symbols at runtime
51 %define         skip_post_check_so      libpyglib-2.0-python[23]?.so.*
52
53 %description
54 Python bindings for GObject library.
55
56 %description -l pl.UTF-8
57 Wiązania Pythona do biblioteki GObject.
58
59 %package devel
60 Summary:        Python bindings for GObject library
61 Summary(pl.UTF-8):      Wiązania Pythona do biblioteki GObject
62 Group:          Development/Languages/Python
63 Requires:       %{name} = %{version}-%{release}
64 Requires:       glib2-devel >= 1:2.24.0
65 Requires:       libffi-devel >= 3.0
66 Requires:       python-devel >= 1:2.5.2
67
68 %description devel
69 This package contains files required to build wrappers for GObject
70 addon libraries so that they interoperate with Python bindings.
71
72 %description devel -l pl.UTF-8
73 Pakiet zawiera pliki wymagane do zbudowania funkcji do biblioteki
74 GObject, tak by mogły te biblioteki kooperować z wiązaniami Pythona.
75
76 %package -n python3-pygobject
77 Summary:        Python 3.x bindings for GObject library
78 Summary(pl.UTF-8):      Wiązania Pythona 3.x do biblioteki GObject
79 Group:          Libraries/Python
80
81 %description -n python3-pygobject
82 Python 3.x bindings for GObject library.
83
84 %description -n python3-pygobject -l pl.UTF-8
85 Wiązania Pythona 3.x do biblioteki GObject.
86
87 %package -n python3-pygobject-devel
88 Summary:        Python bindings for GObject library
89 Summary(pl.UTF-8):      Wiązania Pythona do biblioteki GObject
90 Group:          Development/Languages/Python
91 Requires:       glib2-devel >= 1:2.24.0
92 Requires:       libffi-devel >= 3.0
93 Requires:       python3-devel >= 1:3.2
94 Requires:       python3-pygobject = %{version}-%{release}
95
96 %description -n python3-pygobject-devel
97 This package contains files required to build wrappers for GObject
98 addon libraries so that they interoperate with Python bindings.
99
100 %description -n python3-pygobject-devel -l pl.UTF-8
101 Pakiet zawiera pliki wymagane do zbudowania funkcji do biblioteki
102 GObject, tak by mogły te biblioteki kooperować z wiązaniami Pythona.
103
104 %package examples
105 Summary:        Example programs for GObject library
106 Summary(pl.UTF-8):      Programy przykładowe dla biblioteki GObject
107 Group:          Development/Languages/Python
108 Requires:       %{name}-devel = %{version}-%{release}
109
110 %description examples
111 This package contains example programs for GObject library.
112
113 %description examples -l pl.UTF-8
114 Ten pakiet zawiera przykładowe programy dla biblioteki GObject.
115
116 %package apidocs
117 Summary:        pygobject API documentation
118 Summary(pl.UTF-8):      Dokumentacja API pygobject
119 Group:          Documentation
120 Requires:       gtk-doc-common
121 BuildArch:      noarch
122
123 %description apidocs
124 pygobject API documentation.
125
126 %description apidocs -l pl.UTF-8
127 Dokumentacja API pygobject.
128
129 %prep
130 %setup -q -n %{module}-%{version}
131 %patch0 -p1
132 %patch1 -p1
133 %patch2 -p1
134
135 %build
136 %{__libtoolize}
137 %{__aclocal} -I m4
138 %{__autoconf}
139 %{__autoheader}
140 %{__automake}
141 %if %{with python3}
142 mkdir py3
143 cd py3
144 ../%configure \
145         PYTHON=/usr/bin/python3 \
146         --disable-introspection \
147         --disable-silent-rules
148 %{__make}
149 cd ..
150 %endif
151 %if %{with python2}
152 mkdir py2
153 cd py2
154 ../%configure \
155         PYTHON=%{__python} \
156         --disable-introspection \
157         --disable-silent-rules
158 %{__make}
159 cd ..
160 %endif
161
162 %install
163 rm -rf $RPM_BUILD_ROOT
164 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
165
166 %if %{with python3}
167 %{__make} -C py3 -j 1 install \
168         DESTDIR=$RPM_BUILD_ROOT \
169         TARGET_DIR=%{_gtkdocdir}/%{module}
170 %endif
171
172 %if %{with python2}
173 %{__make} -C py2 -j 1 install \
174         DESTDIR=$RPM_BUILD_ROOT \
175         TARGET_DIR=%{_gtkdocdir}/%{module}
176 %endif
177
178 cp -a examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
179
180 %{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+python(\s|$),#!%{__python}\1,' \
181         $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/*.py
182
183 %{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la
184
185 %if %{with python2}
186 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/{gtk-2.0/,}*/*.la
187 %py_comp $RPM_BUILD_ROOT%{_datadir}/%{module}/2.0/codegen
188 %py_ocomp $RPM_BUILD_ROOT%{_datadir}/%{module}/2.0/codegen
189 %py_postclean %{_datadir}/%{module}/2.0/codegen
190 %endif
191 %if %{with python3}
192 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/*/*.la
193 %endif
194
195 %clean
196 rm -rf $RPM_BUILD_ROOT
197
198 %post   -p /sbin/ldconfig
199 %postun -p /sbin/ldconfig
200
201 %if %{with python2}
202 %files
203 %defattr(644,root,root,755)
204 %doc AUTHORS ChangeLog NEWS README
205 %attr(755,root,root) %{_libdir}/libpyglib-2.0-python2.so.*.*.*
206 %attr(755,root,root) %ghost %{_libdir}/libpyglib-2.0-python2.so.0
207 %dir %{py_sitedir}/gtk-2.0
208 %dir %{py_sitedir}/gtk-2.0/gio
209 %attr(755,root,root) %{py_sitedir}/gtk-2.0/gio/_gio.so
210 %attr(755,root,root) %{py_sitedir}/gtk-2.0/gio/unix.so
211 %{py_sitedir}/gtk-2.0/gio/*.py[co]
212 %dir %{py_sitedir}/glib
213 %attr(755,root,root) %{py_sitedir}/glib/_glib.so
214 %{py_sitedir}/glib/*.py[co]
215 %dir %{py_sitedir}/gobject
216 %attr(755,root,root) %{py_sitedir}/gobject/_gobject.so
217 %{py_sitedir}/gobject/*.py[co]
218 %{py_sitedir}/gtk-2.0/*.py[co]
219 %{py_sitedir}/pygtk.py[co]
220 %{py_sitedir}/pygtk.pth
221 %dir %{_datadir}/%{module}
222 %dir %{_datadir}/%{module}/xsl
223
224 %files devel
225 %defattr(644,root,root,755)
226 %attr(755,root,root) %{_bindir}/pygobject-codegen-2.0
227 %attr(755,root,root) %{_libdir}/libpyglib-2.0-python2.so
228 %{_includedir}/pygtk-2.0
229 %{_pkgconfigdir}/pygobject-2.0.pc
230 %dir %{_datadir}/%{module}/2.0
231 %dir %{_datadir}/%{module}/2.0/codegen
232 %{_datadir}/%{module}/2.0/codegen/*.py[co]
233 %dir %{_datadir}/%{module}/2.0/defs
234 %{_datadir}/%{module}/2.0/defs/*.defs
235 %{_datadir}/%{module}/2.0/defs/*.override
236 %{_datadir}/%{module}/xsl/*.py
237 %{_datadir}/%{module}/xsl/*.xsl
238 %endif
239
240 %if %{with python3}
241 %files -n python3-pygobject
242 %defattr(644,root,root,755)
243 %doc AUTHORS ChangeLog NEWS README
244 %attr(755,root,root) %{_libdir}/libpyglib-2.0-python3.so.*.*.*
245 %attr(755,root,root) %ghost %{_libdir}/libpyglib-2.0-python3.so.0
246 %dir %{py3_sitedir}/gtk-2.0
247 %dir %{py3_sitedir}/gtk-2.0/gio
248 %{py3_sitedir}/gtk-2.0/gio/*.py
249 %{py3_sitedir}/gtk-2.0/gio/__pycache__
250 %dir %{py3_sitedir}/glib
251 %attr(755,root,root) %{py3_sitedir}/glib/_glib.*so
252 %{py3_sitedir}/glib/*.py
253 %{py3_sitedir}/glib/__pycache__
254 %dir %{py3_sitedir}/gobject
255 %attr(755,root,root) %{py3_sitedir}/gobject/_gobject.*so
256 %{py3_sitedir}/gobject/*.py
257 %{py3_sitedir}/gobject/__pycache__
258 %{py3_sitedir}/gtk-2.0/*.py
259 %{py3_sitedir}/gtk-2.0/__pycache__
260 %{py3_sitedir}/pygtk.py
261 %{py3_sitedir}/pygtk.pth
262 %{py3_sitedir}/__pycache__
263
264 %files -n python3-pygobject-devel
265 %defattr(644,root,root,755)
266 %attr(755,root,root) %{_libdir}/libpyglib-2.0-python3.so
267 %endif
268
269 %files examples
270 %defattr(644,root,root,755)
271 %{_examplesdir}/%{name}-%{version}
272
273 %files apidocs
274 %defattr(644,root,root,755)
275 %{_gtkdocdir}/%{module}
This page took 0.075638 seconds and 3 git commands to generate.