class Innotop < Formula desc "Top clone for MySQL" homepage "https://github.com/innotop/innotop/" url "https://github.com/innotop/innotop/archive/v1.11.4.tar.gz" sha256 "fb0d7d2558e2198d9224b44dc4220d4c62e1b5b0069312012306275be39b4ab9" head "https://github.com/innotop/innotop.git" bottle do cellar :any sha256 "9fade33d5b830033b3cbbe6698d9b5115c8eb931a3feecb6667f18481046af89" => :high_sierra sha256 "d1bf5e48162b71e8f19dca2d31f19140e5c4cc54f524c528cf0aa05b458626de" => :sierra sha256 "c9f84dbe941f5d6dcf9f0e4a8b2ef560b8565f21c431f039d445efe755c41a74" => :el_capitan sha256 "0c91367118f50ef4e624e31837418dd07d09bf24f8cc91a6f143538a61a56b95" => :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.041.tar.gz" mirror "http://search.cpan.org/CPAN/authors/id/M/MI/MICHIELB/DBD-mysql-4.041.tar.gz" sha256 "4777de11c464b515db9da95c08c225900d0594b65ba3256982dc21f9f9379040" end resource "DBI" do url "https://cpan.metacpan.org/authors/id/T/TI/TIMB/DBI-1.636.tar.gz" mirror "http://search.cpan.org/CPAN/authors/id/T/TI/TIMB/DBI-1.636.tar.gz" sha256 "8f7ddce97c04b4b7a000e65e5d05f679c964d62c8b02c94c1a7d815bb2dd676c" end resource "TermReadKey" do url "https://cpan.metacpan.org/authors/id/J/JS/JSTOWE/TermReadKey-2.37.tar.gz" mirror "http://search.cpan.org/CPAN/authors/id/J/JS/JSTOWE/TermReadKey-2.37.tar.gz" sha256 "4a9383cf2e0e0194668fe2bd546e894ffad41d556b41d2f2f577c8db682db241" 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 # Disable dynamic selection of perl which may cause segfault when an # incompatible perl is picked up. inreplace "innotop", "#!/usr/bin/env perl", "#!/usr/bin/perl" system "perl", "Makefile.PL", "INSTALL_BASE=#{prefix}" system "make", "install" share.install prefix/"man" bin.env_script_all_files(libexec/"bin", :PERL5LIB => ENV["PERL5LIB"]) end test do # Calling commands throws up interactive GUI, which is a pain. assert_match version.to_s, shell_output("#{bin}/innotop --version") end end