Skip to content

Instantly share code, notes, and snippets.

@miyucy
Created May 14, 2011 21:13
Show Gist options
  • Save miyucy/972646 to your computer and use it in GitHub Desktop.
Save miyucy/972646 to your computer and use it in GitHub Desktop.
HandlerSocket Homebrew
require 'formula'
require 'tmpdir'
class Handlersocket < Formula
url 'https://github.com/ahiguti/HandlerSocket-Plugin-for-MySQL/tarball/1.0.6'
homepage 'https://github.com/ahiguti/HandlerSocket-Plugin-for-MySQL'
md5 '57f5c131e3d29701b01dd92c35ed25fd'
MYSQL_VERSION = '5.5.10'
depends_on 'mysql'
def extract_mysql
tarball = File.join HOMEBREW_CACHE, "mysql-#{MYSQL_VERSION}.tar.gz"
raise unless FileTest.exist? tarball
Dir.chdir mysql_source_dir do
safe_system "/usr/bin/tar", "xf", tarball
end
end
def mysql_source_dir
unless @mysql_source_dir
@mysql_source_dir = Dir.mktmpdir 'handlersocket'
# at_exit{ FileUtils.remove_entry_secure @mysql_source_dir }
end
@mysql_source_dir
end
def install
extract_mysql
system "./autogen.sh"
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}", "--with-mysql-source=#{mysql_source_dir}/mysql-#{MYSQL_VERSION}",
"--with-mysql-bindir=#{HOMEBREW_PREFIX}/bin"
system "make install"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment