File sphinx.spec of Package sphinx

#
# spec file for package sphinx
#
# Copyright (c) 2013 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/
#


Name:           sphinx
Version:        2.0.8
Release:        0
#
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  gcc-c++
BuildRequires:  mysql-devel
BuildRequires:  postgresql-devel
#
Url:            http://sphinxsearch.com/
Source:         http://sphinxsearch.com/files/%{name}-%{version}-release.tar.gz
Patch0:         obs.patch
#
Summary:        Free open-source SQL full-text search engine
License:        GPL-2.0
Group:          Productivity/Databases/Servers

%description
Sphinx is a full-text search engine, distributed under GPL version 2.
Commercial licensing is also available upon request.

Generally, it's a standalone search engine, meant to provide fast,
size-efficient and relevant fulltext search functions to other
applications. Sphinx was specially designed to integrate well with SQL
databases and scripting languages. Currently built-in data source
drivers support fetching data either via direct connection to MySQL,
PostgreSQL, or from a pipe in a custom XML format.

As for the name, Sphinx is an acronym which is officially decoded as
SQL Phrase Index. Yes, I know about CMU's Sphinx project.

%package devel
Summary:        Sphinx development/header files
Group:          Development/Libraries/Other

%description devel
Provides necessary development files for sphinx api and shared libs for sphinx client.

%prep
%setup -q -n "%{name}-%{version}-release"
%patch0 -p1
find -type d -name CVS -print0 | xargs -r0 rm -rf

%build
%configure --sysconfdir=%{_sysconfdir}/%{name}/ --with-mysql --with-pgsql --enable-id64
%__make

cd api/libsphinxclient
%configure --sysconfdir=%{_sysconfdir}/%{name}/
%__make
cd ../../

%install
%makeinstall
%__cp -v %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf{.dist,}

cd api/libsphinxclient
%makeinstall
%__rm %{buildroot}%{_libdir}/libsphinxclient.la
cd ../../

%files
%defattr(-,root,root,-)
%config %dir %{_sysconfdir}/%{name}
%config %{_sysconfdir}/%{name}/example.sql
%config(noreplace) %{_sysconfdir}/%{name}/sphinx.conf
%config %{_sysconfdir}/%{name}/sphinx.conf.dist
%config %{_sysconfdir}/%{name}/sphinx-min.conf.dist
%{_bindir}/spelldump
%{_bindir}/indexer
%{_bindir}/search
%{_bindir}/searchd
%{_bindir}/indextool
%doc COPYING contrib/
%doc doc/*.html doc/*.css doc/*.txt
%doc %attr(644, root, man) %{_mandir}/man1/indexer.1* 
%doc %attr(644, root, man) %{_mandir}/man1/indextool.1*
%doc %attr(644, root, man) %{_mandir}/man1/search.1* 
%doc %attr(644, root, man) %{_mandir}/man1/searchd.1*
%doc %attr(644, root, man) %{_mandir}/man1/spelldump.1*

%files devel
%defattr(-,root,root,-)
%{_includedir}/sphinxclient.h
%{_libdir}/libsphinxclient.a
%{_libdir}/libsphinxclient.so
%attr(755, root, root) %{_libdir}/libsphinxclient-0.0.1.so

%changelog
openSUSE Build Service is sponsored by