-
-
Save fedesilva/2791033 to your computer and use it in GitHub Desktop.
HandlerSocket Homebrew
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Yay Ruby!!