[gtk-vnc] Enable building of a sub-RPM for gtk3



commit 67ccc3177ab7392bcc6a9f91acc10e4f21a728dc
Author: Daniel P. Berrange <berrange redhat com>
Date:   Thu Oct 28 15:38:52 2010 +0100

    Enable building of a sub-RPM for gtk3
    
    Allow a single RPM to build both gtk2 and gtk3 libraries
    
    * gtk-vnc.spec.in: Add gtk-vnc2 sub-RPM for gtk3 binaries

 gtk-vnc.spec.in |  112 +++++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 96 insertions(+), 16 deletions(-)
---
diff --git a/gtk-vnc.spec.in b/gtk-vnc.spec.in
index 1fbc8d3..97efc96 100644
--- a/gtk-vnc.spec.in
+++ b/gtk-vnc.spec.in
@@ -10,7 +10,12 @@
 %define with_gir 1
 %endif
 
-Summary: A GTK widget for VNC clients
+%define with_gtk3 0
+%if 0%{fedora} >= 15
+%define with_gtk3 1
+%endif
+
+Summary: A GTK2 widget for VNC clients
 Name: gtk-vnc
 Version: @VERSION@
 Release: 1%{?dist}%{?extra_release}
@@ -36,20 +41,23 @@ BuildRequires: xulrunner-devel
 BuildRequires: firefox-devel
 %endif
 %endif
+%if %{with_gtk3}
+BuildRequires: gtk3-devel
+%endif
 
 %description
-gtk-vnc is a VNC viewer widget for GTK. It is built using coroutines
+gtk-vnc is a VNC viewer widget for GTK2. It is built using coroutines
 allowing it to be completely asynchronous while remaining single threaded.
 
 %package devel
-Summary: Libraries, includes, etc. to compile with the gtk-vnc library
+Summary: Development files to build GTK2 applications with gtk-vnc
 Group: Development/Libraries
 Requires: %{name} = %{version}-%{release}
 Requires: pkgconfig
-Requires: gtk2-devel gnutls-devel
+Requires: gtk2-devel
 
 %description devel
-gtk-vnc is a VNC viewer widget for GTK. It is built using coroutines
+gtk-vnc is a VNC viewer widget for GTK2. It is built using coroutines
 allowing it to be completely asynchronous while remaining single threaded.
 
 Libraries, includes, etc. to compile with the gtk-vnc library
@@ -60,7 +68,7 @@ Group: Development/Libraries
 Requires: %{name} = %{version}
 
 %description python
-gtk-vnc is a VNC viewer widget for GTK. It is built using coroutines
+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
@@ -72,7 +80,7 @@ Group: Development/Libraries
 Requires: %{name} = %{version}
 
 %description plugin
-gtk-vnc is a VNC viewer widget for GTK. It is built using coroutines
+gtk-vnc is a VNC viewer widget for GTK2. It is built using coroutines
 allowing it to be completely asynchronous while remaining single threaded.
 
 This package provides a web browser plugin for Mozilla compatible
@@ -109,8 +117,34 @@ Provides useful command line utilities for interacting with
 VNC servers. Includes the gvnccapture program for capturing
 screenshots of a VNC desktop
 
+%if %{with_gtk3}
+%package -n gtk-vnc2
+Summary: A GTK3 widget for VNC clients
+Group: Applications/Internet
+
+%description -n gtk-vnc2
+gtk-vnc is a VNC viewer widget for GTK2. It is built using coroutines
+allowing it to be completely asynchronous while remaining single threaded.
+
+%package -n gtk-vnc2-devel
+Summary: Development files to build GTK3 applications with gtk-vnc
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+Requires: pkgconfig
+Requires: gtk3-devel
+
+%description -n gtk-vnc2-devel
+gtk-vnc is a VNC viewer widget for GTK3. It is built using coroutines
+allowing it to be completely asynchronous while remaining single threaded.
+
+Libraries, includes, etc. to compile with the gtk-vnc library
+%endif
+
 %prep
-%setup -q
+%setup -q -n gtk-vnc-%{version} -c
+%if %{with_gtk3}
+cp -a gtk-vnc-%{version} gtk-vnc2-%{version}
+%endif
 
 %build
 %if %{with_gir}
@@ -125,12 +159,30 @@ screenshots of a VNC desktop
 %define plugin_arg --enable-plugin=no
 %endif
 
-%configure %{plugin_arg} %{gir_arg}
+cd gtk-vnc-%{version}
+%configure --with-gtk=2.0 %{plugin_arg} %{gir_arg}
+%__make %{?_smp_mflags} V=1
+cd ..
+
+%if %{with_gtk3}
+cd gtk-vnc2-%{version}
+%configure --with-gtk=3.0 %{gir_arg}
 %__make %{?_smp_mflags} V=1
