File gtk-vnc.spec of Package gtk-vnc

#
# spec file for package gtk-vnc
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

%define build_for_gtk2 0

%if !%{build_for_gtk2}
%define _sover -2_0-0
%define _sonamever 2.0
%else
%define _sover -1_0-0
%define _sonamever 1.0
%endif

Name:           gtk-vnc
%define _name   gtk-vnc
BuildRequires:  cyrus-sasl-devel
BuildRequires:  gnutls-devel
BuildRequires:  gobject-introspection-devel
%if %{build_for_gtk2}
BuildRequires:  gtk2-devel
%else
BuildRequires:  gtk3-devel
%endif
BuildRequires:  intltool
BuildRequires:  libgcrypt-devel
BuildRequires:  libtool
%if %{build_for_gtk2}
BuildRequires:  python-devel
BuildRequires:  python-gtk-devel
%endif
BuildRequires:  translation-update-upstream
Summary:        A GTK widget for VNC clients
Version:        0.4.3
Release:        3
# FIXME: see if the browser plugin can be built (last try 0.4.2)
License:        LGPLv2.1 ; LGPLv2.1+
Group:          Development/Libraries/X11
Source:         http://downloads2.sourceforge.net/%{_name}/%{_name}-%{version}.tar.bz2
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Url:            http://gtk-vnc.sf.net/

%description
gtk-vnc is a VNC viewer widget for GTK+. It is built using coroutines
allowing it to be completely asynchronous while remaining single
threaded.

%package -n libgvnc-1_0-0
License:        LGPLv2.1 ; LGPLv2.1+
Summary:        GObject-based library to interact with the RFB protocol
Group:          Development/Libraries/X11

%description  -n libgvnc-1_0-0
gtk-vnc is a VNC viewer widget for GTK+. It is built using coroutines
allowing it to be completely asynchronous while remaining single
threaded.

This package contains the GObject-based library to interact with the
RFB protocol.

%package -n libgtk-vnc%{_sover}

License:        LGPLv2.1 ; LGPLv2.1+
Summary:        A GTK widget for VNC clients
Group:          Development/Libraries/X11
Recommends:     %{name}-lang
# Needed to make lang package installable (and because we used to
# have a gtk-vnc package earlier).
Provides:       %{name} = %{version}
Obsoletes:      %{name} < %{version}

%description  -n libgtk-vnc%{_sover}
gtk-vnc is a VNC viewer widget for GTK+. It is built using coroutines
allowing it to be completely asynchronous while remaining single
threaded.

%package tools
License:        LGPLv2.1 ; LGPLv2.1+
Summary:        VNC Tools based on gtk-vnc
Group:          Development/Libraries/X11

%description tools
This package contains tools based on gtk-vnc:

 - gvnccapture: a tool to capture a screenshot of the VNC desktop

 - gvncviewer: a simple VNC client

%package devel
License:        LGPLv2.1+
Summary:        A GTK widget for VNC clients -- Development Files
Group:          Development/Libraries/X11
Requires:       libgvnc-1_0-0 = %{version}
Requires:       libgtk-vnc%{_sover} = %{version}

%description devel
gtk-vnc is a VNC viewer widget for GTK+. It is built using coroutines
allowing it to be completely asynchronous while remaining single
threaded.

%if %{build_for_gtk2}

%package -n python-gtk-vnc

License:        LGPLv2.1+
Summary:        Python bindings for the gtk-vnc library
Group:          Development/Libraries/X11
Provides:       gtk-vnc-python = %{version}
Obsoletes:      gtk-vnc-python < %{version}
%py_requires

%description -n python-gtk-vnc
gtk-vnc is a VNC viewer widget for GTK+. It is built using coroutines
allowing it to be completely asynchronous while remaining single
threaded.

This package contains the python bindings for gtk-vnc.
%endif

%lang_package

%prep
%setup -q -n %{_name}-%{version}
translation-update-upstream

%build
# We use --with-examples since this will build gvncviewer, which is neat
%configure --disable-static --with-pic \
%if %{build_for_gtk2}
        --with-gtk=2.0\
%else
        --with-gtk=3.0\
%endif
        --with-examples
%{__make} %{?jobs:-j%jobs} V=1

%install
%makeinstall
%if %{build_for_gtk2}
rm %{buildroot}%{py_sitedir}/gtkvnc.*a
# Files that will come with gtk3 build
rm -r %{buildroot}%{_includedir}/gvnc-1.0/
rm %{buildroot}%{_libdir}/libgvnc-1.0.so*
rm %{buildroot}%{_libdir}/pkgconfig/gvnc-1.0.pc
rm %{buildroot}%{_datadir}/gir-1.0/GVnc-1.0.gir
rm %{buildroot}%{_libdir}/girepository-1.0/GVnc-1.0.typelib
rm %{buildroot}%{_bindir}/gvnccapture
rm %{buildroot}%{_bindir}/gvncviewer
rm %{buildroot}%{_mandir}/man1/gvnccapture.1*
%endif
%{__rm} -f %{buildroot}%{_libdir}/*.la
%find_lang %{_name}

%clean
rm -rf $RPM_BUILD_ROOT

%postun  -n libgvnc-1_0-0 -p /sbin/ldconfig

%post  -n libgvnc-1_0-0 -p /sbin/ldconfig

%postun  -n libgtk-vnc%{_sover} -p /sbin/ldconfig

%post  -n libgtk-vnc%{_sover} -p /sbin/ldconfig

%if !%{build_for_gtk2}

%files -n libgvnc-1_0-0
%defattr(-, root, root)
%doc AUTHORS COPYING.LIB ChangeLog NEWS README
%{_libdir}/libgvnc-1.0.so.0*
%{_libdir}/girepository-1.0/GVnc-1.0.typelib
%endif

%files -n libgtk-vnc%{_sover}
%defattr(-, root, root)
%doc AUTHORS COPYING.LIB ChangeLog NEWS README
%{_libdir}/libgtk-vnc-%{_sonamever}.so.0*
%{_libdir}/girepository-1.0/GtkVnc-%{_sonamever}.typelib

%if !%{build_for_gtk2}

%files tools
%defattr(-, root, root)
%{_bindir}/gvnccapture
%{_bindir}/gvncviewer
%{_mandir}/man1/gvnccapture.1*
%endif

%if %{build_for_gtk2}

%files -n python-gtk-vnc
%defattr(-, root, root)
%doc examples/gvncviewer.py
%{py_sitedir}/gtkvnc.so
%endif

%files devel
%defattr(-, root, root)
%if !%{build_for_gtk2}
%{_includedir}/gvnc-1.0/
%{_libdir}/libgvnc-1.0.so
%{_libdir}/pkgconfig/gvnc-1.0.pc
%{_datadir}/gir-1.0/GVnc-1.0.gir
%endif
%{_includedir}/gtk-vnc-%{_sonamever}/
%{_libdir}/libgtk-vnc-%{_sonamever}.so
%{_libdir}/pkgconfig/gtk-vnc-%{_sonamever}.pc
%{_datadir}/gir-1.0/GtkVnc-%{_sonamever}.gir

%files lang -f %{_name}.lang

%changelog
openSUSE Build Service is sponsored by