homebrew-core/Formula/zshdb.rb
Baptiste Fontaine 03d94ad114 zshdb: modernize + test
Closes Homebrew/homebrew#35416.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-01-01 14:27:34 +00:00

33 lines
857 B
Ruby

class Zshdb < Formula
homepage "https://github.com/rocky/zshdb"
url "https://downloads.sourceforge.net/project/bashdb/zshdb/0.08/zshdb-0.08.tar.bz2"
sha1 "29f860d0130debe6a966ee1e12f2f3046c78897b"
head do
url "https://github.com/rocky/zshdb.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
end
depends_on "zsh"
def install
if build.head?
system "autoreconf", "-fvi"
system "autoconf"
end
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--with-zsh=#{HOMEBREW_PREFIX}/bin/zsh"
system "make", "install"
end
test do
require "open3"
Open3.popen3("#{bin}/zshdb -c 'echo test'") do |stdin, stdout, _|
stdin.write "exit\n"
!!(stdout.read =~ /That's all, folks/)
end
end
end