From e72f9f35dbc6f8a3d90cab02e992e1fc4c25449f Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Mon, 13 Aug 2012 15:40:11 -0500 Subject: mariadb: use options DSL Signed-off-by: Jack Nagel --- Library/Formula/mariadb.rb | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'Library/Formula') diff --git a/Library/Formula/mariadb.rb b/Library/Formula/mariadb.rb index 1e0a62b10..00b7a2bb9 100644 --- a/Library/Formula/mariadb.rb +++ b/Library/Formula/mariadb.rb @@ -1,12 +1,17 @@ require 'formula' class Mariadb < Formula - url 'http://ftp.osuosl.org/pub/mariadb/mariadb-5.3.7/kvm-tarbake-jaunty-x86/mariadb-5.3.7.tar.gz' homepage 'http://mariadb.org/' + url 'http://ftp.osuosl.org/pub/mariadb/mariadb-5.3.7/kvm-tarbake-jaunty-x86/mariadb-5.3.7.tar.gz' sha1 '1ee2ef4895aefabd66b4884c382ba2cd1f7bbe2d' depends_on 'readline' + option :universal + option 'with-tests', 'Keep test when installing' + option 'with-bench', 'Keep benchmark app when installing' + option 'client-only', 'Install only client tools' + conflicts_with 'mysql', :because => "mariadb and mysql install the same binaries." conflicts_with 'percona-server', @@ -16,20 +21,11 @@ class Mariadb < Formula build 421 end - def options - [ - ['--with-tests', "Keep tests when installing."], - ['--with-bench', "Keep benchmark app when installing."], - ['--client-only', "Only install client tools, not the server."], - ['--universal', "Make mariadb a universal binary"] - ] - end - def install ENV.append 'CXXFLAGS', '-fno-omit-frame-pointer -felide-constructors' # Make universal for bindings to universal applications - ENV.universal_binary if ARGV.build_universal? + ENV.universal_binary if build.universal? configure_args = [ "--without-docs", @@ -52,7 +48,7 @@ class Mariadb < Formula "--with-libevent", ] - configure_args << "--without-server" if ARGV.include? '--client-only' + configure_args << "--without-server" if build.include? 'client-only' system "./configure", *configure_args system "make install" @@ -60,8 +56,8 @@ class Mariadb < Formula bin.install_symlink "#{libexec}/mysqld" bin.install_symlink "#{share}/mysql/mysql.server" - (prefix+'mysql-test').rmtree unless ARGV.include? '--with-tests' # save 121MB! - (prefix+'sql-bench').rmtree unless ARGV.include? '--with-bench' + (prefix+'mysql-test').rmtree unless build.include? 'with-tests' # save 121MB! + (prefix+'sql-bench').rmtree unless build.include? 'with-bench' plist_path.write startup_plist plist_path.chmod 0644 -- cgit v1.2.3