# Plugin isn't ready for real world use yet - it needs
# a security audit at very least
%define with_plugin 0

Summary: A GTK widget for VNC clients
Summary(ja): VNCクライアント用 GTK ウィジェット

Name: gtk-vnc
Version: 0.4.4
Release: 1%{?_dist_release}
License: LGPLv2+
Group: Development/Libraries
Source: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz
Patch100: gtk-vnc-0.3.8-fast.patch

BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
URL: http://gtk-vnc.sf.net/
BuildRequires: gtk3-devel pygtk2-devel python-devel zlib-devel
BuildRequires: gnutls-devel gtkglext-devel cyrus-sasl-devel
BuildRequires: vala-tools
%if %{with_plugin}
BuildRequires: xulrunner-devel
%endif

Vendor: Project Vine
Distribution: Vine Linux
Packager: Takemikaduchi

%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 devel
Summary: Development filesdor gtk-vnc library
Summary(ja): gtk-vnc ライブラリの開発ファイル
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: pkgconfig
Requires: pygtk2-devel gtk3-devel gnutls-devel

%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.

Libraries, includes, etc. to compile with the gtk-vnc library

%package python
Summary: Python bindings for the gtk-vnc library
Summary(ja): gtk-vnc ライブラリの python バインディング
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

%description python
gtk-vnc is a VNC viewer widget for GTK. 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

%package vala
Summary: Vala bindings for gtk-vnc
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: vala

%description vala
Vala bindings for gtk-vnc

%if %{with_plugin}
%package plugin
Summary: Mozilla plugin for the gtk-vnc library
Summary(ja): gtk-vnc ライブラリの mozilla プラグイン
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

%description plugin
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 provides a web browser plugin for Mozilla compatible
browsers.
%endif

%prep
%setup -q
## %patch100 -p1

%build
%if %{with_plugin}
%configure --enable-plugin=yes --with-gtk=3.0
%else
%configure --with-gtk=3.0
%endif
%__make %{?_smp_mflags}

%install
rm -fr %{buildroot}
%__make install DESTDIR=%{buildroot}
rm -f %{buildroot}%{_libdir}/*.a
rm -f %{buildroot}%{_libdir}/*.la
rm -f %{buildroot}%{_libdir}/python*/site-packages/*.a
rm -f %{buildroot}%{_libdir}/python*/site-packages/*.la
%if %{with_plugin}
rm -f %{buildroot}%{_libdir}/mozilla/plugins/%{name}-plugin.a
rm -f %{buildroot}%{_libdir}/mozilla/plugins/%{name}-plugin.la
%endif

%find_lang %{name}

%clean
rm -fr %{buildroot}

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files -f %{name}.lang
%defattr(-, root, root)
%doc AUTHORS ChangeLog NEWS README COPYING.LIB
%{_bindir}/gvnccapture
%{_libdir}/lib*.so.*
%{_libdir}/girepository-1.0/*.typelib
%{_mandir}/man1/gvnccapture.1.gz

%files devel
%defattr(-, root, root)
%doc examples/gvncviewer.c
%{_libdir}/lib*.so
%dir %{_includedir}/%{name}-2.0/
%dir %{_includedir}/gvnc-1.0/
%{_includedir}/%{name}-2.0/*.h
%{_includedir}/gvnc-1.0/*.h
%{_libdir}/pkgconfig/%{name}-2.0.pc
%{_libdir}/pkgconfig/gvnc-1.0.pc
%{_datadir}/gir-1.0/*.gir

%files python
%defattr(-, root, root)
%doc examples/gvncviewer.py
# %{_libdir}/python*/site-packages/gtkvnc.so

%files vala
%defattr(-, root, root)
%{_datadir}/vala/vapi/gtk-vnc-2.0.*
%{_datadir}/vala/vapi/gvnc-1.0.*

%if %{with_plugin}
%files plugin
%defattr(-, root, root)
%{_libdir}/mozilla/plugins/%{name}-plugin.so
%endif

%changelog
* Mon Nov 21 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.4.4-1
- new upstream release
- add BuildRequires: vala-tools
- create %%{name}-vala sub package

* Tue Aug 16 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.4.3-2
- change BuildRequires: gtk3-devel instead of gtk2-devel
- add configure option: --with-gtk=3.0

* Thu Feb 24 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.4.3-1
- new upstream release

* Sun Sep 26 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.4.1-2
- rebuild with rpm-4.8.1 for pkg-config file

* Sun Jul 25 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.4.1-1
- new upstream release
- drop Patch100
- fix %files 

* Sun Apr 11 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.3.10-1
- new upstream release

