diff options
| author | Adam Vandenberg | 2013-06-15 11:35:50 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2013-06-15 11:36:02 -0700 |
| commit | 7941829a9c151bb3260186f674cc8a46881953ec (patch) | |
| tree | c84142ca5f65b9d75682b527fb0fb15a0594d499 /Library | |
| parent | faa35b4fcd840a0c4644075ddff97dc65caef369 (diff) | |
| download | homebrew-7941829a9c151bb3260186f674cc8a46881953ec.tar.bz2 | |
mariadb: guard post-install for client-only builds
Closes #20519.
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 |
