Package libbeagle: Specfile

%define ver_major 0.3
%def_enable python

Name: libbeagle
Version: %ver_major.9
Summary: Beagle integration library
Group: System/Libraries
Release: alt3
License: %mit %asl
Url: http://beagle-project.org/
Packager: Alexey Shabalin <shaba@altlinux.ru>
Source: ftp://ftp.gnome.org/pub/gnome/sources/%name/%ver_major/%name-%version.tar.bz2

BuildPreReq: rpm-build-licenses
BuildPreReq: glib2-devel >= 2.6
BuildPreReq: libxml2-devel >= 2.6.19
BuildRequires: gcc-c++ glibc-devel gtk-doc

%description
Beagle is an indexing sub-system and search aggregator built on top of
Lucene.Net. It can index your files, mailboxes, your web browsing
behaviour and other things.

This is the shared library used to integrate beagle search in applications.


%package devel
Group: Development/C
Summary: Development library of beagle
Requires: %name = %version-%release 

%description devel
Beagle is an indexing sub-system and search aggregator built on top of
Lucene.Net.

%if_enabled python
%package -n python-module-beagle
Group: Development/Python
Summary: Python module for writing Beagle extensions
Requires: %name = %version-%release
Requires: python-module-pygtk
Provides: libbeagle-python = %version-%release
Obsoletes: libbeagle-python
Provides: python-modules-beagle = %version-%release
Obsoletes: python-modules-beagle

BuildPreReq: python-dev >= 2.3 rpm-build-python
BuildPreReq: python-module-pygtk-devel >= 2.6
BuildPreReq: python-module-pygobject-devel >= 2.6
BuildRequires: python-modules-encodings  python-modules-compiler  python-modules

%description -n python-module-beagle
Beagle is an indexing sub-system and search aggregator built on top of
Lucene.Net.
Python wrappers for libbeagle
%endif

%prep
%setup -q
sed -i -e 's,^\(beagle_la_LIBADD = \$(BEAGLE_LIBS) \$(top_builddir)/beagle/libbeagle.la\),\1 -lpython%__python_version,g' wrappers/python/Makefile.am

%build
%autoreconf
%configure --disable-static --enable-gtk-doc 
%make

%install
%make_install install DESTDIR=%buildroot

%files
%_libdir/%name.so.*

%files devel
%_includedir/%name
%_libdir/%name.so
%_libdir/pkgconfig/%name-*.pc
%doc %_datadir/gtk-doc/html/*

%if_enabled python
%files -n python-module-beagle
%python_sitelibdir/beagle
%exclude %python_sitelibdir/beagle/beagle.la
%endif

%changelog
* Thu Jul 02 2009 Alexey Shabalin <shaba@altlinux.ru> 0.3.9-alt3
- fix build (remove duplicated headers)

* Tue Feb 24 2009 Alexey Shabalin <shaba@altlinux.ru> 0.3.9-alt2
- rename python package to python-module-beagle

* Wed Jan 28 2009 Alexey Shabalin <shaba@altlinux.ru> 0.3.9-alt1
- 0.3.9
- remove obsoleted pre/post macros

* Tue Apr 22 2008 Alexey Shabalin <shaba@altlinux.ru> 0.3.5.1-alt1
- 0.3.5.1

* Tue Apr 08 2008 Alexey Shabalin <shaba@altlinux.ru> 0.3.5-alt1
- 0.3.5

* Mon Mar 24 2008 Alexey Shabalin <shaba@altlinux.ru> 0.3.4-alt1
- 0.3.4

* Wed Jan 30 2008 Grigory Batalov <bga@altlinux.ru> 0.3.0-alt2.1
- Rebuilt with python-2.5.

* Wed Jan 23 2008 Grigory Batalov <bga@altlinux.ru> 0.3.0-alt2
- Link with current python.

* Fri Dec 07 2007 Alexey Shabalin <shaba@altlinux.ru> 0.3.0-alt1
- initial package for ALT Linux