# 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.9.5", :revision => "36edb4d42380d89a897e7f633046423240b710d9" head "https://github.com/hashicorp/vault.git" bottle do cellar :any_skip_relocation sha256 "263e5159539892ca8637ff800d0d851c29d3132ef01eb1cf9e168244ae3d8506" => :high_sierra sha256 "e8065f44fd2c1af9d486b45deeda15e6b99a1f8e06a3a56b4980b4e81d9e764a" => :sierra sha256 "70ee53256c7d7c350f0756adb334043496775165d11b0f5708ba5aebb2e2c584" => :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