]>
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 |
01f4a943 | 10 | Version: 3.28.1 |
8282c911 | 11 | Release: 1 |
a5fba226 AF |
12 | License: LGPL v2+ |
13 | Group: Libraries/Python | |
8282c911 | 14 | Source0: http://ftp.gnome.org/pub/GNOME/sources/pygobject/3.24/%{module}-%{version}.tar.xz |
01f4a943 | 15 | # Source0-md5: 612e9e2863d117d810e78672f7bc3ad6 |
f6b2e85a | 16 | Patch0: link.patch |
14d87b6a | 17 | URL: https://wiki.gnome.org/Projects/PyGObject |
decdeaaa | 18 | BuildRequires: autoconf >= 2.68 |
b428bc6e | 19 | BuildRequires: automake >= 1:1.12.6 |
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 |
badcdbca | 24 | BuildRequires: gobject-introspection-devel >= 1.46.0 |
a5fba226 | 25 | BuildRequires: libffi-devel >= 3.0 |
7d22b890 | 26 | BuildRequires: libtool >= 2:2.2.6 |
a5fba226 AF |
27 | BuildRequires: pkgconfig |
28 | BuildRequires: rpm-pythonprov | |
29 | BuildRequires: tar >= 1:1.22 | |
30 | BuildRequires: xz | |
31 | %if %{with python2} | |
205b0127 | 32 | BuildRequires: python-devel >= 1:2.7 |
01f4a943 | 33 | BuildRequires: python-pycairo-devel >= 1.11.1 |
a5fba226 AF |
34 | %endif |
35 | %if %{with python3} | |
b428bc6e JB |
36 | BuildRequires: python3 >= 1:3.2.2-3 |
37 | BuildRequires: python3-devel >= 1:3.2.2-3 | |
38 | BuildRequires: python3-modules >= 1:3.2.2-3 | |
01f4a943 | 39 | BuildRequires: python3-pycairo-devel >= 1.11.1 |
a5fba226 | 40 | %endif |
e4d02b95 | 41 | Requires: glib2 >= 1:2.38.0 |
badcdbca | 42 | Requires: gobject-introspection >= 1.46.0 |
eebd4be2 | 43 | Requires: python-modules >= 1:2.7 |
23ea25eb | 44 | Conflicts: python-pygobject < 2.28.6-3 |
a5fba226 AF |
45 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
46 | ||
a5fba226 AF |
47 | %description |
48 | Python bindings for GObject library. | |
49 | ||
50 | %description -l pl.UTF-8 | |
51 | Wiązania Pythona do biblioteki GObject. | |
52 | ||
3955a8b7 AF |
53 | %package common-devel |
54 | Summary: Python bindings for GObject library | |
55 | Summary(pl.UTF-8): Wiązania Pythona do biblioteki GObject | |
56 | Group: Development/Languages/Python | |
57 | Requires: %{name} = %{version}-%{release} | |
e4d02b95 | 58 | Requires: glib2-devel >= 1:2.38.0 |
3955a8b7 AF |
59 | Requires: libffi-devel >= 3.0 |
60 | ||
d1050d12 | 61 | %description common-devel |
538a43f0 ŁK |
62 | This package contains headers files required to build wrappers for |
63 | GObject addon libraries so that they interoperate with Python | |
3955a8b7 AF |
64 | bindings. |
65 | ||
d1050d12 | 66 | %description common-devel -l pl.UTF-8 |
538a43f0 ŁK |
67 | Pakiet zawiera pliki nagłówkowe wymagane do zbudowania funkcji do |
68 | biblioteki GObject, tak by mogły te biblioteki kooperowaći z | |
69 | wiązaniami Pythona. | |
3955a8b7 | 70 | |
a5fba226 | 71 | %package devel |
e4d02b95 JB |
72 | Summary: Python 2 bindings for GObject library - development metapackage |
73 | Summary(pl.UTF-8): Wiązania Pythona 2 do biblioteki GObject - metapakiet programistyczny | |
a5fba226 AF |
74 | Group: Development/Languages/Python |
75 | Requires: %{name} = %{version}-%{release} | |
3955a8b7 | 76 | Requires: %{name}-common-devel = %{version}-%{release} |
e4d02b95 | 77 | Requires: glib2-devel >= 1:2.38.0 |
a5fba226 | 78 | Requires: libffi-devel >= 3.0 |
bebf1ce0 | 79 | Requires: python-devel >= 1:2.6 |
a5fba226 AF |
80 | |
81 | %description devel | |
e4d02b95 JB |
82 | This metapackage gathers files required to develop GObject bindings |
83 | for Python 2. | |
a5fba226 AF |
84 | |
85 | %description devel -l pl.UTF-8 | |
e4d02b95 JB |
86 | Ten metapakiet gromadzi pliki wymagane do tworzenia wiązań biblioteki |
87 | GObject dla Pythona 2. | |
a5fba226 AF |
88 | |
89 | %package -n python3-pygobject3 | |
90 | Summary: Python 3.x bindings for GObject library | |
91 | Summary(pl.UTF-8): Wiązania Pythona 3.x do biblioteki GObject | |
92 | Group: Libraries/Python | |
e4d02b95 | 93 | Requires: glib2 >= 1:2.38.0 |
badcdbca | 94 | Requires: gobject-introspection >= 1.46.0 |
538a43f0 | 95 | Conflicts: python3-pygobject < 2.28.6-3 |
a5fba226 AF |
96 | |
97 | %description -n python3-pygobject3 | |
98 | Python 3.x bindings for GObject library. | |
99 | ||
100 | %description -n python3-pygobject3 -l pl.UTF-8 | |
101 | Wiązania Pythona 3.x do biblioteki GObject. | |
102 | ||
103 | %package -n python3-pygobject3-devel | |
e4d02b95 JB |
104 | Summary: Python 3 bindings for GObject library - development metapackage |
105 | Summary(pl.UTF-8): Wiązania Pythona 3 do biblioteki GObject - metapakiet programistyczny | |
a5fba226 | 106 | Group: Development/Languages/Python |
538a43f0 | 107 | Requires: %{name}-common-devel = %{version}-%{release} |
e4d02b95 | 108 | Requires: glib2-devel >= 1:2.38.0 |
a5fba226 | 109 | Requires: libffi-devel >= 3.0 |
b428bc6e | 110 | Requires: python3-devel >= 1:3.2 |
97dc7172 | 111 | Requires: python3-pygobject3 = %{version}-%{release} |
a5fba226 AF |
112 | |
113 | %description -n python3-pygobject3-devel | |
e4d02b95 JB |
114 | This metapackage gathers files required to develop GObject bindings |
115 | for Python 3. | |
a5fba226 AF |
116 | |
117 | %description -n python3-pygobject3-devel -l pl.UTF-8 | |
e4d02b95 JB |
118 | Ten metapakiet gromadzi pliki wymagane do tworzenia wiązań biblioteki |
119 | GObject dla Pythona 3. | |
a5fba226 AF |
120 | |
121 | %package examples | |
122 | Summary: Example programs for GObject library | |
123 | Summary(pl.UTF-8): Programy przykładowe dla biblioteki GObject | |
124 | Group: Development/Languages/Python | |
125 | Requires: %{name}-devel = %{version}-%{release} | |
a5fba226 AF |
126 | |
127 | %description examples | |
128 | This package contains example programs for GObject library. | |
129 | ||
130 | %description examples -l pl.UTF-8 | |
131 | Ten pakiet zawiera przykładowe programy dla biblioteki GObject. | |
132 | ||
a5fba226 AF |
133 | %prep |
134 | %setup -q -n %{module}-%{version} | |
f6b2e85a | 135 | %patch0 -p1 |
a5fba226 AF |
136 | |
137 | %build | |
138 | %{__libtoolize} | |
139 | %{__aclocal} -I m4 | |
140 | %{__autoconf} | |
141 | %{__autoheader} | |
142 | %{__automake} | |
143 | %if %{with python3} | |
144 | mkdir py3 | |
145 | cd py3 | |
146 | ../%configure \ | |
147 | PYTHON=/usr/bin/python3 \ | |
f6b2e85a | 148 | PYTHON_LIBS=-lpython3 \ |
eebd4be2 JB |
149 | --disable-silent-rules \ |
150 | %{?with_python2:--without-common} | |
a5fba226 AF |
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) | |
01f4a943 | 196 | %doc ChangeLog NEWS README.rst |
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] | |
decdeaaa ŁK |
205 | %dir %{py_sitedir}/pygtkcompat |
206 | %{py_sitedir}/pygtkcompat/*.py[co] | |
9cb81703 | 207 | %{py_sitedir}/pygobject-%{version}-py*.egg-info |
a5fba226 | 208 | |
3955a8b7 | 209 | %files common-devel |
a5fba226 | 210 | %defattr(644,root,root,755) |
a5fba226 AF |
211 | %{_includedir}/pygobject-3.0 |
212 | %{_pkgconfigdir}/pygobject-3.0.pc | |
3955a8b7 AF |
213 | |
214 | %files devel | |
215 | %defattr(644,root,root,755) | |
a5fba226 AF |
216 | %endif |
217 | ||
218 | %if %{with python3} | |
219 | %files -n python3-pygobject3 | |
220 | %defattr(644,root,root,755) | |
01f4a943 | 221 | %doc ChangeLog NEWS README.rst |
a5fba226 | 222 | %dir %{py3_sitedir}/gi |
205b0127 JB |
223 | %attr(755,root,root) %{py3_sitedir}/gi/_gi.cpython*.so |
224 | %attr(755,root,root) %{py3_sitedir}/gi/_gi_cairo.cpython*.so | |
7d22b890 | 225 | %{py3_sitedir}/gi/*.py |
decdeaaa | 226 | %{py3_sitedir}/gi/__pycache__ |
a5fba226 | 227 | %dir %{py3_sitedir}/gi/overrides |
7d22b890 | 228 | %{py3_sitedir}/gi/overrides/*.py |
decdeaaa | 229 | %{py3_sitedir}/gi/overrides/__pycache__ |
a5fba226 AF |
230 | %dir %{py3_sitedir}/gi/repository |
231 | %{py3_sitedir}/gi/repository/*.py* | |
decdeaaa | 232 | %{py3_sitedir}/gi/repository/__pycache__ |
decdeaaa | 233 | %dir %{py3_sitedir}/pygtkcompat |
7d22b890 | 234 | %{py3_sitedir}/pygtkcompat/*.py |
decdeaaa | 235 | %{py3_sitedir}/pygtkcompat/__pycache__ |
9cb81703 | 236 | %{py3_sitedir}/pygobject-%{version}-py*.egg-info |
a5fba226 AF |
237 | |
238 | %files -n python3-pygobject3-devel | |
239 | %defattr(644,root,root,755) | |
a5fba226 AF |
240 | %endif |
241 | ||
242 | %files examples | |
243 | %defattr(644,root,root,755) | |
244 | %{_examplesdir}/%{name}-%{version} |