# -*- mode: rpm-spec -*-
%define python python2

%define buildgtkhtml %(pkg-config libgtkhtml-2.0 && echo 1 || echo 0)
%define havematecorba %(pkg-config matecorba-python-2.0 && echo 1 || echo 0)

Summary: The sources for the PyMATE Python extension module.
Name: mate-python2
Version: @VERSION@
Release: 9
Source: ftp://ftp.mate.org/pub/MATE/stable/sources/mate-python/mate-python-%{version}.tar.gz
Copyright: LGPL
Group: Development/Languages
BuildRoot: %{_tmppath}/mate-python-root
Packager: James Henstridge <james@daa.com.au>
BuildRequires: pygtk2-devel = @PYGTK_VERSION@
BuildRequires: %{python}-devel
BuildRequires: gtk2-devel >= @GTK_VERSION@
BuildRequires: libmatecanvas-devel >= @LIBMATECANVAS_VERSION@
BuildRequires: libmate-devel >= @LIBMATE_VERSION@
BuildRequires: MateConf2-devel >= @MATECONF_VERSION@
%if %{havematecorba}
Requires: mate-python2-matecomponent
BuildRequires: matecorba-python >= @MATECORBA_PYTHON_VERSION@
BuildRequires: matecomponent-activation-devel >= @MATECOMPONENT_ACTIVATION_VERSION@
BuildRequires: libmatecomponent-devel >= @LIBMATECOMPONENT_VERSION@
BuildRequires: libmatecomponentui-devel >= @LIBMATECOMPONENTUI_VERSION@
BuildRequires: caja-devel >= @CAJA_VERSION@
BuildRequires: eel2-devel
BuildRequires: mate-panel >= @LIBPANELAPPLET_VERSION@
%endif
%if %{buildgtkhtml}
BuildRequires: gtkhtml2-devel >= @GTKHTML2_VERSION@
%endif


%description
The mate-python package contains the source packages for the Python
bindings for MATE called PyMATE.

PyMATE is an extension module for Python that provides access to the
base MATE libraries, so you have access to more widgets, a simple
configuration interface, and metadata support.

%package applet
Version: %{version}
Summary: Python bindings for MATE Panel applets.
Group: Development/Languages

%description applet
This module contains a wrapper that allows MATE Panel applets to be
written in Python.

%package capplet
Version: %{version}
Summary: Python bindings for MATE Panel applets.
Group: Development/Languages

%description capplet
This module contains a wrapper that allows MATE Control Center
capplets to be in Python.

%package canvas
Version: %{version}
Summary: Python bindings for the MATE Canvas.
Group: Development/Languages
Requires: libmatecanvas >= @LIBMATECANVAS_VERSION@
Requires: gtk2 >= @GTK_VERSION@
Requires: pygtk2 >= @PYGTK_VERSION@

%description canvas
This module contains a wrapper that allows use of the MATE Canvas
in Python.

%package caja
Version: %{version}
Summary: Python bindings for interacting with Caja.
Group: Development/Languages
Requires: matecorba-python >= @MATECORBA_PYTHON_VERSION@
Requires: caja >= @CAJA_VERSION@

%description caja
This module contains a wrapper that allows access to Caja via Python.

%package matecomponent
Version: %{version}
Summary: Python bindings for interacting with matecomponent.
Group: Development/Languages
Requires: matecorba-python >= @MATECORBA_PYTHON_VERSION@
Requires: matecomponent-activation >= @MATECOMPONENT_ACTIVATION_VERSION@
Requires: libmatecomponent >= @LIBMATECOMPONENT_VERSION@
Requires: libmatecomponentui >= @LIBMATECOMPONENTUI_VERSION@

%description matecomponent
This module contains a wrapper that allows the creation of matecomponent
components and the embedding of matecomponent components in Python.

%package mateconf
Version: %{version}
Summary: Python bindings for interacting with MateConf
Group: Development/Languages
Requires: MateConf2 >= 1.1.10

%description mateconf
This module contains a wrapper that allows the use of MateConf via Python.

