2013-06-06 23:25:31 +00:00
|
|
|
class Ack < Formula
|
2015-08-01 09:35:45 +00:00
|
|
|
desc "Search tool like grep, but optimized for programmers"
|
2014-09-15 08:03:09 +00:00
|
|
|
homepage "http://beyondgrep.com/"
|
|
|
|
url "http://beyondgrep.com/ack-2.14-single-file"
|
2015-05-08 20:08:29 +00:00
|
|
|
sha256 "1d203cfbc52ce8f49e3992be1cd3e4d7d5dfb7daa3739e8628aa9858ccc5b9df"
|
2014-09-15 08:03:09 +00:00
|
|
|
version "2.14"
|
2010-09-01 17:45:26 +00:00
|
|
|
|
2015-05-08 20:08:29 +00:00
|
|
|
head "https://github.com/petdance/ack2.git", :branch => "dev"
|
|
|
|
|
|
|
|
devel do
|
|
|
|
url "https://cpan.metacpan.org/authors/id/P/PE/PETDANCE/ack-2.15_01.tar.gz"
|
|
|
|
sha256 "dfd1df3def5d3b16af8a7c585fc8954362d4f2b097891919490c89fdb484fd83"
|
2015-06-27 05:51:33 +00:00
|
|
|
version "2.15-01"
|
2015-05-08 20:08:29 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
resource "File::Next" do
|
|
|
|
url "https://cpan.metacpan.org/authors/id/P/PE/PETDANCE/File-Next-1.12.tar.gz"
|
|
|
|
sha256 "cc3afd8eaf6294aba93b8152a269cc36a9df707c6dc2c149aaa04dabd869e60a"
|
|
|
|
end
|
|
|
|
|
2010-09-01 17:45:26 +00:00
|
|
|
def install
|
2015-05-08 20:08:29 +00:00
|
|
|
if build.stable?
|
|
|
|
bin.install "ack-#{version}-single-file" => "ack"
|
|
|
|
system "pod2man", "#{bin}/ack", "ack.1"
|
|
|
|
man1.install "ack.1"
|
|
|
|
else
|
|
|
|
ENV.prepend_create_path "PERL5LIB", libexec/"lib/perl5"
|
|
|
|
ENV.prepend_path "PERL5LIB", libexec/"lib"
|
|
|
|
|
|
|
|
resource("File::Next").stage do
|
|
|
|
system "perl", "Makefile.PL", "INSTALL_BASE=#{libexec}"
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
|
|
|
|
system "perl", "Makefile.PL", "DESTDIR=#{buildpath}"
|
|
|
|
system "make"
|
|
|
|
|
|
|
|
libexec.install "ack"
|
|
|
|
chmod 0755, libexec/"ack"
|
|
|
|
(libexec/"lib").install "blib/lib/App"
|
|
|
|
(bin/"ack").write_env_script("#{libexec}/ack", :PERL5LIB => ENV["PERL5LIB"])
|
|
|
|
man1.install "blib/man1/ack.1"
|
|
|
|
end
|
2012-04-29 06:30:26 +00:00
|
|
|
end
|
2013-01-27 22:36:42 +00:00
|
|
|
|
|
|
|
test do
|
2014-05-04 19:12:41 +00:00
|
|
|
assert_equal "foo bar\n", pipe_output("#{bin}/ack --noenv --nocolor bar -",
|
|
|
|
"foo\nfoo bar\nbaz")
|
2013-01-27 22:36:42 +00:00
|
|
|
end
|
2009-09-22 19:10:17 +00:00
|
|
|
end
|