homebrew-core/Formula/signal-cli.rb
Caleb Xu eb8cd25a22 signal-cli 0.6.5
Closes #48721.

Signed-off-by: Rui Chen <chenrui333@gmail.com>
2020-01-07 22:38:56 -05:00

31 lines
988 B
Ruby

class SignalCli < Formula
desc "CLI and dbus interface for WhisperSystems/libsignal-service-java"
homepage "https://github.com/AsamK/signal-cli"
url "https://github.com/AsamK/signal-cli/releases/download/v0.6.5/signal-cli-0.6.5.tar.gz"
sha256 "7bff4276e583ea3d0ad518423073142d92706c2498561786fb7cf5a626c25320"
bottle :unneeded
depends_on :java => "1.7+"
def install
libexec.install Dir["lib", "bin"]
(bin/"signal-cli").write_env_script libexec/"bin/signal-cli", Language::Java.java_home_env("1.7+")
end
test do
# test 1: checks class loading is working and version is correct
output = shell_output("#{bin}/signal-cli --version")
assert_match "signal-cli #{version}", output
# test 2: ensure crypto is working
begin
io = IO.popen("#{bin}/signal-cli link", :err => [:child, :out])
sleep 8
ensure
Process.kill("SIGINT", io.pid)
Process.wait(io.pid)
end
assert_match "tsdevice:/?uuid=", io.read
end
end