26b6b697f9dd8d9f9bc4a92c3e65d607604a1b46
[packages/python-pygobject.git] / python-pygobject.spec
1 #
2 # Conditional build:
3 %bcond_without  python2         # Python 2.x module
4 %bcond_without  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:        1
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 %if "%{_rpmversion}" >= "5"
123 BuildArch:      noarch
124 %endif
125
126 %description apidocs
127 pygobject API documentation.
128
129 %description apidocs -l pl.UTF-8
130 Dokumentacja API pygobject.
131
132 %prep
133 %setup -q -n %{module}-%{version}
134 %patch0 -p1
135 %patch1 -p1
136 %patch2 -p1
137
138 %build
139 %{__libtoolize}
140 %{__aclocal} -I m4
141 %{__autoconf}
142 %{__autoheader}
143 %{__automake}
144 %if %{with python3}
145 mkdir py3
146 cd py3
147 ../%configure \
148         PYTHON=/usr/bin/python3 \
149         --disable-introspection \
150         --disable-silent-rules
151 %{__make}
152 cd ..
153 %endif
154 %if %{with python2}
155 mkdir py2
156 cd py2
157 ../%configure \
158         PYTHON=%{__python} \
159         --disable-introspection \
160         --disable-silent-rules
161 %{__make}
162 cd ..
163 %endif
164
165 %install
166 rm -rf $RPM_BUILD_ROOT
167 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
168
169 %if %{with python3}
170 %{__make} -C py3 -j 1 install \
171         DESTDIR=$RPM_BUILD_ROOT \
172         TARGET_DIR=%{_gtkdocdir}/%{module}
173 %endif
174
175 %if %{with python2}
176 %{__make} -C py2 -j 1 install \
177         DESTDIR=$RPM_BUILD_ROOT \
178         TARGET_DIR=%{_gtkdocdir}/%{module}
179 %endif
180
181 cp -a examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
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-python.so.*.*.*
206 %attr(755,root,root) %ghost %{_libdir}/libpyglib-2.0-python.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-python.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}