Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Sphinx recipes #6

Merged
merged 3 commits into from

2 participants

@pat
pat commented

Have put together some (now DRY) recipes for Sphinx. If possible, would be great to get sphinx::all as part of the Travis build (to test against multiple Sphinx versions).

2.0.1-beta is the latest release, recommended by the Sphinx team. 1.10-beta previously held that position, and 0.9.9 is the latest 'non-beta' release - all three are known to work fine in production. sphinx::all installs 2.0.1-beta into /usr/local, whereas the other two are placed into /usr/local/sphinx-#{version} - there if needed, but 2.0.1 is available without custom configuration.

If the recipes can be improved further, let me know.

@michaelklishin

you probably can just

include_recipe "postgresql::client"

here

@michaelklishin michaelklishin merged commit c544ea3 into travis-ci:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
0  vagrant_base/sphinx/README.md
No changes.
View
17 vagrant_base/sphinx/metadata.rb
@@ -0,0 +1,17 @@
+maintainer 'Pat Allan'
+maintainer_email 'pat@freelancing-gods.com'
+license 'MIT'
+description 'Installs stable and beta releases of Sphinx'
+long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
+version '0.1.0'
+depends 'build-essential'
+
+recipe 'sphinx', 'Installs Sphinx 2.0.1-beta'
+recipe 'sphinx:all', 'Installs Sphinx 2.0.1-beta, 1.10-beta and 0.9.9'
+recipe 'sphinx::sphinx-2.0.1', 'Installs Sphinx 2.0.1-beta'
+recipe 'sphinx::sphinx-1.10', 'Installs Sphinx 1.10-beta'
+recipe 'sphinx::sphinx-0.9.9', 'Installs Sphinx 0.9.9'
+
+%w{ ubuntu debian }.each do |os|
+ supports os
+end
View
13 vagrant_base/sphinx/recipes/all.rb
@@ -0,0 +1,13 @@
+node.set[:sphinx][:versions] = {
+ '2.0.1-beta' => '/usr/local/sphinx-2.0.1',
+ '1.10-beta' => '/usr/local/sphinx-1.10',
+ '0.9.9' => '/usr/local/sphinx-0.9.9'
+}
+
+include_recipe 'sphinx::install'
+
+%w( indexer indextool search searchd spelldump ).each do |binary|
+ link "/usr/local/bin/#{binary}" do
+ to "/usr/local/sphinx-2.0.1/bin/#{binary}"
+ end
+end
View
5 vagrant_base/sphinx/recipes/default.rb
@@ -0,0 +1,5 @@
+node.set[:sphinx][:versions] = {
+ '2.0.1-beta' => '/usr/local'
+}
+
+include_recipe 'sphinx::install'
View
38 vagrant_base/sphinx/recipes/install.rb
@@ -0,0 +1,38 @@
+package 'libmysql++-dev' do
+ action :install
+end
+
+package 'postgresql-client' do
+ action :install
+end
+
+package 'libpq-dev' do
+ action :install
+end
+
+script 'download libstemmer once' do
+ interpreter 'bash'
+ code <<-SHELL
+ mkdir -p /tmp/sphinx_install
+ cd /tmp/sphinx_install
+ wget http://snowball.tartarus.org/dist/libstemmer_c.tgz
+ SHELL
+end
+
+node.sphinx.versions.each do |version, path|
+ log("Installing Sphinx #{version} to #{path}") { level :debug }
+
+ script 'install sphinx with libstemmer' do
+ interpreter 'bash'
+ code <<-SHELL
+ cd /tmp/sphinx_install
+ wget http://www.sphinxsearch.com/files/sphinx-#{version}.tar.gz
+ tar zxvf sphinx-#{version}.tar.gz
+ cp libstemmer_c.tgz sphinx-#{version}/libstemmer_c.tgz
+ cd sphinx-#{version}
+ tar zxvf libstemmer_c.tgz
+ ./configure --with-mysql --with-pgsql --with-libstemmer --prefix=#{path}
+ make && make install
+ SHELL
+ end
+end
View
5 vagrant_base/sphinx/recipes/sphinx-0.9.9.rb
@@ -0,0 +1,5 @@
+node.set[:sphinx][:versions] = {
+ '0.9.9' => '/usr/local'
+}
+
+include_recipe 'sphinx::install'
View
5 vagrant_base/sphinx/recipes/sphinx-1.10.rb
@@ -0,0 +1,5 @@
+node.set[:sphinx][:versions] = {
+ '1.10-beta' => '/usr/local'
+}
+
+include_recipe 'sphinx::install'
View
5 vagrant_base/sphinx/recipes/sphinx-2.0.1.rb
@@ -0,0 +1,5 @@
+node.set[:sphinx][:versions] = {
+ '2.0.1-beta' => '/usr/local'
+}
+
+include_recipe 'sphinx::install'
Something went wrong with that request. Please try again.