homebrew-core/Formula/authoscope.rb

47 lines
1.8 KiB
Ruby
Raw Normal View History

class Authoscope < Formula
desc "Scriptable network authentication cracker"
homepage "https://github.com/kpcyrd/authoscope"
url "https://github.com/kpcyrd/authoscope/archive/v0.8.0.tar.gz"
sha256 "977df6f08a2fece7076f362bc9db6686b829de93ed3c29806d7b841a50bd9d1c"
license "GPL-3.0-or-later"
2021-05-28 04:59:15 +00:00
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "1d62f93b6ba4ca88798e510ee70fa66c2c4b280ff20eabc5aaacc59166b3a83d"
sha256 cellar: :any_skip_relocation, big_sur: "fb5667604590e7f7aa5675866b03bba8cdb8649dd32f543a6853d70ca2d9ead5"
sha256 cellar: :any_skip_relocation, catalina: "c5c82345a6556076b1dd30e2b80ac51936ce8a910f4013f685b7207a7d9589fc"
sha256 cellar: :any_skip_relocation, mojave: "f618a86f7523021c5ca54730ea6b42bfc74d73a6d5e6a730e7f4d2b0028c2d6c"
end
depends_on "rust" => :build
depends_on "openssl@1.1"
uses_from_macos "zlib"
def install
# Ensure that the `openssl` crate picks up the intended library.
# https://crates.io/crates/openssl#manual-configuration
ENV["OPENSSL_DIR"] = Formula["openssl@1.1"].opt_prefix
system "cargo", "install", *std_cargo_args
man1.install "docs/authoscope.1"
bash_output = Utils.safe_popen_read(bin/"authoscope", "completions", "bash")
(bash_completion/"authoscope").write bash_output
zsh_output = Utils.safe_popen_read(bin/"authoscope", "completions", "zsh")
(zsh_completion/"_authoscope").write zsh_output
fish_output = Utils.safe_popen_read(bin/"authoscope", "completions", "fish")
(fish_completion/"authoscope.fish").write fish_output
end
test do
(testpath/"true.lua").write <<~EOS
descr = "always true"
function verify(user, password)
return true
end
EOS
system bin/"authoscope", "run", "-vvx", testpath/"true.lua", "foo"
end
end