47 lines
1.5 KiB
Ruby
47 lines
1.5 KiB
Ruby
# Please don't update this formula until the release is official via
|
|
# mailing list or blog post. There's a history of GitHub tags moving around.
|
|
# https://github.com/hashicorp/vault/issues/1051
|
|
class Vault < Formula
|
|
desc "Secures, stores, and tightly controls access to secrets"
|
|
homepage "https://vaultproject.io/"
|
|
url "https://github.com/hashicorp/vault.git",
|
|
:tag => "v0.10.2",
|
|
:revision => "3ee0802ed08cb7f4046c2151ec4671a076b76166"
|
|
head "https://github.com/hashicorp/vault.git"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "dc897767e02b1be83d87c086210bed3ada83b72a348c3be56e0faa38c2bbbf27" => :high_sierra
|
|
sha256 "44c4f8b14b8ccb0b594af848f03a741952f6b2911358f4df0f3e01da78925c93" => :sierra
|
|
sha256 "8d93d8e5f46152ec36ba53130d5ca7bb25cec494c9244e42c136800b5d929ebd" => :el_capitan
|
|
end
|
|
|
|
option "with-dynamic", "Build dynamic binary with CGO_ENABLED=1"
|
|
|
|
depends_on "go" => :build
|
|
depends_on "gox" => :build
|
|
|
|
def install
|
|
ENV["GOPATH"] = buildpath
|
|
|
|
contents = buildpath.children - [buildpath/".brew_home"]
|
|
(buildpath/"src/github.com/hashicorp/vault").install contents
|
|
|
|
(buildpath/"bin").mkpath
|
|
|
|
cd "src/github.com/hashicorp/vault" do
|
|
target = build.with?("dynamic") ? "dev-dynamic" : "dev"
|
|
system "make", target
|
|
bin.install "bin/vault"
|
|
prefix.install_metafiles
|
|
end
|
|
end
|
|
|
|
test do
|
|
pid = fork { exec bin/"vault", "server", "-dev" }
|
|
sleep 1
|
|
ENV.append "VAULT_ADDR", "http://127.0.0.1:8200"
|
|
system bin/"vault", "status"
|
|
Process.kill("TERM", pid)
|
|
end
|
|
end
|