%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

%define glib_version 2.26.0
%define gtk_version 2.22.0
%define pygtk_version 2.22.0
%define gnome_python_version 2.28.0
%define libgnome_keyring_version 2.32.0
%define gnome_panel_version 2.32.0
%define gnome_desktop_version 2.32.0
%define gtksourceview2_version 2.10.5
%define libgtop_version 2.28.2
%define gnome_media_version 2.32.0
%define metacity_version 2.30.3
%define librsvg2_version 2.32.0
%define totem_version 2.32.0
%define libwnck_version 2.30.5
%define bug_buddy_version 2.32.0
%define evolution_data_server_version 2.32.0

### Abstract ###

Name: gnome-python-desktop
Version: 2.32.0
Release: 2%{?_dist_release}
License: GPL/LGPL
Group: Development/Libraries
Summary: The sources for additional PyGNOME Python extension modules
BuildRoot: %{_tmppath}/%{name}-%{version}-root
Source: gnome-python-desktop-%{version}.tar.bz2

### Dependencies ###

Requires: gnome-python >= %{gnome_python_version}

### Build Dependencies ###

BuildRequires: glib2-devel >= %{glib_version}
BuildRequires: gtk2-devel >= %{gtk_version}
BuildRequires: python >= 2.6
BuildRequires: pygtk2-devel >= %{pygtk_version}
BuildRequires: gnome-python-devel >= %{gnome_python_version}
BuildRequires: libgnome-keyring-devel >= %{libgnome_keyring_version}
# BuildRequires: gnome-panel-devel >= %{gnome_panel_version}
BuildRequires: gnome-desktop-devel >= %{gnome_desktop_version}
BuildRequires: libgnomeprint-devel
BuildRequires: libgnomeprintui-devel
# BuildRequires: evince-devel 
BuildRequires: evolution-data-server >= %{evolution_data_server_version}
BuildRequires: gtksourceview-devel >= %{gtksourceview_version}
BuildRequires: libgtop2-devel >= %{libgtop_version}
BuildRequires: gnome-media-devel >= %{gnome_media_version}
BuildRequires: metacity-devel >= %{metacity_version}
# BuildRequires: brasero-devel
BuildRequires: librsvg2-devel >= %{librsvg2_version}
BuildRequires: pycairo-devel
BuildRequires: totem-pl-parser-devel >= %{totem_version}
BuildRequires: totem >= %{totem_version}
BuildRequires: libwnck-devel >= %{libwnck_version}
BuildRequires: bug-buddy >= %{bug_buddy_version}
BuildRequires: libSM-devel

Obsoletes: gnome-python-applet < 2.32.0-2
Obsoletes: gnome-python-brasero < 2.32.0-2
Obsoletes: gnome-python-evince < 2.32.0-2

%description
The gnome-python-desktop package contains the source packages for additional 
Python bindings for GNOME. It should be used together with gnome-python.

## %package -n gnome-python-applet
## Summary: Python bindings for GNOME Panel applets.
## Group: Development/Libraries
## Requires: %{name} = %{version}-%{release}
## Obsoletes: pygnome-applet

## %description -n gnome-python-applet
## This module contains a wrapper that allows GNOME Panel applets to be
## written in Python.

%package -n gnome-python-bugbuddy
Summary: Python bindings for interacting with bug-buddy
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: bug-buddy >= %{bug_buddy_version}

%description -n gnome-python-bugbuddy
This module contains a wrapper that allows the use of bug-buddy via
Python.

%package -n gnome-python-evolution
Summary: Python bindings for interacting with evolution
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: evolution-data-server >= %{evolution_data_server_version}

%description -n gnome-python-evolution
This module contains a wrapper that allows the use of evolution via
Python.

%package -n gnome-python-gnomeprint
Summary: Python bindings for interacting with libgnomeprint
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: libgnomeprint
Requires: libgnomeprintui

%description -n gnome-python-gnomeprint
This module contains a wrapper that allows the use of libgnomeprint via
Python.