%package gtkhtml2
Version: %{version}
Summary: Python bindings for interacting with gtkhtml2
Group: Development/Languages
Requires: gtkhtml2 >= 1.99.7

%description gtkhtml2
This module contains a wrapper that allows the use of gtkhtml2 via
Python

%prep
%setup -q -n mate-python-%{version}
export PYTHON=/usr/bin/python2.2
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{_prefix}

%build
make

%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install

%files
%defattr(644,root,root,755)
%doc AUTHORS ChangeLog README NEWS
%defattr(755,root,root,755)
%dir %{_prefix}/lib/python?.?/site-packages/gtk-2.0/mate/
%{_prefix}/lib/python?.?/site-packages/gtk-2.0/mate/__init__.*
%{_prefix}/lib/python?.?/site-packages/gtk-2.0/mate/_matemodule.so
%if %{havematecorba}
%{_prefix}/lib/python?.?/site-packages/gtk-2.0/mate/uimodule.so
%endif

%files applet
%defattr(755,root,root,755)
%dir %{_prefix}/lib/python?.?/site-packages/gtk-2.0/mate/
%{_prefix}/lib/python?.?/site-packages/gtk-2.0/mate/__init__.*
%{_prefix}/lib/python?.?/site-packages/gtk-2.0/mate/appletmodule.so

%if %{havematecorba}
%files caja
%defattr(755,root,root,755)
%dir %{_prefix}/lib/python?.?/site-packages/gtk-2.0/mate/
%{_prefix}/lib/python?.?/site-packages/gtk-2.0/mate/__init__.*
%{_prefix}/lib/python?.?/site-packages/gtk-2.0/mate/cajamodule.so
%defattr(644,root,root,755)
%doc examples/caja
%endif

%files canvas
%defattr(755,root,root,755)
%dir %{_prefix}/lib/python?.?/site-packages/gtk-2.0/mate/
%{_prefix}/lib/python?.?/site-packages/gtk-2.0/mate/__init__.*
%{_prefix}/lib/python?.?/site-packages/gtk-2.0/mate/canvasmodule.so
%defattr(644,root,root,755)
%doc examples/canvas

%if %{havematecorba}
%files matecomponent
%defattr(755,root,root,755)
%dir %{_prefix}/lib/python?.?/site-packages/gtk-2.0/matecomponent/
%{_prefix}/lib/python?.?/site-packages/gtk-2.0/matecomponent/__init__.*
%{_prefix}/lib/python?.?/site-packages/gtk-2.0/matecomponent/*.so
%defattr(644,root,root,755)
%doc examples/matecomponent
%endif

%files mateconf
%defattr(755,root,root,755)
%{_prefix}/lib/python?.?/site-packages/gtk-2.0/mateconf*
%defattr(644,root,root,755)
%doc examples/mateconf

%if %{buildgtkhtml}
%files gtkhtml2
%defattr(755,root,root,755)
%{_prefix}/lib/python?.?/site-packages/gtk-2.0/gtkhtml*
%defattr(644,root,root,755)
%doc examples/gtkhtml2
%endif

%changelog
* Thu May 30 2002 Matt Wilson <msw@redhat.com>
- s/Gconf/MateConf/

* Thu May 30 2002 Jeremy Katz <katzj@redhat.com>
- add gtkhtml2 and mateconf subpackages

* Wed May 29 2002 Bill Nottingham <notting@redhat.com>
- add some defattrs

* Fri May 24 2002 Matt Wilson <msw@redhat.com>
- added matecomponent, caja subpackages.  re-enabled applet subpackage

* Mon Nov 26 2001 Matt Wilson <msw@redhat.com>
- subpackages will need __init__ included in them

* Thu Oct 18 2001 Matt Wilson <msw@redhat.com>
- doesn't obsolete pymate - it can be installed side-by-side
- added _matemodule.so to base package filelist

* Mon Oct 15 2001 Matt Wilson <msw@redhat.com>
- added __init__ files to mate-python main package

* Mon Oct  8 2001 Matt Wilson <msw@redhat.com>
- new mate-python package based on old pygtk package.
