diff options
| -rw-r--r-- | Library/Formula/mysql.rb | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/Library/Formula/mysql.rb b/Library/Formula/mysql.rb index 662d8320d..75bfb5539 100644 --- a/Library/Formula/mysql.rb +++ b/Library/Formula/mysql.rb @@ -18,6 +18,10 @@ class Mysql <Formula ] end + def patches + {:p1 => "http://gist.github.com/raw/179616/bcbc9f185bbd353934c9379a253d23269c65170e/Diff"} + end + def install ENV['CXXFLAGS'] = ENV['CXXFLAGS'].gsub "-fomit-frame-pointer", "" ENV['CXXFLAGS'] += " -fno-omit-frame-pointer -felide-constructors" @@ -28,6 +32,7 @@ class Mysql <Formula "--without-debug", "--disable-dependency-tracking", "--prefix=#{prefix}", + "--localstatedir=#{var}", "--with-plugins=innobase,myisam", "--with-extra-charsets=complex", "--with-plugins=innobase,myisam", @@ -37,9 +42,7 @@ class Mysql <Formula "--enable-local-infile", "--enable-shared"] - if ARGV.include? '--client-only' - configure_args.push("--without-server") - end + configure_args << "--without-server" if ARGV.include? '--client-only' system "./configure", *configure_args system "make install" @@ -49,5 +52,38 @@ class Mysql <Formula # save 66MB! (prefix+'mysql-test').rmtree unless ARGV.include? '--with-tests' + + var.mkpath + + (prefix+'com.mysql.mysqld.plist').write startup_plist + end + + def caveats + puts "Set up databases with `mysql_install_db`" + puts "Automatically load on login with " + puts " `launchctl load -w #{prefix}/com.mysql.mysqld.plist`" + end + + def startup_plist + return <<-EOPLIST +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>KeepAlive</key> + <true/> + <key>Label</key> + <string>com.mysql.mysqld</string> + <key>Program</key> + <string>#{bin}/mysqld_safe</string> + <key>RunAtLoad</key> + <true/> + <key>UserName</key> + <string>#{`whoami`}</string> + <key>WorkingDirectory</key> + <string>/usr/local</string> +</dict> +</plist> + EOPLIST end end |
