Installing Sphinx with Postgres on Leopard

I didn’t find a quick short guide to installing sphinx on Leopard with PostgreSQL, hence here goes (this assumes you already installed PostgreSQL).

Compile dependencies

These two libs are required by sphinx according to this blog post.

  ~% mkdir src
  ~% cd src
  ~% curl -O http://ftp.gnu.org/gnu/libiconv/libiconv-1.13.tar.gz
  ~% tar xzf libiconv-1.13.tar.gz
  ~% cd libiconv-1.13
  ~% ./configure --prefix=/usr/local
  ~% make
  ~% sudo make install
  ~% cd ..

  ~% curl -O http://internap.dl.sourceforge.net/sourceforge/expat/expat-2.0.1.tar.gz
  ~% tar xzf expat-2.0.1.tar.gz
  ~% cd expat-2.0.1
  ~% ./configure --prefix=/usr/local
  ~% make
  ~% sudo make install
  ~% cd ..

Compile Sphinx

At this point latest stable release was 0.9.8.1.

  ~% curl -O http://www.sphinxsearch.com/downloads/sphinx-0.9.8.1.tar.gz
  ~% tar xzf sphinx-0.9.8.1.tar.gz
  ~% cd sphinx-0.9.8.1
  ~% export LDFLAGS="-L/usr/lib"
  ~% ./configure --prefix=/usr/local --with-pgsql --without-mysql
  ~% make
  ~% sudo make install

You’re all set.

References

Leave a Reply