[gtk-vnc] rpm: disable python binding build on Fedora and future RHEL



commit 0efe46648414e91ca1ec4f913ecb825231d745cd
Author: Daniel P. Berrangé <berrange redhat com>
Date:   Fri Mar 23 11:59:31 2018 +0000

    rpm: disable python binding build on Fedora and future RHEL
    
    The python binding only works for GTK2 and Python2, both of which are
    slowly going away. It is still possible to access the library from
    any Python using GObject introspection dynamic binding.
    
    Signed-off-by: Daniel P. Berrangé <berrange redhat com>

 gtk-vnc.spec.in |   26 ++++++++++++++++++++++----
 1 files changed, 22 insertions(+), 4 deletions(-)
---
diff --git a/gtk-vnc.spec.in b/gtk-vnc.spec.in
index 92fef5d..6f336b6 100644
--- a/gtk-vnc.spec.in
+++ b/gtk-vnc.spec.in
@@ -18,6 +18,11 @@
 %global with_vala 1
 %endif
 
+%global with_python 1
+%if 0%{?fedora} || 0%{?rhel} >= 8
+%global with_python 0
+%endif
+
 %if 0%{?fedora} || 0%{?rhel} >= 8
     %global tls_priority "@LIBVIRT,SYSTEM"
 %else
@@ -33,8 +38,10 @@ Source: http://ftp.gnome.org/pub/GNOME/sources/%{name}/0.5/%{name}-%{version}.ta
 URL: https://wiki.gnome.org/Projects/gtk-vnc
 Requires: gvnc = %{version}-%{release}
 BuildRequires: gtk2-devel >= 2.14
-BuildRequires: pygtk2-devel python2-devel zlib-devel
-BuildRequires: gnutls-devel libgcrypt-devel cyrus-sasl-devel intltool
+%if %{with_python}
+BuildRequires: pygtk2-devel python2-devel
+%endif
+BuildRequires: gnutls-devel libgcrypt-devel cyrus-sasl-devel zlib-devel intltool
 %if %{with_gir}
 BuildRequires: gobject-introspection-devel
 %endif
@@ -63,6 +70,7 @@ allowing it to be completely asynchronous while remaining single threaded.
 
 Libraries, includes, etc. to compile with the gtk-vnc library
 
+%if %{with_python}
 %package -n python2-gtk-vnc
 %{?python_provide:%python_provide python2-gtk-vnc}
 # Remove before F30
@@ -77,6 +85,7 @@ gtk-vnc is a VNC viewer widget for GTK2. It is built using coroutines
 allowing it to be completely asynchronous while remaining single threaded.
 
 A module allowing use of the GTK-VNC widget from python
+%endif
 
 %package -n gvnc
 Summary: A GObject for VNC connections
@@ -163,8 +172,14 @@ cp -a gtk-vnc-%{version} gtk-vnc2-%{version}
 %define gir_arg --enable-introspection=no
 %endif
 
+%if %{with_python}
+%define py_arg --with-python
+%else
+%define py_arg --without-python
+%endif
+
 cd gtk-vnc-%{version}
-%configure --with-gtk=2.0 %{gir_arg} \
+%configure --with-gtk=2.0 %{gir_arg} %{py_arg} \
           --with-tls-priority=%{tls_priority}
 %__make %{?_smp_mflags} V=1
 chmod -x examples/*.pl examples/*.js examples/*.py
@@ -172,7 +187,8 @@ cd ..
 
 %if %{with_gtk3}
 cd gtk-vnc2-%{version}
-%configure --with-gtk=3.0 %{gir_arg} \
+
+%configure --with-gtk=3.0 %{gir_arg} %{py_arg} \
           --with-tls-priority=%{tls_priority}
 %__make %{?_smp_mflags} V=1
 chmod -x examples/*.pl examples/*.js examples/*.py
@@ -234,10 +250,12 @@ rm -f %{buildroot}%{_libdir}/python*/site-packages/*.la
 %{_datadir}/gir-1.0/GtkVnc-1.0.gir
 %endif
 
+%if %{with_python}
 %files -n python2-gtk-vnc
 %defattr(-, root, root)
 %doc gtk-vnc-%{version}/examples/gvncviewer-bindings.py
 %{_libdir}/python*/site-packages/gtkvnc.so
+%endif
 
 %files -n gvnc -f %{name}.lang
 %defattr(-, root, root)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]