This document explains how to build Sphinx debian package from source on a Debian GNU/Linux system.
It is easy to configure, compile and install Sphinx, but this method is not portable.
The Debian way is probably easier.
Even when building Sphinx manually, in the long run the Debian way will probably save labour, and is certainly the most reliable method.
To build Sphinx with MySQL, you need some mysql dev-libraries and “checkinstall” utility.
$ sudo aptitude install libmysql++-dev libmysqlclient15-dev checkinstall
PostgreSQL installation exactly the same, you only need to install “libpg-dev” instead of “libmysql++-dev” and run ./configure with ”–with-pgsql” option.
Next you should download and compile Sphinx:
$ cd /tmp $ wget http://sphinxsearch.com/downloads/sphinx-0.9.8-svn-r1112.tar.gz $ tar -xzf sphinx-0.9.8-svn-r1112.tar.gz $ cd sphinx-0.9.8-svn-r1112 $ ./configure $ make
Then, instead of doing a “make install” let's build .deb-package (you must be a root):
$ sudo checkinstall
“checkinstall” will ask you some questions, you should answer them something like this:
0 - Maintainer: [ endeveit{at}gmail.com ]
1 - Summary: [ Sphinx is a full-text search engine. ]
2 - Name: [ sphinxsearch-0.9.8-svn ]
3 - Version: [ r1112 ]
4 - Release: [ 1 ]
5 - License: [ GPL ]
6 - Group: [ web ]
7 - Architecture: [ i386 ]
8 - Source location: [ sphinx-0.9.8-svn-r1112 ]
9 - Alternate source location: [ http://sphinxsearch.com/downloads.html ]
10 - Requires: [ ]
Please be patient with step #2, debian already have a package for sphinx2 (a speech recognition utility), therefore i renamed package to “sphinxsearch”.
checkinstall automatically installs the new .deb package and put a copy of the package into that folder you were working in.
Now you can move .deb package wherever you want and delete working folder.
You're able to remove that package in a debian way in any time:
$ sudo dpkg -r sphinxsearch-0.9.8-svn
or
$ sudo aptitude remove sphinxsearch-0.9.8-svn
Installation now is also quite simple:
$ sudo dpkg -i sphinxsearch-0.9.8-svn_r1112-1_i386.deb
If you get “ERROR: cannot find MySQL include files.” while configuring, check that “libmysql++-dev” and “libmysqlclient15-dev” installed properly.
Make sure that you are using g++ rather than gcc by passing CXX=g++ to configure.