2014-09-18 11:05:21 +00:00
|
|
|
class Keybase < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Command-line interface to Keybase.io"
|
2014-09-18 11:05:21 +00:00
|
|
|
homepage "https://keybase.io/"
|
2015-07-15 17:23:29 +00:00
|
|
|
url "https://github.com/keybase/node-client/archive/v0.8.9.tar.gz"
|
|
|
|
sha256 "2feb54d26afc639f4d4998fbc35aafa2100a9926a6ec4f84343ca56d0284a3dd"
|
2014-09-18 11:05:21 +00:00
|
|
|
head "https://github.com/keybase/node-client.git"
|
|
|
|
|
|
|
|
depends_on "node"
|
2015-01-18 13:31:30 +00:00
|
|
|
depends_on :gpg
|
2014-09-18 11:05:21 +00:00
|
|
|
|
|
|
|
def install
|
2015-03-28 04:59:49 +00:00
|
|
|
# remove self-update command
|
|
|
|
# https://github.com/keybase/keybase-issues/issues/1477
|
|
|
|
rm "lib/command/update.js"
|
|
|
|
inreplace "lib/command/all.js", '"update", ', ""
|
|
|
|
inreplace "lib/req.js", "keybase-installer", "brew update && brew upgrade keybase"
|
|
|
|
|
2014-09-18 11:05:21 +00:00
|
|
|
libexec.install Dir["*"]
|
|
|
|
(bin/"keybase").write <<-EOS.undent
|
|
|
|
#!/bin/sh
|
|
|
|
export KEYBASE_BIN="#{bin}/keybase"
|
2014-10-27 03:30:28 +00:00
|
|
|
exec "#{Formula["node"].opt_bin}/node" "#{libexec}/bin/main.js" "$@"
|
2014-09-18 11:05:21 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2015-07-04 23:07:09 +00:00
|
|
|
# Keybase requires a valid GPG keychain to be set up. Fetch Homebrew's pubkey.
|
|
|
|
system "gpg", "--keyserver", "pgp.mit.edu", "--recv-keys", "0xE33A3D3CCE59E297"
|
|
|
|
system "#{bin}/keybase", "id", "homebrew"
|
2014-09-18 11:05:21 +00:00
|
|
|
end
|
|
|
|
end
|