3 %bcond_without python2 # CPython 2.x module and plugin
4 %bcond_without python3 # CPython 3.x module and plugin
7 %define pname gst-python
8 Summary: GStreamer Python 2 bindings
9 Summary(pl.UTF-8): Wiązania języka Python 2 do GStreamera
10 Name: python-gstreamer
11 # keep 1.16.x here (1.18+ is python3-only, see python3-gstreamer.spec)
15 Group: Libraries/Python
16 Source0: https://gstreamer.freedesktop.org/src/gst-python/%{pname}-%{version}.tar.xz
17 # Source0-md5: 326f4f4c23e2477bf3d5839c465a42ca
18 Patch0: %{name}-nosegv.patch
19 URL: https://gstreamer.freedesktop.org/modules/gst-python.html
20 BuildRequires: autoconf >= 2.68
21 BuildRequires: automake >= 1:1.11
22 BuildRequires: gstreamer-devel >= %{gst_ver}
23 BuildRequires: libtool >= 2:2.2.6
24 BuildRequires: pkgconfig >= 1:0.9.0
26 BuildRequires: python-devel >= 1:2.7
27 BuildRequires: python-pygobject3-devel >= 3.8
30 BuildRequires: python3-devel >= 1:3.3
31 BuildRequires: python3-pygobject3-devel >= 3.8
33 BuildRequires: rpm-pythonprov
34 BuildRequires: rpmbuild(macros) >= 1.612
35 BuildRequires: tar >= 1:1.22
37 Requires: gstreamer >= %{gst_ver}
38 Requires: python-pygobject3 >= 3.8
39 Obsoletes: python-gstreamer-devel < 1
40 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
43 GStreamer Python 2 bindings.
45 %description -l pl.UTF-8
46 Wiązania języka Python 2 do GStreamera.
48 %package -n gstreamer-python
49 Summary: GStreamer plugin to load plugins written in Python 2
50 Summary(pl.UTF-8): Wtyczka GStreamera do wczytywania wtyczek napisanych w Pythonie 2
52 Requires: python-gstreamer = %{version}-%{release}
54 %description -n gstreamer-python
55 GStreamer plugin to load plugins written in Python 2.
57 %description -n gstreamer-python -l pl.UTF-8
58 Wtyczka GStreamera do wczytywania wtyczek napisanych w Pythonie 2.
60 %package -n python3-gstreamer
61 Summary: GStreamer Python 3 bindings
62 Summary(pl.UTF-8): Wiązania języka Python 3 do GStreamera
63 Group: Libraries/Python
64 Requires: gstreamer >= %{gst_ver}
65 Requires: python3-pygobject3 >= 3.8
67 %description -n python3-gstreamer
68 GStreamer Python 3 bindings.
70 %description -n python3-gstreamer -l pl.UTF-8
71 Wiązania języka Python 3 do GStreamera.
73 %package -n gstreamer-python3
74 Summary: GStreamer plugin to load plugins written in Python 3
75 Summary(pl.UTF-8): Wtyczka GStreamera do wczytywania wtyczek napisanych w Pythonie 3
77 Requires: python3-gstreamer = %{version}-%{release}
79 %description -n gstreamer-python3
80 GStreamer plugin to load plugins written in Python 3.
82 %description -n gstreamer-python3 -l pl.UTF-8
83 Wtyczka GStreamera do wczytywania wtyczek napisanych w Pythonie 3.
86 %setup -q -n %{pname}-%{version}
91 %{__aclocal} -I common/m4
100 PYTHON="%{__python}" \
101 --disable-silent-rules
110 PYTHON="%{__python3}" \
111 --disable-silent-rules
117 rm -rf $RPM_BUILD_ROOT
120 %{__make} -C python2 install \
121 DESTDIR=$RPM_BUILD_ROOT
123 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
124 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
126 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/gi/overrides/*.la
130 %{__make} -C python3 install \
131 DESTDIR=$RPM_BUILD_ROOT
133 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/gi/overrides/*.la
136 %{__rm} $RPM_BUILD_ROOT%{_libdir}/gstreamer-1.0/libgstpython.la
137 install -d $RPM_BUILD_ROOT%{_libdir}/gstreamer-1.0/python
140 rm -rf $RPM_BUILD_ROOT
144 %defattr(644,root,root,755)
145 %doc AUTHORS ChangeLog NEWS TODO
146 %attr(755,root,root) %{py_sitedir}/gi/overrides/_gi_gst.so
147 %{py_sitedir}/gi/overrides/Gst.py[co]
148 %{py_sitedir}/gi/overrides/GstPbutils.py[co]
150 %files -n gstreamer-python
151 %defattr(644,root,root,755)
152 %attr(755,root,root) %{_libdir}/gstreamer-1.0/libgstpython.so
153 %dir %{_libdir}/gstreamer-1.0/python
157 %files -n python3-gstreamer
158 %defattr(644,root,root,755)
159 %doc AUTHORS ChangeLog NEWS TODO
160 %attr(755,root,root) %{py3_sitedir}/gi/overrides/_gi_gst.cpython-*.so
161 %{py3_sitedir}/gi/overrides/Gst.py
162 %{py3_sitedir}/gi/overrides/GstPbutils.py
163 %{py3_sitedir}/gi/overrides/__pycache__/Gst.*.py[co]
164 %{py3_sitedir}/gi/overrides/__pycache__/GstPbutils.*.py[co]
166 %files -n gstreamer-python3
167 %defattr(644,root,root,755)
168 %attr(755,root,root) %{_libdir}/gstreamer-1.0/libgstpython.cpython-3*.so
169 %dir %{_libdir}/gstreamer-1.0/python