class Mytop < Formula desc "Top-like query monitor for MySQL" homepage "http://www.mysqlfanboy.com/mytop-3/" url "http://www.mysqlfanboy.com/mytop-3/mytop-1.9.1.tar.gz" mirror "https://mirrorservice.org/sites/ftp.debian.org/debian/pool/main/m/mytop/mytop_1.9.1.orig.tar.gz" mirror "https://mirrors.ocf.berkeley.edu/debian/pool/main/mytop/mytop_1.9.1.orig.tar.gz" sha256 "179d79459d0013ab9cea2040a41c49a79822162d6e64a7a85f84cdc44828145e" revision 2 bottle do cellar :any sha256 "97141d4fee3c92c39263f48273cd459042d539c14c684bb89110f85eb7e58d18" => :sierra sha256 "672c4f9115cc23baca9522bb4bca10908a3f45d527d176710d2bfa9c79e40758" => :el_capitan sha256 "cf55483653ab53f64f6cd287a5b88e090f0f413229626f33f4f7533aa4580864" => :yosemite sha256 "76f9ef9fb495f66d596dcec0f8ba9b2d2e43349432b164dddf6a2dde09e2632b" => :mavericks end depends_on :mysql depends_on "openssl" conflicts_with "mariadb", :because => "both install `mytop` binaries" resource "List::Util" do url "https://cpan.metacpan.org/authors/id/P/PE/PEVANS/Scalar-List-Utils-1.45.tar.gz" mirror "http://search.cpan.org/CPAN/authors/id/P/PE/PEVANS/Scalar-List-Utils-1.45.tar.gz" sha256 "9e175535913af22d003ce1ef896d98d9bb6fc1d551782a3b512c066da5bd27dd" end resource "Config::IniFiles" do url "https://cpan.metacpan.org/authors/id/S/SH/SHLOMIF/Config-IniFiles-2.93.tar.gz" mirror "http://search.cpan.org/CPAN/authors/id/S/SH/SHLOMIF/Config-IniFiles-2.93.tar.gz" sha256 "2fc79e5616c176b97f49f3d57b8d8068695639209ff9de7aa7f28a550d0478e4" end resource "DBD::mysql" do url "https://cpan.metacpan.org/authors/id/M/MI/MICHIELB/DBD-mysql-4.035.tar.gz" mirror "http://search.cpan.org/CPAN/authors/id/M/MI/MICHIELB/DBD-mysql-4.035.tar.gz" sha256 "b7eca365ea16bcf4c96c2fc0221304ff9c4995e7a551886837804a8f66b61937" end # Pick up some patches from Debian to improve functionality & fix # some syntax warnings when using recent versions of Perl. patch do url "https://mirrorservice.org/sites/ftp.debian.org/debian/pool/main/m/mytop/mytop_1.9.1-2.debian.tar.xz" mirror "https://mirrors.ocf.berkeley.edu/debian/pool/main/m/mytop/mytop_1.9.1-2.debian.tar.xz" sha256 "9c97b7d2a2d4d169c5f263ce0adb6340b71e3a0afd4cdde94edcead02421489a" apply "patches/01_fix_pod.patch", "patches/02_remove_db_test.patch", "patches/03_fix_newlines.patch", "patches/04_fix_unitialized.patch", "patches/05_prevent_ctrl_char_printing.patch", "patches/06_fix_screenwidth.patch", "patches/07_add_doc_on_missing_cli_options.patch", "patches/08_add_mycnf.patch", "patches/09_q_is_quit.patch", "patches/10_fix_perl_warnings.patch", "patches/13_fix_scope_for_show_slave_status_data.patch" 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 assert_match "username you specified", pipe_output("#{bin}/mytop 2>&1") end end