* Tue Feb 02 2010 Shu KONNO <owa@bg.wakwak.com> 0.3.9-2
- rebuild with python-2.6

* Wed Aug 26 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 0.3.9-1
- new upstream release
- add Patch100 to speed up
- add BR: cyrus-sasl-devel

* Mon Jan 19 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 0.3.8-2
- rebuild with gnutls-2.6.3

* Wed Dec 24 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 0.3.8-1
- new upstream release

* Sat Sep 20 2008 Daisuke SUZUKI <daisuke@linux.or.jp> 0.3.7-1
- initial build for Vine Linux

* Fri Sep  5 2008 Matthias Clasen  <mclasen@redhat.com> - 0.3.7-1
- Update to 0.3.7

* Thu Aug 28 2008 Daniel P. Berrange <berrange@redhat.com> - 0.3.6-4.fc9
- Fix key/mouse event propagation (rhbz #454627)

* Mon Jul  7 2008 Tom "spot" Callaway <tcallawa@redhat.com> - 0.3.6-3
- fix conditional comparison

* Wed Jun 25 2008 Daniel P. Berrange <berrange@redhat.com> - 0.3.6-2.fc10
- Rebuild for GNU TLS ABI change

* Wed May  7 2008 Daniel P. Berrange <berrange@redhat.com> - 0.3.6-1.fc10
- Updated to 0.3.6 release

* Fri Apr 25 2008 Matthias Clasen <mclasen@redhat.com> - 0.3.5-1.fc9
- Update to 0.3.5

* Fri Apr  4 2008 Daniel P. Berrange <berrange@redhat.com> - 0.3.4-4.fc9
- Remove bogus chunk of render patch

* Thu Apr  3 2008 Daniel P. Berrange <berrange@redhat.com> - 0.3.4-3.fc9
- Fix OpenGL rendering artifacts (rhbz #440184)

* Thu Apr  3 2008 Daniel P. Berrange <berrange@redhat.com> - 0.3.4-2.fc9
- Fixed endianness conversions
- Fix makecontext() args crash on x86_64
- Fix protocol version negotiation

* Thu Mar  6 2008 Daniel P. Berrange <berrange@redhat.com> - 0.3.4-1.fc9
- Update to 0.3.4 release
- Fix crash with OpenGL scaling code

* Sun Feb  3 2008 Daniel P. Berrange <berrange@redhat.com> - 0.3.3-1.fc9
- Update to 0.3.3 release

* Mon Jan 14 2008 Daniel P. Berrange <berrange@redhat.com> - 0.3.2-2.fc9
- Track keystate to avoid stuck modifier keys

* Mon Dec 31 2007 Daniel P. Berrange <berrange@redhat.com> - 0.3.2-1.fc9
- Update to 0.3.2 release
- Added dep on zlib-devel

* Thu Dec 13 2007 Daniel P. Berrange <berrange@redhat.com> - 0.3.1-1.fc9
- Update to 0.3.1 release

* Thu Oct 10 2007 Daniel P. Berrange <berrange@redhat.com> - 0.2.0-4.fc8
- Fixed coroutine cleanup to avoid SEGV (rhbz #325731)

* Thu Oct  4 2007 Daniel P. Berrange <berrange@redhat.com> - 0.2.0-3.fc8
- Fixed coroutine caller to avoid SEGV

* Wed Sep 26 2007 Daniel P. Berrange <berrange@redhat.com> - 0.2.0-2.fc8
- Remove use of PROT_EXEC for coroutine stack (rhbz #307531 )

* Thu Sep 13 2007 Daniel P. Berrange <berrange@redhat.com> - 0.2.0-1.fc8
- Update to 0.2.0 release

* Wed Aug 29 2007 Daniel P. Berrange <berrange@redhat.com> - 0.1.0-5.fc8
- Fixed handling of mis-matched client/server colour depths

* Wed Aug 22 2007 Daniel P. Berrange <berrange@redhat.com> - 0.1.0-4.fc8
- Fix mixed endian handling & BGR pixel format (rhbz #253597)
- Clear widget areas outside of framebuffer (rhbz #253599)
- Fix off-by-one in python demo

* Thu Aug 16 2007 Daniel P. Berrange <berrange@redhat.com> - 0.1.0-3.fc8
- Tweaked post scripts
- Removed docs from sub-packages
- Explicitly set license to LGPLv2+
- Remove use of macro for install rule

* Wed Aug 15 2007 Daniel P. Berrange <berrange@redhat.com> - 0.1.0-2.fc8
- Added gnutls-devel requirement to -devel package

* Wed Aug 15 2007 Daniel P. Berrange <berrange@redhat.com> - 0.1.0-1.fc8
- Initial official release
