50 lines
1.9 KiB
Ruby
50 lines
1.9 KiB
Ruby
class PerconaToolkit < Formula
|
|
desc "Percona Toolkit for MySQL"
|
|
homepage "https://www.percona.com/software/percona-toolkit/"
|
|
url "https://www.percona.com/downloads/percona-toolkit/3.0.3/source/tarball/percona-toolkit-3.0.3.tar.gz"
|
|
sha256 "f1da1d6c3ad04875806f55ad2aa0706a10bc7f22fb55307ee97c169296276e0e"
|
|
head "lp:percona-toolkit", :using => :bzr
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "a5643929d04349f4618f2daff00268f3dc5274f149f6f6d7d5a6c68a8b67b3c1" => :sierra
|
|
sha256 "675125ad200de1571bf55387c662708f786d2b5261de67457be1803a68558af8" => :el_capitan
|
|
sha256 "a4a2ff61ac3c22367caf6d413ec9ac99c2f0afbbe570ced8017dec998bb30434" => :yosemite
|
|
end
|
|
|
|
depends_on :mysql
|
|
depends_on "openssl"
|
|
|
|
resource "DBD::mysql" do
|
|
url "https://cpan.metacpan.org/authors/id/M/MI/MICHIELB/DBD-mysql-4.043.tar.gz"
|
|
mirror "http://search.cpan.org/CPAN/authors/id/M/MI/MICHIELB/DBD-mysql-4.043.tar.gz"
|
|
sha256 "629f865e8317f52602b2f2efd2b688002903d2e4bbcba5427cb6188b043d6f99"
|
|
end
|
|
|
|
resource "JSON" do
|
|
url "https://cpan.metacpan.org/authors/id/I/IS/ISHIGAKI/JSON-2.94.tar.gz"
|
|
mirror "http://search.cpan.org/CPAN/authors/id/I/IS/ISHIGAKI/JSON-2.94.tar.gz"
|
|
sha256 "12271b5cee49943bbdde430eef58f1fe64ba6561980b22c69585e08fc977dc6d"
|
|
end
|
|
|
|
def install
|
|
ENV.prepend_create_path "PERL5LIB", libexec/"lib/perl5"
|
|
resources.each do |r|
|
|
r.stage do
|
|
system "perl", "Makefile.PL", "INSTALL_BASE=#{libexec}"
|
|
system "make", "install"
|
|
end
|
|
end
|
|
|
|
system "perl", "Makefile.PL", "INSTALL_BASE=#{prefix}"
|
|
system "make", "test", "install"
|
|
share.install prefix/"man"
|
|
bin.env_script_all_files(libexec/"bin", :PERL5LIB => ENV["PERL5LIB"])
|
|
end
|
|
|
|
test do
|
|
input = "SELECT name, password FROM user WHERE id='12823';"
|
|
output = pipe_output("#{bin}/pt-fingerprint", input, 0)
|
|
assert_equal "select name, password from user where id=?;", output.chomp
|
|
end
|
|
end
|