%package -n gnome-python-gtksourceview
Summary: Python bindings for interacting with the gtksourceview library 
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: gtksourceview >= %{gtksourceview_version}
Requires: gnome-python-gnomeprint

%description -n gnome-python-gtksourceview
This module contains a wrapper that allows the use of gtksourceview via
Python.

%package -n gnome-python-libwnck
Summary: Python bindings for interacting with libwnck
Group: Development/Libraries
Requires: libwnck >= %{libwnck_version}

%description -n gnome-python-libwnck
This module contains a wrapper that allows the use of libwnck via
Python.

%package -n gnome-python-libgtop2
Summary: Python bindings for interacting with libgtop
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: libgtop2 >= %{libgtop_version}

%description -n gnome-python-libgtop2
This module contains a wrapper that allows the use of libgtop via
Python.

## %package -n gnome-python-brasero
## Summary: Python bindings for interacting with brasero
## Group: Development/Libraries
## Requires: %{name} = %{version}-%{release}
## Requires: brasero-libs

## %description -n gnome-python-brasero
## This module contains a wrapper that allows the use of brasero
## via Python.

%package -n gnome-python-metacity
Summary: Python bindings for interacting with metacity
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: metacity >= %{metacity_version}

%description -n gnome-python-metacity
This module contains a wrapper that allows the use of metacity 
via Python.

%package -n gnome-python-totem
Summary: Python bindings for interacting with totem
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: totem >= %{totem_version}

%description -n gnome-python-totem
This module contains a wrapper that allows the use of totem
via Python.

%package -n gnome-python-rsvg
Summary: Python bindings for interacting with librsvg
Group: Development/Libraries
Requires: librsvg2 >= %{librsvg2_version}
Requires: pycairo

%description -n gnome-python-rsvg
This module contains a wrapper that allows the use of librsvg
via Python.

%package -n gnome-python-gnomedesktop
Summary: Python bindings for interacting with gnome-desktop
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: gnome-desktop >= %{gnome_desktop_version}

%description -n gnome-python-gnomedesktop
This module contains a wrapper that allows the use of gnome-desktop
via Python.

%package -n gnome-python-gnomekeyring
Summary: Python bindings for interacting with gnome-keyring
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: libgnome-keyring >= %{libgnome_keyring_version}

%description -n gnome-python-gnomekeyring
This module contains a wrapper that allows the use of gnome-keyring
via Python.

## %package -n gnome-python-evince
## Summary: Python bindings for interacting with evince
## Group: Development/Libraries
## Requires: %{name} = %{version}-%{release}
## Requires: evince

## %description -n gnome-python-evince
## This module contains a wrapper that allows the use of evince
## via Python.

%prep
%setup -q -n gnome-python-desktop-%{version}

%build
./waf configure --prefix=%{_prefix} --libdir=%{_libdir} --enable-metacity
./waf build %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
./waf install --destdir=$RPM_BUILD_ROOT 

find $RPM_BUILD_ROOT -name '*.la' -exec rm {} \;

rm -rf $RPM_BUILD_ROOT/%{_libdir}/python*/site-packages/gtk-2.0/gksu

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog NEWS
%{_libdir}/pkgconfig/gnome-python-desktop-2.0.pc
%{_datadir}/pygtk

## %files -n gnome-python-applet
## %defattr(-,root,root,-)
## %{python_sitearch}/gtk-2.0/gnomeapplet.so
## %defattr(644,root,root,755)
## %doc ../gnome-python-desktop-%{version}/examples/applet/*

%files -n gnome-python-bugbuddy
%defattr(-,root,root,-)
%{python_sitearch}/gtk-2.0/bugbuddy.py*

