From 0b7e7ddcfd9d25da988f3f4cbb9e353f5c42c769 Mon Sep 17 00:00:00 2001 From: MiZHGUN Date: Tue, 3 Mar 2015 13:55:35 +0300 Subject: [PATCH 1/4] Test version --- attributes/default.rb | 1 + recipes/default.rb | 1 + recipes/source.rb | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/attributes/default.rb b/attributes/default.rb index d1b3014..ae346da 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -6,6 +6,7 @@ default[:sphinx][:use_stemmer] = false default[:sphinx][:use_mysql] = false default[:sphinx][:use_percona] = false +default[:sphinx][:use_mariadb] = false default[:sphinx][:use_postgres] = false # Source Installation Settings diff --git a/recipes/default.rb b/recipes/default.rb index 51a0a8f..64b1b4a 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -1,4 +1,5 @@ include_recipe "percona::client" if node[:sphinx][:use_percona] include_recipe "mysql::client" if node[:sphinx][:use_mysql] +include_recipe "mariadb::client" if node[:sphinx][:use_mariadb] include_recipe "postgresql::client" if node[:sphinx][:use_postgres] include_recipe "sphinx::#{node[:sphinx][:install_method]}" diff --git a/recipes/source.rb b/recipes/source.rb index b74bf04..ce4da47 100644 --- a/recipes/source.rb +++ b/recipes/source.rb @@ -58,7 +58,7 @@ "--prefix=#{node[:sphinx][:source][:install_path]}", "--bindir=#{node[:sphinx][:source][:binary_path]}", node[:sphinx][:use_stemmer] ? '--with-libstemmer' : '--without-libstemmer', - (node[:sphinx][:use_mysql] or node[:sphinx][:use_percona]) ? '--with-mysql' : '--without-mysql', + (node[:sphinx][:use_mysql] or node[:sphinx][:use_percona] or node[:sphinx][:use_mariadb]) ? '--with-mysql' : '--without-mysql', node[:sphinx][:use_postgres] ? '--with-pgsql' : '--without-pgsql' ] end From 6b3e26cecd925809e98df20e59bba38a1d134d8c Mon Sep 17 00:00:00 2001 From: MiZHGUN Date: Tue, 3 Mar 2015 17:02:05 +0300 Subject: [PATCH 2/4] Added with-mysql-includes --- recipes/source.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/source.rb b/recipes/source.rb index ce4da47..b24b78f 100644 --- a/recipes/source.rb +++ b/recipes/source.rb @@ -59,7 +59,8 @@ "--bindir=#{node[:sphinx][:source][:binary_path]}", node[:sphinx][:use_stemmer] ? '--with-libstemmer' : '--without-libstemmer', (node[:sphinx][:use_mysql] or node[:sphinx][:use_percona] or node[:sphinx][:use_mariadb]) ? '--with-mysql' : '--without-mysql', - node[:sphinx][:use_postgres] ? '--with-pgsql' : '--without-pgsql' + node[:sphinx][:use_postgres] ? '--with-pgsql' : '--without-pgsql', + node[:sphinx][:use_mariadb] ? '--with-mysql-includes=/usr/include/mysql' : '' ] end From be94c8b1d890568aa3d4e8627a4b4744eb35c1ac Mon Sep 17 00:00:00 2001 From: MiZHGUN Date: Tue, 3 Mar 2015 18:19:40 +0300 Subject: [PATCH 3/4] Final version --- recipes/source.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/source.rb b/recipes/source.rb index b24b78f..20bc259 100644 --- a/recipes/source.rb +++ b/recipes/source.rb @@ -24,9 +24,10 @@ mode '0755' end + # Install required dependency when building from source # against Percona server -if node[:sphinx][:use_percona] +if (node[:sphinx][:use_percona] or node[:sphinx][:use_mariadb]) case node[:platform_family] when 'debian' package 'libssl-dev' @@ -59,8 +60,7 @@ "--bindir=#{node[:sphinx][:source][:binary_path]}", node[:sphinx][:use_stemmer] ? '--with-libstemmer' : '--without-libstemmer', (node[:sphinx][:use_mysql] or node[:sphinx][:use_percona] or node[:sphinx][:use_mariadb]) ? '--with-mysql' : '--without-mysql', - node[:sphinx][:use_postgres] ? '--with-pgsql' : '--without-pgsql', - node[:sphinx][:use_mariadb] ? '--with-mysql-includes=/usr/include/mysql' : '' + node[:sphinx][:use_postgres] ? '--with-pgsql' : '--without-pgsql' ] end From 976f0cabe0161031ceaddf16cdd105dc0332b63f Mon Sep 17 00:00:00 2001 From: MiZHGUN Date: Wed, 4 Mar 2015 12:16:09 +0300 Subject: [PATCH 4/4] Fixed formatting --- recipes/source.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/recipes/source.rb b/recipes/source.rb index 20bc259..bb738ab 100644 --- a/recipes/source.rb +++ b/recipes/source.rb @@ -24,9 +24,8 @@ mode '0755' end - # Install required dependency when building from source -# against Percona server +# against Percona and MariaDB servers if (node[:sphinx][:use_percona] or node[:sphinx][:use_mariadb]) case node[:platform_family] when 'debian'