diff options
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/mariadb.rb | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/Library/Formula/mariadb.rb b/Library/Formula/mariadb.rb index e280a8262..37ba9e154 100644 --- a/Library/Formula/mariadb.rb +++ b/Library/Formula/mariadb.rb @@ -89,29 +89,31 @@ class Mariadb < Formula system "make" system "make install" - # Don't create databases inside of the prefix! - # See: https://github.com/mxcl/homebrew/issues/4975 - rm_rf prefix+'data' - - (prefix+'mysql-test').rmtree unless build.include? 'with-tests' # save 121MB! - (prefix+'sql-bench').rmtree unless build.include? 'with-bench' - - # Link the setup script into bin - ln_s prefix+'scripts/mysql_install_db', bin+'mysql_install_db' - - # Fix up the control script and link into bin - inreplace "#{prefix}/support-files/mysql.server" do |s| - s.gsub!(/^(PATH=".*)(")/, "\\1:#{HOMEBREW_PREFIX}/bin\\2") - # pidof can be replaced with pgrep from proctools on Mountain Lion - s.gsub!(/pidof/, 'pgrep') if MacOS.version >= :mountain_lion + unless build.include? 'client-only' + # Don't create databases inside of the prefix! + # See: https://github.com/mxcl/homebrew/issues/4975 + rm_rf prefix+'data' + + (prefix+'mysql-test').rmtree unless build.include? 'with-tests' # save 121MB! + (prefix+'sql-bench').rmtree unless build.include? 'with-bench' + + # Link the setup script into bin + ln_s prefix+'scripts/mysql_install_db', bin+'mysql_install_db' + + # Fix up the control script and link into bin + inreplace "#{prefix}/support-files/mysql.server" do |s| + s.gsub!(/^(PATH=".*)(")/, "\\1:#{HOMEBREW_PREFIX}/bin\\2") + # pidof can be replaced with pgrep from proctools on Mountain Lion + s.gsub!(/pidof/, 'pgrep') if MacOS.version >= :mountain_lion + end + + # Fix my.cnf to point to #{etc} instead of /etc + inreplace "#{etc}/my.cnf" do |s| + s.gsub!("!includedir /etc/my.cnf.d", "!includedir #{etc}/my.cnf.d") + end + + ln_s "#{prefix}/support-files/mysql.server", bin end - - # Fix my.cnf to point to #{etc} instead of /etc - inreplace "#{etc}/my.cnf" do |s| - s.gsub!("!includedir /etc/my.cnf.d", "!includedir #{etc}/my.cnf.d") - end - - ln_s "#{prefix}/support-files/mysql.server", bin end def caveats; <<-EOS.undent |