+cd ..
+%endif
 
 %install
 rm -fr %{buildroot}
+cd gtk-vnc-%{version}
 %__make install DESTDIR=%{buildroot}
+cd ..
+
+%if %{with_gtk3}
+cd gtk-vnc2-%{version}
+%__make install DESTDIR=%{buildroot}
+cd ..
+%endif
+
 rm -f %{buildroot}%{_libdir}/*.a
 rm -f %{buildroot}%{_libdir}/*.la
 rm -f %{buildroot}%{_libdir}/python*/site-packages/*.a
@@ -139,6 +191,7 @@ rm -f %{buildroot}%{_libdir}/python*/site-packages/*.la
 rm -f %{buildroot}%{_libdir}/mozilla/plugins/%{name}-plugin.a
 rm -f %{buildroot}%{_libdir}/mozilla/plugins/%{name}-plugin.la
 %endif
+
 %find_lang %{name}
 
 %clean
@@ -148,9 +201,8 @@ rm -fr %{buildroot}
 
 %postun -p /sbin/ldconfig
 
-%files -f %{name}.lang
+%files
 %defattr(-, root, root)
-%doc AUTHORS ChangeLog ChangeLog-old NEWS README COPYING.LIB
 %{_libdir}/libgtk-vnc-1.0.so.*
 %if %{with_gir}
 %{_libdir}/girepository-1.0/GtkVnc-1.0.typelib
@@ -158,9 +210,9 @@ rm -fr %{buildroot}
 
 %files devel
 %defattr(-, root, root)
-%doc examples/gvncviewer.c
+%doc gtk-vnc-%{version}/examples/gvncviewer.c
 %if %{with_gir}
-%doc examples/gvncviewer.js
+%doc gtk-vnc-%{version}/examples/gvncviewer.js
 %endif
 %{_libdir}/libgtk-vnc-1.0.so
 %dir %{_includedir}/%{name}-1.0/
@@ -172,7 +224,7 @@ rm -fr %{buildroot}
 
 %files python
 %defattr(-, root, root)
-%doc examples/gvncviewer.py
+%doc gtk-vnc-%{version}/examples/gvncviewer.py
 %{_libdir}/python*/site-packages/gtkvnc.so
 
 %if %{with_plugin}
@@ -181,7 +233,7 @@ rm -fr %{buildroot}
 %{_libdir}/mozilla/plugins/%{name}-plugin.so
 %endif
 
-%files -n gvnc
+%files -n gvnc -f %{name}.lang
 %defattr(-, root, root)
 %{_libdir}/libgvnc-1.0.so.*
 %if %{with_gir}
@@ -200,10 +252,38 @@ rm -fr %{buildroot}
 
 %files -n gvnc-tools
 %defattr(-, root, root)
-%doc AUTHORS ChangeLog NEWS README COPYING.LIB
+%doc gtk-vnc-%{version}/AUTHORS
+%doc gtk-vnc-%{version}/ChangeLog
+%doc gtk-vnc-%{version}/ChangeLog-old
+%doc gtk-vnc-%{version}/NEWS
+%doc gtk-vnc-%{version}/README
+%doc gtk-vnc-%{version}/COPYING.LIB
 %{_bindir}/gvnccapture
 %{_mandir}/man1/gvnccapture.1*
 
+%if %{with_gtk3}
+%files -n gtk-vnc2
+%defattr(-, root, root)
+%{_libdir}/libgtk-vnc-2.0.so.*
+%if %{with_gir}
+%{_libdir}/girepository-1.0/GtkVnc-2.0.typelib
+%endif
+
+%files -n gtk-vnc2-devel
+%defattr(-, root, root)
+%doc gtk-vnc2-%{version}/examples/gvncviewer.c
+%if %{with_gir}
+%doc gtk-vnc2-%{version}/examples/gvncviewer.js
+%endif
+%{_libdir}/libgtk-vnc-2.0.so
+%dir %{_includedir}/%{name}-2.0/
+%{_includedir}/%{name}-2.0/*.h
+%{_libdir}/pkgconfig/%{name}-2.0.pc
+%if %{with_gir}
+%{_datadir}/gir-1.0/GtkVnc-2.0.gir
+%endif
+%endif
+
 %changelog
 * Thu Sep 13 2007 Daniel P. Berrange <berrange redhat com> - 0.2.0-1
 - Support client cursor offload



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