Permalink
Browse files

Merge pull request #6 from freelancing-god/master

Sphinx recipes
  • Loading branch information...
2 parents f8fe19f + e8c44bc commit c544ea39bd38bd0f54007d3e7a1e09e02825b476 @michaelklishin michaelklishin committed Aug 4, 2011
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'

0 comments on commit c544ea3

Please sign in to comment.