aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2014-12-27 16:10:11 +0000
committerMike McQuaid2014-12-27 16:31:47 +0000
commit030a64267f0245d5aeb87566fa2c8492df6f41fa (patch)
treef0656c454dd26f6c1f052840fcad20f3930bd04e /Library
parent462b0cf70c6407a844d771699d9e55e1dfa19134 (diff)
downloadhomebrew-030a64267f0245d5aeb87566fa2c8492df6f41fa.tar.bz2
mysql: fix strict audit failures.
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/mysql.rb68
1 files changed, 35 insertions, 33 deletions
diff --git a/Library/Formula/mysql.rb b/Library/Formula/mysql.rb
index 93dbc0e95..5b79bf269 100644
--- a/Library/Formula/mysql.rb
+++ b/Library/Formula/mysql.rb
@@ -1,5 +1,3 @@
-require "formula"
-
class Mysql < Formula
homepage "http://dev.mysql.com/doc/refman/5.6/en/"
url "http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.22.tar.gz"
@@ -12,22 +10,26 @@ class Mysql < Formula
end
option :universal
- option 'with-tests', 'Build with unit tests'
- option 'with-embedded', 'Build the embedded server'
- option 'with-archive-storage-engine', 'Compile with the ARCHIVE storage engine enabled'
- option 'with-blackhole-storage-engine', 'Compile with the BLACKHOLE storage engine enabled'
- option 'enable-local-infile', 'Build with local infile loading support'
- option 'enable-memcached', 'Enable innodb-memcached support'
- option 'enable-debug', 'Build with debug support'
-
- depends_on 'cmake' => :build
- depends_on 'pidof' unless MacOS.version >= :mountain_lion
- depends_on 'openssl'
-
- conflicts_with 'mysql-cluster', 'mariadb', 'percona-server',
+ option "with-tests", "Build with unit tests"
+ option "with-embedded", "Build the embedded server"
+ option "with-archive-storage-engine", "Compile with the ARCHIVE storage engine enabled"
+ option "with-blackhole-storage-engine", "Compile with the BLACKHOLE storage engine enabled"
+ option "with-local-infile", "Build with local infile loading support"
+ option "with-memcached", "Enable innodb-memcached support"
+ option "with-debug", "Build with debug support"
+
+ deprecated_option "enable-local-infile" => "with-local-infile"
+ deprecated_option "enable-memcached" => "with-memcached"
+ deprecated_option "enable-debug" => "with-debug"
+
+ depends_on "cmake" => :build
+ depends_on "pidof" unless MacOS.version >= :mountain_lion
+ depends_on "openssl"
+
+ conflicts_with "mysql-cluster", "mariadb", "percona-server",
:because => "mysql, mariadb, and percona install the same binaries."
- conflicts_with 'mysql-connector-c',
- :because => 'both install MySQL client libraries'
+ conflicts_with "mysql-connector-c",
+ :because => "both install MySQL client libraries"
fails_with :llvm do
build 2326
@@ -35,7 +37,7 @@ class Mysql < Formula
end
def install
- # Don't hard-code the libtool path. See:
+ # Don"t hard-code the libtool path. See:
# https://github.com/Homebrew/homebrew/issues/20185
inreplace "cmake/libutils.cmake",
"COMMAND /usr/bin/libtool -static -o ${TARGET_LOCATION}",
@@ -67,20 +69,20 @@ class Mysql < Formula
]
# To enable unit testing at build, we need to download the unit testing suite
- if build.with? 'tests'
+ if build.with? "tests"
args << "-DENABLE_DOWNLOADS=ON"
else
args << "-DWITH_UNIT_TESTS=OFF"
end
# Build the embedded server
- args << "-DWITH_EMBEDDED_SERVER=ON" if build.with? 'embedded'
+ args << "-DWITH_EMBEDDED_SERVER=ON" if build.with? "embedded"
# Compile with ARCHIVE engine enabled if chosen
- args << "-DWITH_ARCHIVE_STORAGE_ENGINE=1" if build.with? 'archive-storage-engine'
+ args << "-DWITH_ARCHIVE_STORAGE_ENGINE=1" if build.with? "archive-storage-engine"
# Compile with BLACKHOLE engine enabled if chosen
- args << "-DWITH_BLACKHOLE_STORAGE_ENGINE=1" if build.with? 'blackhole-storage-engine'
+ args << "-DWITH_BLACKHOLE_STORAGE_ENGINE=1" if build.with? "blackhole-storage-engine"
# Make universal for binding to universal applications
if build.universal?
@@ -89,21 +91,21 @@ class Mysql < Formula
end
# Build with local infile loading support
- args << "-DENABLED_LOCAL_INFILE=1" if build.include? 'enable-local-infile'
+ args << "-DENABLED_LOCAL_INFILE=1" if build.with? "local-infile"
# Build with memcached support
- args << "-DWITH_INNODB_MEMCACHED=1" if build.include? 'enable-memcached'
+ args << "-DWITH_INNODB_MEMCACHED=1" if build.with? "memcached"
# Build with debug support
- args << "-DWITH_DEBUG=1" if build.include? 'enable-debug'
+ args << "-DWITH_DEBUG=1" if build.with? "debug"
system "cmake", *args
system "make"
- system "make install"
+ system "make", "install"
- # Don't create databases inside of the prefix!
+ # Don"t create databases inside of the prefix!
# See: https://github.com/Homebrew/homebrew/issues/4975
- rm_rf prefix+'data'
+ rm_rf prefix+"data"
# Link the setup script into bin
bin.install_symlink prefix/"scripts/mysql_install_db"
@@ -112,7 +114,7 @@ class Mysql < Formula
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
+ s.gsub!(/pidof/, "pgrep") if MacOS.version >= :mountain_lion
end
bin.install_symlink prefix/"support-files/mysql.server"
@@ -127,8 +129,8 @@ class Mysql < Formula
# Make sure the var/mysql directory exists
(var+"mysql").mkpath
unless File.exist? "#{var}/mysql/mysql/user.frm"
- ENV['TMPDIR'] = nil
- system "#{bin}/mysql_install_db", '--verbose', "--user=#{ENV['USER']}",
+ ENV["TMPDIR"] = nil
+ system "#{bin}/mysql_install_db", "--verbose", "--user=#{ENV["USER"]}",
"--basedir=#{prefix}", "--datadir=#{var}/mysql", "--tmpdir=/tmp"
end
end
@@ -169,8 +171,8 @@ class Mysql < Formula
end
test do
- (prefix+'mysql-test').cd do
- system './mysql-test-run.pl', 'status'
+ (prefix+"mysql-test").cd do
+ system "./mysql-test-run.pl", "status"
end
end
end