Skip to content
Browse files

First attempt at Sphinx recipes. Not DRY at all, mind you.

  • Loading branch information...
1 parent a81efd0 commit 076fbbd5737850628b1fcbe901dcf2f0645a05aa @pat pat committed Aug 2, 2011
View
0 vagrant_base/sphinx/README.md
No changes.
View
15 vagrant_base/sphinx/metadata.rb
@@ -0,0 +1,15 @@
+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 and configures Sphinx 2.0.1-beta'
+recipe 'sphinx::sphinx-1.10', 'Installs and configures Sphinx 1.10-beta'
+recipe 'sphinx::sphinx-0.9.9', 'Installs and configures Sphinx 0.9.9'
+
+%w{ ubuntu debian }.each do |os|
+ supports os
+end
View
42 vagrant_base/sphinx/recipes/default.rb
@@ -0,0 +1,42 @@
+package "libmysql++-dev" do
+ action :install
+end
+
+package "postgresql-client" do
+ action :install
+end
+
+package "libpq-dev" do
+ action :install
+end
+
+
+directory '/tmp/sphinx_install' do
+ mode '0755'
+ action :create
+end
+
+remote_file "/tmp/sphinx_install/sphinx-2.0.1.tar.gz" do
+ source "http://www.sphinxsearch.com/files/sphinx-2.0.1-beta.tar.gz"
+ mode "0644"
+ action :create_if_missing
+end
+
+execute "untar sphinx archive" do
+ command "tar xvfz sphinx-2.0.1.tar.gz"
+ cwd "/tmp/sphinx_install"
+end
+
+execute "Download libstemmer" do
+ command 'curl -O http://snowball.tartarus.org/dist/libstemmer_c.tgz'
+ cwd '/tmp/sphinx_install/sphinx-2.0.1'
+end
+
+execute "Untar libstemmer" do
+ command 'tar zxvf libstemmer_c.tgz'
+ cwd '/tmp/sphinx_install/sphinx-2.0.1'
+end
+
+execute './configure --with-mysql --with-pgsql --with-libstemmer --prefix=/usr/local && make && make install' do
+ cwd '/tmp/sphinx_install/sphinx-2.0.1'
+end
View
42 vagrant_base/sphinx/recipes/sphinx-0.9.9.rb
@@ -0,0 +1,42 @@
+package "libmysql++-dev" do
+ action :install
+end
+
+package "postgresql-client" do
+ action :install
+end
+
+package "libpq-dev" do
+ action :install
+end
+
+
+directory '/tmp/sphinx_install' do
+ mode '0755'
+ action :create
+end
+
+remote_file "/tmp/sphinx_install/sphinx-0.9.9.tar.gz" do
+ source "http://www.sphinxsearch.com/files/sphinx-0.9.9.tar.gz"
+ mode "0644"
+ action :create_if_missing
+end
+
+execute "untar sphinx archive" do
+ command "tar xvfz sphinx-0.9.9.tar.gz"
+ cwd "/tmp/sphinx_install"
+end
+
+execute "Download libstemmer" do
+ command 'curl -O http://snowball.tartarus.org/dist/libstemmer_c.tgz'
+ cwd '/tmp/sphinx_install/sphinx-0.9.9'
+end
+
+execute "Untar libstemmer" do
+ command 'tar zxvf libstemmer_c.tgz'
+ cwd '/tmp/sphinx_install/sphinx-0.9.9'
+end
+
+execute './configure --with-mysql --with-pgsql --with-libstemmer --prefix=/usr/local/sphinx-0.9.9 && make && make install' do
+ cwd '/tmp/sphinx_install/sphinx-0.9.9'
+end
View
42 vagrant_base/sphinx/recipes/sphinx-1.10.rb
@@ -0,0 +1,42 @@
+package "libmysql++-dev" do
+ action :install
+end
+
+package "postgresql-client" do
+ action :install
+end
+
+package "libpq-dev" do
+ action :install
+end
+
+
+directory '/tmp/sphinx_install' do
+ mode '0755'
+ action :create
+end
+
+remote_file "/tmp/sphinx_install/sphinx-1.10.tar.gz" do
+ source "http://www.sphinxsearch.com/files/sphinx-1.10-beta.tar.gz"
+ mode "0644"
+ action :create_if_missing
+end
+
+execute "untar sphinx archive" do
+ command "tar xvfz sphinx-1.10.tar.gz"
+ cwd "/tmp/sphinx_install"
+end
+
+execute "Download libstemmer" do
+ command 'curl -O http://snowball.tartarus.org/dist/libstemmer_c.tgz'
+ cwd '/tmp/sphinx_install/sphinx-1.10'
+end
+
+execute "Untar libstemmer" do
+ command 'tar zxvf libstemmer_c.tgz'
+ cwd '/tmp/sphinx_install/sphinx-1.10'
+end
+
+execute './configure --with-mysql --with-pgsql --with-libstemmer --prefix=/usr/local/sphinx-1.10 && make && make install' do
+ cwd '/tmp/sphinx_install/sphinx-1.10'
+end

0 comments on commit 076fbbd

Please sign in to comment.
Something went wrong with that request. Please try again.