]>
Commit | Line | Data |
---|---|---|
a5fba226 AF |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # Python 2.x module | |
4 | %bcond_without python3 # Python 3.x module | |
63e1dd2b | 5 | |
a5fba226 | 6 | %define module pygobject |
a5fba226 AF |
7 | Summary: Python bindings for GObject library |
8 | Summary(pl.UTF-8): Wiązania Pythona do biblioteki GObject | |
7d22b890 | 9 | Name: python-pygobject3 |
7d295c36 | 10 | Version: 3.12.1 |
26d401ad | 11 | Release: 1 |
a5fba226 AF |
12 | License: LGPL v2+ |
13 | Group: Libraries/Python | |
e4d02b95 | 14 | Source0: http://ftp.gnome.org/pub/GNOME/sources/pygobject/3.12/%{module}-%{version}.tar.xz |
7d295c36 | 15 | # Source0-md5: 8608682f221feaac81adb3f4e40dbef3 |
f6b2e85a | 16 | Patch0: link.patch |
7d22b890 | 17 | URL: https://live.gnome.org/PyGObject |
decdeaaa ŁK |
18 | BuildRequires: autoconf >= 2.68 |
19 | BuildRequires: automake >= 1:1.11.1 | |
7d22b890 | 20 | %{?with_python3:BuildRequires: automake >= 1:1.13} |
590b40c5 | 21 | BuildRequires: cairo-gobject-devel |
e4d02b95 | 22 | BuildRequires: glib2-devel >= 1:2.38.0 |
e1e13d0e | 23 | BuildRequires: gnome-common >= 3.10 |
e4d02b95 | 24 | BuildRequires: gobject-introspection-devel >= 1.38.0 |
a5fba226 | 25 | BuildRequires: libffi-devel >= 3.0 |
7d22b890 | 26 | BuildRequires: libtool >= 2:2.2.6 |
a5fba226 | 27 | BuildRequires: pkgconfig |
81604870 | 28 | BuildRequires: pkgconfig(libffi) >= 3.0 |
a5fba226 AF |
29 | BuildRequires: rpm-pythonprov |
30 | BuildRequires: tar >= 1:1.22 | |
31 | BuildRequires: xz | |
32 | %if %{with python2} | |
205b0127 | 33 | BuildRequires: python-devel >= 1:2.7 |
a5fba226 | 34 | BuildRequires: python-pycairo-devel >= 1.2.0 |
205b0127 | 35 | Requires: python-modules >= 1:2.7 |
a5fba226 AF |
36 | %endif |
37 | %if %{with python3} | |
f6b2e85a AF |
38 | BuildRequires: python3 >= 3.2.2-3 |
39 | BuildRequires: python3-devel >= 3.2.2-3 | |
40 | BuildRequires: python3-modules >= 3.2.2-3 | |
3955a8b7 | 41 | BuildRequires: python3-pycairo-devel >= 1.10.0 |
a5fba226 | 42 | %endif |
e4d02b95 JB |
43 | Requires: glib2 >= 1:2.38.0 |
44 | Requires: gobject-introspection >= 1.38.0 | |
23ea25eb | 45 | Conflicts: python-pygobject < 2.28.6-3 |
a5fba226 AF |
46 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
47 | ||
a5fba226 AF |
48 | %description |
49 | Python bindings for GObject library. | |
50 | ||
51 | %description -l pl.UTF-8 | |
52 | Wiązania Pythona do biblioteki GObject. | |
53 | ||
3955a8b7 AF |
54 | %package common-devel |
55 | Summary: Python bindings for GObject library | |
56 | Summary(pl.UTF-8): Wiązania Pythona do biblioteki GObject | |
57 | Group: Development/Languages/Python | |
58 | Requires: %{name} = %{version}-%{release} | |
e4d02b95 | 59 | Requires: glib2-devel >= 1:2.38.0 |
3955a8b7 AF |
60 | Requires: libffi-devel >= 3.0 |
61 | ||
d1050d12 | 62 | %description common-devel |
538a43f0 ŁK |
63 | This package contains headers files required to build wrappers for |
64 | GObject addon libraries so that they interoperate with Python | |
3955a8b7 AF |
65 | bindings. |
66 | ||
d1050d12 | 67 | %description common-devel -l pl.UTF-8 |
538a43f0 ŁK |
68 | Pakiet zawiera pliki nagłówkowe wymagane do zbudowania funkcji do |
69 | biblioteki GObject, tak by mogły te biblioteki kooperowaći z | |
70 | wiązaniami Pythona. | |
3955a8b7 | 71 | |
a5fba226 | 72 | %package devel |
e4d02b95 JB |
73 | Summary: Python 2 bindings for GObject library - development metapackage |
74 | Summary(pl.UTF-8): Wiązania Pythona 2 do biblioteki GObject - metapakiet programistyczny | |
a5fba226 AF |
75 | Group: Development/Languages/Python |
76 | Requires: %{name} = %{version}-%{release} | |
3955a8b7 | 77 | Requires: %{name}-common-devel = %{version}-%{release} |
e4d02b95 | 78 | Requires: glib2-devel >= 1:2.38.0 |
a5fba226 | 79 | Requires: libffi-devel >= 3.0 |
bebf1ce0 | 80 | Requires: python-devel >= 1:2.6 |
a5fba226 AF |
81 | |
82 | %description devel | |
e4d02b95 JB |
83 | This metapackage gathers files required to develop GObject bindings |
84 | for Python 2. | |
a5fba226 AF |
85 | |
86 | %description devel -l pl.UTF-8 | |
e4d02b95 JB |
87 | Ten metapakiet gromadzi pliki wymagane do tworzenia wiązań biblioteki |
88 | GObject dla Pythona 2. | |
a5fba226 AF |
89 | |
90 | %package -n python3-pygobject3 | |
91 | Summary: Python 3.x bindings for GObject library | |
92 | Summary(pl.UTF-8): Wiązania Pythona 3.x do biblioteki GObject | |
93 | Group: Libraries/Python | |
e4d02b95 JB |
94 | Requires: glib2 >= 1:2.38.0 |
95 | Requires: gobject-introspection >= 1.38.0 | |
538a43f0 | 96 | Conflicts: python3-pygobject < 2.28.6-3 |
a5fba226 AF |
97 | |
98 | %description -n python3-pygobject3 | |
99 | Python 3.x bindings for GObject library. | |
100 | ||
101 | %description -n python3-pygobject3 -l pl.UTF-8 | |
102 | Wiązania Pythona 3.x do biblioteki GObject. | |
103 | ||
104 | %package -n python3-pygobject3-devel | |
e4d02b95 JB |
105 | Summary: Python 3 bindings for GObject library - development metapackage |
106 | Summary(pl.UTF-8): Wiązania Pythona 3 do biblioteki GObject - metapakiet programistyczny | |
a5fba226 | 107 | Group: Development/Languages/Python |
538a43f0 | 108 | Requires: %{name}-common-devel = %{version}-%{release} |
e4d02b95 | 109 | Requires: glib2-devel >= 1:2.38.0 |
a5fba226 | 110 | Requires: libffi-devel >= 3.0 |
decdeaaa | 111 | Requires: python3-devel >= 3.2 |
97dc7172 | 112 | Requires: python3-pygobject3 = %{version}-%{release} |
a5fba226 AF |
113 | |
114 | %description -n python3-pygobject3-devel | |
e4d02b95 JB |
115 | This metapackage gathers files required to develop GObject bindings |
116 | for Python 3. | |
a5fba226 AF |
117 | |
118 | %description -n python3-pygobject3-devel -l pl.UTF-8 | |
e4d02b95 JB |
119 | Ten metapakiet gromadzi pliki wymagane do tworzenia wiązań biblioteki |
120 | GObject dla Pythona 3. | |
a5fba226 AF |
121 | |
122 | %package examples | |
123 | Summary: Example programs for GObject library | |
124 | Summary(pl.UTF-8): Programy przykładowe dla biblioteki GObject | |
125 | Group: Development/Languages/Python | |
126 | Requires: %{name}-devel = %{version}-%{release} | |
a5fba226 AF |
127 | |
128 | %description examples | |
129 | This package contains example programs for GObject library. | |
130 | ||
131 | %description examples -l pl.UTF-8 | |
132 | Ten pakiet zawiera przykładowe programy dla biblioteki GObject. | |
133 | ||
a5fba226 AF |
134 | %prep |
135 | %setup -q -n %{module}-%{version} | |
f6b2e85a | 136 | %patch0 -p1 |
a5fba226 AF |
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 \ | |
f6b2e85a | 149 | PYTHON_LIBS=-lpython3 \ |
a5fba226 AF |
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} \ | |
f6b2e85a | 159 | PYTHON_LIBS=-lpython \ |
a5fba226 AF |
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 | %if %{with python2} | |
175 | %{__make} -C py2 -j 1 install \ | |
176 | DESTDIR=$RPM_BUILD_ROOT \ | |
177 | TARGET_DIR=%{_gtkdocdir}/%{module} | |
178 | %endif | |
179 | ||
180 | cp -a examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
181 | ||
a5fba226 | 182 | %if %{with python2} |
e4d02b95 | 183 | %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/gi/*.la |
e9ba7e96 | 184 | %py_postclean |
a5fba226 AF |
185 | %endif |
186 | %if %{with python3} | |
e4d02b95 | 187 | %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/gi/*.la |
a5fba226 AF |
188 | %endif |
189 | ||
190 | %clean | |
191 | rm -rf $RPM_BUILD_ROOT | |
192 | ||
a5fba226 AF |
193 | %if %{with python2} |
194 | %files | |
195 | %defattr(644,root,root,755) | |
196 | %doc AUTHORS ChangeLog NEWS README | |
a5fba226 | 197 | %dir %{py_sitedir}/gi |
decdeaaa ŁK |
198 | %attr(755,root,root) %{py_sitedir}/gi/_gi.so |
199 | %attr(755,root,root) %{py_sitedir}/gi/_gi_cairo.so | |
200 | %{py_sitedir}/gi/*.py[co] | |
a5fba226 AF |
201 | %dir %{py_sitedir}/gi/overrides |
202 | %{py_sitedir}/gi/overrides/*.py[co] | |
203 | %dir %{py_sitedir}/gi/repository | |
204 | %{py_sitedir}/gi/repository/*.py[co] | |
a5fba226 | 205 | %dir %{py_sitedir}/gi/_gobject |
a5fba226 | 206 | %{py_sitedir}/gi/_gobject/*.py[co] |
decdeaaa ŁK |
207 | %dir %{py_sitedir}/pygtkcompat |
208 | %{py_sitedir}/pygtkcompat/*.py[co] | |
9cb81703 | 209 | %{py_sitedir}/pygobject-%{version}-py*.egg-info |
a5fba226 | 210 | |
3955a8b7 | 211 | %files common-devel |
a5fba226 | 212 | %defattr(644,root,root,755) |
a5fba226 AF |
213 | %{_includedir}/pygobject-3.0 |
214 | %{_pkgconfigdir}/pygobject-3.0.pc | |
3955a8b7 AF |
215 | |
216 | %files devel | |
217 | %defattr(644,root,root,755) | |
a5fba226 AF |
218 | %endif |
219 | ||
220 | %if %{with python3} | |
221 | %files -n python3-pygobject3 | |
222 | %defattr(644,root,root,755) | |
223 | %doc AUTHORS ChangeLog NEWS README | |
a5fba226 | 224 | %dir %{py3_sitedir}/gi |
205b0127 JB |
225 | %attr(755,root,root) %{py3_sitedir}/gi/_gi.cpython*.so |
226 | %attr(755,root,root) %{py3_sitedir}/gi/_gi_cairo.cpython*.so | |
7d22b890 | 227 | %{py3_sitedir}/gi/*.py |
decdeaaa | 228 | %{py3_sitedir}/gi/__pycache__ |
7d22b890 | 229 | %dir %{py3_sitedir}/gi/_gobject |
7d22b890 JB |
230 | %{py3_sitedir}/gi/_gobject/*.py |
231 | %{py3_sitedir}/gi/_gobject/__pycache__ | |
a5fba226 | 232 | %dir %{py3_sitedir}/gi/overrides |
7d22b890 | 233 | %{py3_sitedir}/gi/overrides/*.py |
decdeaaa | 234 | %{py3_sitedir}/gi/overrides/__pycache__ |
a5fba226 AF |
235 | %dir %{py3_sitedir}/gi/repository |
236 | %{py3_sitedir}/gi/repository/*.py* | |
decdeaaa | 237 | %{py3_sitedir}/gi/repository/__pycache__ |
decdeaaa | 238 | %dir %{py3_sitedir}/pygtkcompat |
7d22b890 | 239 | %{py3_sitedir}/pygtkcompat/*.py |
decdeaaa | 240 | %{py3_sitedir}/pygtkcompat/__pycache__ |
9cb81703 | 241 | %{py3_sitedir}/pygobject-%{version}-py*.egg-info |
a5fba226 AF |
242 | |
243 | %files -n python3-pygobject3-devel | |
244 | %defattr(644,root,root,755) | |
a5fba226 AF |
245 | %endif |
246 | ||
247 | %files examples | |
248 | %defattr(644,root,root,755) | |
249 | %{_examplesdir}/%{name}-%{version} |