Sha256: b86d56056b96e84490f7f8b4a059d23f2cab25da709510ad4328321e5eca4264

Contents?: true

Size: 1.51 KB

Versions: 3

Compression:

Stored size: 1.51 KB

Contents

namespace :sphinx do
  
  namespace :centos do
    
    desc <<-DESC
    Install sphinx.\n
    *sphinx_build_options*: Sphinx build options.\n
    *sphinx_prefix*: Sphinx install prefix. _Defaults to "/usr/local/sphinx"_\n
    DESC
    task :install do 
      
      # Settings
      fetch(:sphinx_build_options)
      fetch_or_default(:sphinx_prefix, "/usr/local/sphinx")
      
      # Install dependencies
      yum.install([ "gcc-c++" ])
      
      # Build
      script.make_install("sphinx", sphinx_build_options)
    end
        
    desc <<-DESC
    Setup sphinx for application.\n    
    *sphinx_prefix*: Sphinx install prefix. _Defaults to "/usr/local/sphinx"_\n
    *sphinx_pid_path*: Directory to sphinx pid. _Defaults to "[shared_path]/pids/searchd.pid"_\n
    *sphinx_conf_path*: Path to sphinx.conf. _Defaults to "[shared_path]/config/sphinx.conf"_\n
    DESC
    task :setup do       
      
      # Settings
      fetch_or_default(:sphinx_prefix, "/usr/local/sphinx")
      fetch_or_default(:sphinx_pid_path, "#{shared_path}/pids/searchd.pid")
      fetch_or_default(:sphinx_conf_path, "#{shared_path}/config/sphinx.conf")      

      # Install initscript
      put template.load("sphinx/sphinx_app.initd.centos.erb"), "/tmp/sphinx.initd"
      run_via "install -o root /tmp/sphinx.initd /etc/init.d/sphinx_#{application}"

      # Enable service
      run_via "/sbin/chkconfig --level 345 sphinx_#{application} on"    

      # Create app indexes dir
      run_via "mkdir -p #{shared_path}/var/index"    
    end
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
capitate-0.2.1 lib/recipes/centos/sphinx.rb
capitate-0.2.2 lib/recipes/centos/sphinx.rb
capitate-0.2.3 lib/recipes/centos/sphinx.rb