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"
|
2017-03-05 14:57:55 +00:00
|
|
|
homepage "https://beyondgrep.com/"
|
2018-06-22 06:07:39 +00:00
|
|
|
url "https://beyondgrep.com/ack-2.24-single-file"
|
|
|
|
version "2.24"
|
|
|
|
sha256 "8361e5a2654bc575db27bfa40470c4182d74d51098d390944d98fe7cd5b20d49"
|
2016-09-24 15:45:48 +00:00
|
|
|
head "https://github.com/petdance/ack2.git", :branch => "dev"
|
2015-05-08 20:08:29 +00:00
|
|
|
|
2018-05-03 06:25:37 +00:00
|
|
|
devel do
|
|
|
|
url "https://beyondgrep.com/ack-2.999_03-single-file"
|
|
|
|
version "2.999-03"
|
|
|
|
sha256 "7e75bbe0baffac14aa7798198faa2184241990a72ff0150f157ef6296a148e3c"
|
|
|
|
end
|
|
|
|
|
2015-12-19 05:07:10 +00:00
|
|
|
bottle :unneeded
|
|
|
|
|
2015-05-08 20:08:29 +00:00
|
|
|
resource "File::Next" do
|
2018-05-03 06:25:37 +00:00
|
|
|
url "https://cpan.metacpan.org/authors/id/P/PE/PETDANCE/File-Next-1.16.tar.gz"
|
|
|
|
sha256 "6965f25c2c132d0ba7a6f72b57b8bc6d25cf8c1b7032caa3a9bda8612e41d759"
|
2015-05-08 20:08:29 +00:00
|
|
|
end
|
|
|
|
|
2010-09-01 17:45:26 +00:00
|
|
|
def install
|
2018-05-03 06:25:37 +00:00
|
|
|
if build.stable? || build.devel?
|
|
|
|
bin.install "ack-#{version.to_s.tr("-", "_")}-single-file" => "ack"
|
2015-05-08 20:08:29 +00:00
|
|
|
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"
|
2016-09-24 15:45:48 +00:00
|
|
|
(bin/"ack").write_env_script("#{libexec}/ack", :PERL5LIB => ENV["PERL5LIB"])
|
2015-05-08 20:08:29 +00:00
|
|
|
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 -",
|
2015-10-06 04:48:09 +00:00
|
|
|
"foo\nfoo bar\nbaz")
|
2013-01-27 22:36:42 +00:00
|
|
|
end
|
2009-09-22 19:10:17 +00:00
|
|
|
end
|