%files -n gnome-python-evolution
%defattr(-,root,root,-)
%dir %{python_sitearch}/gtk-2.0/evolution/
%{python_sitearch}/gtk-2.0/evolution/*

%files -n gnome-python-gnomeprint
%defattr(-,root,root,-)
%{python_sitearch}/gtk-2.0/gnomeprint/
%{_datadir}/gtk-doc/html/pygnomeprint
%{_datadir}/gtk-doc/html/pygnomeprintui
%defattr(644,root,root,755)
%doc ../gnome-python-desktop-%{version}/examples/gnomeprint/*

%files -n gnome-python-gtksourceview
%defattr(-,root,root,-)
%{python_sitearch}/gtk-2.0/gtksourceview.so
%{_datadir}/gtk-doc/html/pygtksourceview
%defattr(644,root,root,755)
%doc ../gnome-python-desktop-%{version}/examples/gtksourceview/*

%files -n gnome-python-libwnck
%defattr(-,root,root,-)
%{python_sitearch}/gtk-2.0/wnck.so
%defattr(644,root,root,755)
%doc ../gnome-python-desktop-%{version}/examples/wnck_example.py

%files -n gnome-python-libgtop2
%defattr(-,root,root,-)
%{python_sitearch}/gtk-2.0/gtop.so

## %files -n gnome-python-brasero
## %defattr(-,root,root,-)
#%{python_sitearch}/gtk-2.0/braseroburn.so
#%{python_sitearch}/gtk-2.0/braseromedia.so
## %defattr(644,root,root,755)
## %doc ../gnome-python-desktop-%{version}/examples/braseroburn/*
## %doc ../gnome-python-desktop-%{version}/examples/braseromedia/*

%files -n gnome-python-metacity
%defattr(-,root,root,-)
%{python_sitearch}/gtk-2.0/metacity.so

%files -n gnome-python-totem
%defattr(-,root,root,-)
%{python_sitearch}/gtk-2.0/mediaprofiles.so
%{python_sitearch}/gtk-2.0/totem

%files -n gnome-python-rsvg
%{python_sitearch}/gtk-2.0/rsvg.so
%defattr(644,root,root,755)
%doc ../gnome-python-desktop-%{version}/examples/rsvg/*

%files -n gnome-python-gnomedesktop
%{python_sitearch}/gtk-2.0/gnomedesktop

%files -n gnome-python-gnomekeyring
%{python_sitearch}/gtk-2.0/gnomekeyring.so
%defattr(644,root,root,755)
%doc ../gnome-python-desktop-%{version}/examples/keyring*.py

## %files -n gnome-python-evince
## %{python_sitearch}/gtk-2.0/evince.so

%changelog
* Wed Feb 15 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.32.0-2
- rebuild with python-2.7.2
- drop gnome-python-{applets,brasero,evince} sub packages

* Sun Oct 03 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.32.0-1
- new upstream release

* Sat Sep 25 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.30.2-2
- rebuild with rpm-4.8.1 for pkg-config file
- change BuildRequires: gnome-panel-devel instead of gnome-panel
- change BuildRequires: gnome-media-devel instead of gnome-media
- add BuildRequires: libSM-devel

* Mon Jun 21 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.30.2-1
- new upstream release

* Sat Apr 10 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.30.0-1
- new upstream release
- add BuildRequires: totem
- change BuildRequires: gnome-keyring-devel -> libgnome-keyring-devel

* Tue Feb 02 2010 Daisuke SUZUKI <daisuke@linux.or.jp> 2.28.0-2
- rebuild for python-2.6

* Sat Nov  7 2009 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.28.0-1
- new upstream release
- added gnome-python-brasero, gnome-python-evince package
- remove gnome-python-nautilus-cd-burner package
- used waf instead of configure script

* Mon Mar 23 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 2.26.0-1
- new upstream release

* Sat Oct 18 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 2.24.0-1
- new upstream release
- added BuildRequires: pycairo-devel

* Wed Jul 23 2008 Shu KONNO <owa@bg.wakwak.com> - 2.20.0-3
- rebuilt with python-2.5.2

* Wed Apr 16 2008 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 2.20.0-2
- re-enable BuildRequires: gnome-python-devel

* Mon Apr  7 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 2.22.0-1vl5
- new upstream release
- added gnome-python-evolution subpackage

* Wed Jan  9 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 2.20.0-0vl1
- new upstream release

* Sun Jul 08 2007 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 2.18.0-1vl2
- add BuildRequires: gnome-media

* Sat Jul  7 2007 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 2.18.0-1vl1
- initial build for Vine Linux 

* Mon Mar 12 2007 Matthew Barnes <mbarnes@redhat.com> - 2.18.0-1.fc7
- Update to 2.18.0

* Wed Feb 28 2007 Matthias Clasen <mclasen@redhat.com> - 2.17.93-1
- Update to 2.17.93

* Sun Feb 25 2007 Matthew Barnes <mbarnes@redhat.com> - 2.17.92-1.fc7
- Update to 2.17.92
- Remove patch for GNOME bug #401760 (fixed upstream).

* Mon Feb 05 2007 Matthew Barnes <mbarnes@redhat.com> - 2.17.3-3.fc7
- Add patch for GNOME bug #401760 (plparser fails to build).

* Mon Feb 05 2007 Matthew Barnes <mbarnes@redhat.com> - 2.17.3-2.fc7
- Rename spec file to gnome-python2-desktop.spec (RH bug #225832).

* Mon Jan 08 2007 Matthew Barnes <mbarnes@redhat.com> - 2.17.3-1
- Update to 2.17.3

* Sun Jan 07 2007 Matthew Barnes <mbarnes@redhat.com> - 2.17.2-1
- Update to 2.17.2
- New gnome-python2-bugbuddy subpackage.
- Update version requirements to match configure.ac.
- Use python_sitearch macro for installing libraries.

* Thu Dec  7 2006 Jeremy Katz <katzj@redhat.com> - 2.17.1-2
- rebuild for python 2.5
- BR gnome-python2-devel

* Sat Oct 21 2006 Matthias Clasen <mclasen@redhat.com> - 2.17.1-1
- Update to 2.17.1

* Tue Sep  5 2006 Matthias Clasen <mclasen@redhat.com> - 2.16.0-1.fc6
- Update to 2.16.0

* Tue Aug 22 2006 Dan Williams <dcbw@redhat.com> - 2.15.90-2.fc6
- Remove unecessary dependencies on gnome-python2-desktop from
    -libwnck and -rsvg subpackages (OLPC)

* Fri Aug  4 2006 Matthias Clasen <mclasen@redhat.com> - 2.15.90-1.fc6
- Update to 2.15.90

* Thu Jul 20 2006 Matthias Clasen <mclasen@redhat.com> - 2.15.4-2
- Rebuild against dbus

* Thu Jul 13 2006 Matthias Clasen <mclasen@redhat.com> - 2.15.4-1
- Update to 2.15.4

* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 2.15.3-4.1
- rebuild

* Thu Jun 15 2006 Jesse Keating <jkeating@redhat.com> - 2.15.3-4
- Create gnomekeyring subpackage
- block out the nautilus-cd stuff

* Thu Jun 15 2006 Jesse Keating <jkeating@redhat.com> - 2.15.3-2
- Bump for new nautilus-cd-burner

* Tue Jun 13 2006 Matthias Clasen <mclasen@redhat.com> - 2.15.3-1
- Update to 2.15.3

* Tue May 30 2006 Matthias Clasen <mclasen@redhat.com> - 2.15.2-1
- Update to 2.15.2
- Add subpackages gnome-python2-rsvg and gnome-python2-gnomedesktop

* Wed May 24 2006 John (J5) Palmieri <johnp@redhat.com> - 2.14.0-2
- Add pygtk2 BR

* Mon Mar 13 2006 Ray Strode <rstrode@redhat.de> 2.14.0-1
- Update to 2.14.0

* Tue Feb 28 2006 Karsten Hopp <karsten@redhat.de> 2.13.3-2
- Buildrequires: python-devel

* Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 2.13.3-1.1
- bump again for double-long bug on ppc(64)

* Mon Feb  6 2006 John (J5) Palmieri <johnp@redhat.com> - 2.13.3-1
- Initial build.

