]> git.pld-linux.org Git - packages/python-pygobject.git/blob - python-pygobject.spec
3e5e6f7b4553716f9d4e8c80b22b69ca9f6a7ec2
[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:        5
12 License:        LGPL v2+
13 Group:          Libraries/Python
14 Source0:        http://ftp.gnome.org/pub/GNOME/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:            http://www.pygtk.org/
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
38 BuildRequires:  python3-devel
39 BuildRequires:  python3-modules
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
46 Obsoletes:      python-pygtk-gobject
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
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 Obsoletes:      python-pygtk
110
111 %description examples
112 This package contains example programs for GObject library.
113
114 %description examples -l pl.UTF-8
115 Ten pakiet zawiera przykładowe programy dla biblioteki GObject.
116
117 %package apidocs
118 Summary:        pygobject API documentation
119 Summary(pl.UTF-8):      Dokumentacja API pygobject
120 Group:          Documentation
121 Requires:       gtk-doc-common
122 BuildArch:      noarch
123
124 %description apidocs
125 pygobject API documentation.
126
127 %description apidocs -l pl.UTF-8
128 Dokumentacja API pygobject.
129
130 %prep
131 %setup -q -n %{module}-%{version}
132 %patch0 -p1
133 %patch1 -p1
134 %patch2 -p1
135
136 %build
137 %{__libtoolize}
138 %{__aclocal} -I m4
139 %{__autoconf}
140 %{__autoheader}
141 %{__automake}
142 %if %{with python3}
143 mkdir py3
144 cd py3
145 ../%configure \
146         PYTHON=/usr/bin/python3 \
147         --disable-introspection \
148         --disable-silent-rules
149 %{__make}
150 cd ..
151 %endif
152 %if %{with python2}
153 mkdir py2
154 cd py2
155 ../%configure \
156         PYTHON=%{__python} \
157         --disable-introspection \
158         --disable-silent-rules
159 %{__make}
160 cd ..
161 %endif
162
163 %install
164 rm -rf $RPM_BUILD_ROOT
165 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
166
167 %if %{with python3}
168 %{__make} -C py3 -j 1 install \
169         DESTDIR=$RPM_BUILD_ROOT \
170         TARGET_DIR=%{_gtkdocdir}/%{module}
171 %endif
172
173 %if %{with python2}
174 %{__make} -C py2 -j 1 install \
175         DESTDIR=$RPM_BUILD_ROOT \
176         TARGET_DIR=%{_gtkdocdir}/%{module}
177 %endif
178
179 cp -a examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
180
181 %{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+python(\s|$),#!%{__python}\1,' \
182         $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/*.py
183
184 %{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la
185
186 %if %{with python2}
187 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/{gtk-2.0/,}*/*.la
188 %py_comp $RPM_BUILD_ROOT%{_datadir}/%{module}/2.0/codegen
189 %py_ocomp $RPM_BUILD_ROOT%{_datadir}/%{module}/2.0/codegen
190 %py_postclean %{_datadir}/%{module}/2.0/codegen
191 %endif
192 %if %{with python3}
193 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/*/*.la
194 %endif
195
196 %clean
197 rm -rf $RPM_BUILD_ROOT
198
199 %post   -p /sbin/ldconfig
200 %postun -p /sbin/ldconfig
201
202 %if %{with python2}
203 %files
204 %defattr(644,root,root,755)
205 %doc AUTHORS ChangeLog NEWS README
206 %attr(755,root,root) %{_libdir}/libpyglib-2.0-python2.so.*.*.*
207 %attr(755,root,root) %ghost %{_libdir}/libpyglib-2.0-python2.so.0
208 %dir %{py_sitedir}/gtk-2.0
209 %dir %{py_sitedir}/gtk-2.0/gio
210 %attr(755,root,root) %{py_sitedir}/gtk-2.0/gio/_gio.so
211 %attr(755,root,root) %{py_sitedir}/gtk-2.0/gio/unix.so
212 %{py_sitedir}/gtk-2.0/gio/*.py[co]
213 %dir %{py_sitedir}/glib
214 %attr(755,root,root) %{py_sitedir}/glib/_glib.so
215 %{py_sitedir}/glib/*.py[co]
216 %dir %{py_sitedir}/gobject
217 %attr(755,root,root) %{py_sitedir}/gobject/_gobject.so
218 %{py_sitedir}/gobject/*.py[co]
219 %{py_sitedir}/gtk-2.0/*.py[co]
220 %{py_sitedir}/pygtk.py[co]
221 %{py_sitedir}/pygtk.pth
222 %dir %{_datadir}/%{module}
223 %dir %{_datadir}/%{module}/xsl
224
225 %files devel
226 %defattr(644,root,root,755)
227 %attr(755,root,root) %{_bindir}/pygobject-codegen-2.0
228 %attr(755,root,root) %{_libdir}/libpyglib-2.0-python2.so
229 %{_includedir}/pygtk-2.0
230 %{_pkgconfigdir}/pygobject-2.0.pc
231 %dir %{_datadir}/%{module}/2.0
232 %dir %{_datadir}/%{module}/2.0/codegen
233 %{_datadir}/%{module}/2.0/codegen/*.py[co]
234 %dir %{_datadir}/%{module}/2.0/defs
235 %{_datadir}/%{module}/2.0/defs/*.defs
236 %{_datadir}/%{module}/2.0/defs/*.override
237 %{_datadir}/%{module}/xsl/*.py
238 %{_datadir}/%{module}/xsl/*.xsl
239 %endif
240
241 %if %{with python3}
242 %files -n python3-pygobject
243 %defattr(644,root,root,755)
244 %doc AUTHORS ChangeLog NEWS README
245 %attr(755,root,root) %{_libdir}/libpyglib-2.0-python3.so.*.*.*
246 %attr(755,root,root) %ghost %{_libdir}/libpyglib-2.0-python3.so.0
247 %dir %{py3_sitedir}/gtk-2.0
248 %dir %{py3_sitedir}/gtk-2.0/gio
249 %{py3_sitedir}/gtk-2.0/gio/*.py
250 %{py3_sitedir}/gtk-2.0/gio/__pycache__
251 %dir %{py3_sitedir}/glib
252 %attr(755,root,root) %{py3_sitedir}/glib/_glib.*so
253 %{py3_sitedir}/glib/*.py
254 %{py3_sitedir}/glib/__pycache__
255 %dir %{py3_sitedir}/gobject
256 %attr(755,root,root) %{py3_sitedir}/gobject/_gobject.*so
257 %{py3_sitedir}/gobject/*.py
258 %{py3_sitedir}/gobject/__pycache__
259 %{py3_sitedir}/gtk-2.0/*.py
260 %{py3_sitedir}/gtk-2.0/__pycache__
261 %{py3_sitedir}/pygtk.py
262 %{py3_sitedir}/pygtk.pth
263 %{py3_sitedir}/__pycache__
264
265 %files -n python3-pygobject-devel
266 %defattr(644,root,root,755)
267 %attr(755,root,root) %{_libdir}/libpyglib-2.0-python3.so
268 %endif
269
270 %files examples
271 %defattr(644,root,root,755)
272 %{_examplesdir}/%{name}-%{version}
273
274 %files apidocs
275 %defattr(644,root,root,755)
276 %{_gtkdocdir}/%{module}
This page took 0.090174 seconds and 2 git commands to generate.