]>
Commit | Line | Data |
---|---|---|
0a584574 | 1 | # |
7a5831db JB |
2 | # Conditional build: |
3 | %bcond_without python2 # Python 2.x module | |
d6a24715 | 4 | %bcond_with python3 # Python 3.x module |
47361db5 | 5 | |
0a584574 | 6 | %define module pygobject |
0a584574 | 7 | Summary: Python bindings for GObject library |
2cdd04b8 | 8 | Summary(pl.UTF-8): Wiązania Pythona do biblioteki GObject |
0a584574 | 9 | Name: python-%{module} |
5bec3d5a | 10 | Version: 2.28.7 |
8bd6e7fe | 11 | Release: 8 |
e4e2e839 | 12 | License: LGPL v2+ |
0a584574 | 13 | Group: Libraries/Python |
5a0f1c33 | 14 | Source0: http://ftp.gnome.org/pub/GNOME/sources/pygobject/2.28/%{module}-%{version}.tar.xz |
5bec3d5a | 15 | # Source0-md5: ae48b60c690c4aa894e69e0c97802745 |
21a966bd | 16 | Patch0: %{name}-pc.patch |
b02ddf04 | 17 | Patch1: %{name}-pyc.patch |
ba5bf5ff | 18 | Patch2: gio.patch |
0a584574 | 19 | URL: http://www.pygtk.org/ |
20 | BuildRequires: autoconf >= 2.52 | |
0ce6e377 | 21 | BuildRequires: automake >= 1:1.12.5 |
5a0f1c33 | 22 | BuildRequires: glib2-devel >= 1:2.24.0 |
c79d4059 | 23 | BuildRequires: gobject-introspection-devel >= 0.10.2 |
63b9ab8d | 24 | BuildRequires: libffi-devel >= 3.0 |
0a584574 | 25 | BuildRequires: libtool |
e4e2e839 | 26 | BuildRequires: libxslt-progs >= 1.1.22 |
c92dc8c2 | 27 | BuildRequires: pkgconfig |
a1521d85 | 28 | BuildRequires: rpm-pythonprov |
5a0f1c33 JB |
29 | BuildRequires: tar >= 1:1.22 |
30 | BuildRequires: xz | |
a1521d85 | 31 | %if %{with python2} |
a79efc8f | 32 | BuildRequires: python-devel >= 1:2.5.2 |
5a0f1c33 | 33 | BuildRequires: python-pycairo-devel >= 1.2.0 |
47361db5 | 34 | Requires: python-modules |
a1521d85 AF |
35 | %endif |
36 | %if %{with python3} | |
37 | BuildRequires: python3 | |
38 | BuildRequires: python3-devel | |
39 | BuildRequires: python3-modules | |
c79d4059 | 40 | BuildRequires: python3-pycairo-devel >= 1.8.10 |
a1521d85 | 41 | %endif |
5a0f1c33 | 42 | Requires: glib2 >= 1:2.24.0 |
80fcd2e7 | 43 | Requires: gobject-introspection >= 0.9.5 |
d0769ffd | 44 | Provides: python-pygtk-gobject |
0a584574 | 45 | Obsoletes: python-pygtk-glarea |
46 | Obsoletes: python-pygtk-gobject | |
b02ddf04 | 47 | Conflicts: python-pygtk < 1:1.0 |
0a584574 | 48 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
49 | ||
eee09ad7 | 50 | # python provides Py* and _Py* symbols at runtime |
e68a1bdc | 51 | %define skip_post_check_so libpyglib-2.0-python[23]?.so.* |
e3c2e3f2 | 52 | |
0a584574 | 53 | %description |
54 | Python bindings for GObject library. | |
55 | ||
1e5a13f0 JR |
56 | %description -l pl.UTF-8 |
57 | Wiązania Pythona do biblioteki GObject. | |
0a584574 | 58 | |
59 | %package devel | |
60 | Summary: Python bindings for GObject library | |
2cdd04b8 | 61 | Summary(pl.UTF-8): Wiązania Pythona do biblioteki GObject |
0a584574 | 62 | Group: Development/Languages/Python |
63 | Requires: %{name} = %{version}-%{release} | |
5a0f1c33 | 64 | Requires: glib2-devel >= 1:2.24.0 |
63b9ab8d | 65 | Requires: libffi-devel >= 3.0 |
a79efc8f | 66 | Requires: python-devel >= 1:2.5.2 |
0a584574 | 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 | ||
1e5a13f0 | 72 | %description devel -l pl.UTF-8 |
0a584574 | 73 | Pakiet zawiera pliki wymagane do zbudowania funkcji do biblioteki |
1e5a13f0 | 74 | GObject, tak by mogły te biblioteki kooperować z wiązaniami Pythona. |
0a584574 | 75 | |
ba5bf5ff AF |
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 | ||
ea043c53 | 84 | %description -n python3-pygobject -l pl.UTF-8 |
ba5bf5ff AF |
85 | Wiązania Pythona 3.x do biblioteki GObject. |
86 | ||
c79d4059 | 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 | |
5a0f1c33 | 91 | Requires: glib2-devel >= 1:2.24.0 |
c79d4059 | 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 | ||
0a584574 | 104 | %package examples |
105 | Summary: Example programs for GObject library | |
2cdd04b8 | 106 | Summary(pl.UTF-8): Programy przykładowe dla biblioteki GObject |
0a584574 | 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 | ||
1e5a13f0 JR |
114 | %description examples -l pl.UTF-8 |
115 | Ten pakiet zawiera przykładowe programy dla biblioteki GObject. | |
0a584574 | 116 | |
e591eb27 | 117 | %package apidocs |
118 | Summary: pygobject API documentation | |
2cdd04b8 | 119 | Summary(pl.UTF-8): Dokumentacja API pygobject |
e591eb27 | 120 | Group: Documentation |
121 | Requires: gtk-doc-common | |
47361db5 | 122 | BuildArch: noarch |
e591eb27 | 123 | |
124 | %description apidocs | |
125 | pygobject API documentation. | |
126 | ||
1e5a13f0 | 127 | %description apidocs -l pl.UTF-8 |
e591eb27 | 128 | Dokumentacja API pygobject. |
129 | ||
0a584574 | 130 | %prep |
131 | %setup -q -n %{module}-%{version} | |
21a966bd | 132 | %patch0 -p1 |
b02ddf04 | 133 | %patch1 -p1 |
ba5bf5ff | 134 | %patch2 -p1 |
0a584574 | 135 | |
0a584574 | 136 | %build |
137 | %{__libtoolize} | |
138 | %{__aclocal} -I m4 | |
139 | %{__autoconf} | |
140 | %{__autoheader} | |
141 | %{__automake} | |
a1521d85 | 142 | %if %{with python3} |
ba5bf5ff AF |
143 | mkdir py3 |
144 | cd py3 | |
145 | ../%configure \ | |
146 | PYTHON=/usr/bin/python3 \ | |
cb2f161e | 147 | --disable-introspection \ |
ba5bf5ff | 148 | --disable-silent-rules |
a1521d85 | 149 | %{__make} |
ba5bf5ff | 150 | cd .. |
a1521d85 AF |
151 | %endif |
152 | %if %{with python2} | |
ba5bf5ff AF |
153 | mkdir py2 |
154 | cd py2 | |
155 | ../%configure \ | |
156 | PYTHON=%{__python} \ | |
cb2f161e | 157 | --disable-introspection \ |
a79efc8f | 158 | --disable-silent-rules |
a1521d85 | 159 | %{__make} |
ba5bf5ff | 160 | cd .. |
a1521d85 | 161 | %endif |
0a584574 | 162 | |
163 | %install | |
164 | rm -rf $RPM_BUILD_ROOT | |
b02ddf04 | 165 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
0a584574 | 166 | |
a1521d85 | 167 | %if %{with python3} |
7a5831db | 168 | %{__make} -C py3 -j 1 install \ |
133c66a8 | 169 | DESTDIR=$RPM_BUILD_ROOT \ |
e4e2e839 | 170 | TARGET_DIR=%{_gtkdocdir}/%{module} |
a1521d85 | 171 | %endif |
0ce6e377 | 172 | |
a1521d85 | 173 | %if %{with python2} |
7a5831db | 174 | %{__make} -C py2 -j 1 install \ |
ba5bf5ff AF |
175 | DESTDIR=$RPM_BUILD_ROOT \ |
176 | TARGET_DIR=%{_gtkdocdir}/%{module} | |
a1521d85 | 177 | %endif |
0a584574 | 178 | |
b02ddf04 | 179 | cp -a examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
c8cce660 | 180 | |
058710b2 JR |
181 | %{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+python(\s|$),#!%{__python}\1,' \ |
182 | $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/*.py | |
183 | ||
7badeb3a | 184 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la |
b02ddf04 | 185 | |
a1521d85 | 186 | %if %{with python2} |
7badeb3a | 187 | %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/{gtk-2.0/,}*/*.la |
7c4a7622 AF |
188 | %py_comp $RPM_BUILD_ROOT%{_datadir}/%{module}/2.0/codegen |
189 | %py_ocomp $RPM_BUILD_ROOT%{_datadir}/%{module}/2.0/codegen | |
b02ddf04 | 190 | %py_postclean %{_datadir}/%{module}/2.0/codegen |
a1521d85 AF |
191 | %endif |
192 | %if %{with python3} | |
7badeb3a | 193 | %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/*/*.la |
a1521d85 | 194 | %endif |
0a584574 | 195 | |
196 | %clean | |
197 | rm -rf $RPM_BUILD_ROOT | |
198 | ||
2e6dab46 | 199 | %post -p /sbin/ldconfig |
200 | %postun -p /sbin/ldconfig | |
201 | ||
a1521d85 | 202 | %if %{with python2} |
0a584574 | 203 | %files |
204 | %defattr(644,root,root,755) | |
205 | %doc AUTHORS ChangeLog NEWS README | |
0ce6e377 JB |
206 | %attr(755,root,root) %{_libdir}/libpyglib-2.0-python2.so.*.*.* |
207 | %attr(755,root,root) %ghost %{_libdir}/libpyglib-2.0-python2.so.0 | |
0a584574 | 208 | %dir %{py_sitedir}/gtk-2.0 |
2e6dab46 | 209 | %dir %{py_sitedir}/gtk-2.0/gio |
b02ddf04 MB |
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 | |
2e6dab46 | 212 | %{py_sitedir}/gtk-2.0/gio/*.py[co] |
c79d4059 | 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] | |
0a584574 | 219 | %{py_sitedir}/gtk-2.0/*.py[co] |
a79efc8f | 220 | %{py_sitedir}/pygtk.py[co] |
0a584574 | 221 | %{py_sitedir}/pygtk.pth |
67b4ad40 | 222 | %dir %{_datadir}/%{module} |
223 | %dir %{_datadir}/%{module}/xsl | |
0a584574 | 224 | |
225 | %files devel | |
226 | %defattr(644,root,root,755) | |
b02ddf04 | 227 | %attr(755,root,root) %{_bindir}/pygobject-codegen-2.0 |
0ce6e377 | 228 | %attr(755,root,root) %{_libdir}/libpyglib-2.0-python2.so |
0a584574 | 229 | %{_includedir}/pygtk-2.0 |
a79efc8f | 230 | %{_pkgconfigdir}/pygobject-2.0.pc |
b02ddf04 MB |
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 | |
eed9edcf | 237 | %{_datadir}/%{module}/xsl/*.py |
67b4ad40 | 238 | %{_datadir}/%{module}/xsl/*.xsl |
a1521d85 | 239 | %endif |
0a584574 | 240 | |
a1521d85 | 241 | %if %{with python3} |
ba5bf5ff AF |
242 | %files -n python3-pygobject |
243 | %defattr(644,root,root,755) | |
244 | %doc AUTHORS ChangeLog NEWS README | |
0ce6e377 JB |
245 | %attr(755,root,root) %{_libdir}/libpyglib-2.0-python3.so.*.*.* |
246 | %attr(755,root,root) %ghost %{_libdir}/libpyglib-2.0-python3.so.0 | |
ba5bf5ff AF |
247 | %dir %{py3_sitedir}/gtk-2.0 |
248 | %dir %{py3_sitedir}/gtk-2.0/gio | |
0ce6e377 JB |
249 | %{py3_sitedir}/gtk-2.0/gio/*.py |
250 | %{py3_sitedir}/gtk-2.0/gio/__pycache__ | |
c79d4059 | 251 | %dir %{py3_sitedir}/glib |
7e8fbfd7 | 252 | %attr(755,root,root) %{py3_sitedir}/glib/_glib.*so |
0ce6e377 JB |
253 | %{py3_sitedir}/glib/*.py |
254 | %{py3_sitedir}/glib/__pycache__ | |
c79d4059 | 255 | %dir %{py3_sitedir}/gobject |
7e8fbfd7 | 256 | %attr(755,root,root) %{py3_sitedir}/gobject/_gobject.*so |
0ce6e377 JB |
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 | |
ba5bf5ff | 262 | %{py3_sitedir}/pygtk.pth |
0ce6e377 | 263 | %{py3_sitedir}/__pycache__ |
c79d4059 | 264 | |
265 | %files -n python3-pygobject-devel | |
266 | %defattr(644,root,root,755) | |
0ce6e377 | 267 | %attr(755,root,root) %{_libdir}/libpyglib-2.0-python3.so |
a1521d85 | 268 | %endif |
c79d4059 | 269 | |
0a584574 | 270 | %files examples |
271 | %defattr(644,root,root,755) | |
272 | %{_examplesdir}/%{name}-%{version} | |
e591eb27 | 273 | |
274 | %files apidocs | |
275 | %defattr(644,root,root,755) | |
19e038b8 | 276 | %{_gtkdocdir}/%{module} |