From 67857de995922a5a6a46f0d634c478e566e78063 Mon Sep 17 00:00:00 2001
From: Kazuhiko Shiozaki <kazuhiko@nexedi.com>
Date: Wed, 18 Aug 2010 08:55:03 +0000
Subject: [PATCH] add sphinx recipes.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37874 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 buildout/instance-profiles/sphinx.cfg     | 27 +++++++++++++++++++++++
 buildout/profiles/deployment.cfg          |  3 +++
 buildout/profiles/official.cfg            |  2 ++
 buildout/profiles/software-definition.cfg |  1 +
 4 files changed, 33 insertions(+)
 create mode 100644 buildout/instance-profiles/sphinx.cfg

diff --git a/buildout/instance-profiles/sphinx.cfg b/buildout/instance-profiles/sphinx.cfg
new file mode 100644
index 0000000000..223a718e87
--- /dev/null
+++ b/buildout/instance-profiles/sphinx.cfg
@@ -0,0 +1,27 @@
+[buildout]
+parts =
+  sphinx-instance
+
+[configuration]
+sphinx_address = 127.0.0.1
+sphinx_port = 9312
+sphinx_sql_port = 9306
+
+# below are candidates to be removed from global configuration
+sphinx_data_dir = ${buildout:var-directory}/sphinx
+sphinx_log_dir = ${buildout:log-directory}/sphinx
+
+[sphinx-instance]
+depends =
+  ${create-directories:command}
+recipe = erp5.recipe.sphinxserver
+sphinx_software_bin = ${software_definition:sphinx_software}/bin
+sphinx_bin_folder =  ${buildout:data-bin-directory}
+sphinx_data_dir = ${configuration:sphinx_data_dir}
+sphinx_log_dir = ${configuration:sphinx_log_dir}
+sphinx_conf_file = ${buildout:etc-directory}/sphinx.cnf
+
+# template related
+sphinx_address = ${configuration:sphinx_address}
+sphinx_port = ${configuration:sphinx_port}
+sphinx_sql_port = ${configuration:sphinx_sql_port}
diff --git a/buildout/profiles/deployment.cfg b/buildout/profiles/deployment.cfg
index 420ed08f2c..5c8590492a 100644
--- a/buildout/profiles/deployment.cfg
+++ b/buildout/profiles/deployment.cfg
@@ -8,6 +8,7 @@ extends =
   ../instance-profiles/memcached.cfg
   ../instance-profiles/mysql-database.cfg
   ../instance-profiles/mysql.cfg
+  ../instance-profiles/sphinx.cfg
   ../instance-profiles/oood.cfg
   ../instance-profiles/supervisor.cfg
   ../instance-profiles/zope.cfg
@@ -21,6 +22,7 @@ extends =
 parts =
   software-links
   mysql-instance
+  sphinx-instance
   oood-instance
   supervisor-instance
   memcached-instance
@@ -32,6 +34,7 @@ versions = versions
 supervisor_programs =
   10 mysql (autorestart=true) ${buildout:data-bin-directory}/pidproxy [ ${configuration:mysql_pid} ${buildout:data-bin-directory}/mysqld_safe ]
   20 oood (autorestart=true stopsignal=TERM stopwaitsecs=30) ${buildout:data-bin-directory}/oood-runserw ${buildout:etc-directory}
+  30 sphinx (autorestart=true stopsignal=TERM) ${buildout:data-bin-directory}/searchd [ --nodetach ]
 
 [software-links]
 recipe = plone.recipe.command
diff --git a/buildout/profiles/official.cfg b/buildout/profiles/official.cfg
index d3b838171b..56e6631865 100644
--- a/buildout/profiles/official.cfg
+++ b/buildout/profiles/official.cfg
@@ -19,6 +19,7 @@ extends =
   ../software-profiles/libtool.cfg
   ../software-profiles/memcached.cfg
   ../software-profiles/mysql-tritonn-5.0.cfg
+  ../software-profiles/sphinx.cfg
   ../software-profiles/ocropus.cfg
   ../software-profiles/oood.cfg
   ../software-profiles/openoffice-bin.cfg
@@ -45,6 +46,7 @@ parts =
   w3m
   xpdf
   mysql-tritonn-5.0
+  sphinx
   imagemagick
   zope-2.8
   cmf15
diff --git a/buildout/profiles/software-definition.cfg b/buildout/profiles/software-definition.cfg
index 3ad8425289..2555545285 100644
--- a/buildout/profiles/software-definition.cfg
+++ b/buildout/profiles/software-definition.cfg
@@ -10,6 +10,7 @@ data-bin-directory = ${:var-directory}/bin
 
 [software_definition]
 mysql_software = ${:software_home}/parts/mysql-tritonn-5.0
+sphinx_software = ${:software_home}/parts/sphinx
 oood_software = ${:software_home}/parts/oood
 openoffice_software = ${:software_home}/parts/openoffice-bin
 zope_software = ${:software_home}/parts/zope-2.8
-- 
2.30.9