packer 1.0.0
Closes #12063. Signed-off-by: FX Coudert <fxcoudert@gmail.com>
This commit is contained in:
parent
632ebc118c
commit
fd67e502d0
1 changed files with 17 additions and 15 deletions
|
@ -3,10 +3,10 @@ require "language/go"
|
||||||
class Packer < Formula
|
class Packer < Formula
|
||||||
desc "Tool for creating identical machine images for multiple platforms"
|
desc "Tool for creating identical machine images for multiple platforms"
|
||||||
homepage "https://packer.io"
|
homepage "https://packer.io"
|
||||||
url "https://github.com/mitchellh/packer.git",
|
url "https://github.com/hashicorp/packer.git",
|
||||||
:tag => "v0.12.3",
|
:tag => "v1.0.0",
|
||||||
:revision => "c0f2b4768d7f9265adb1aa3c91a0206ca707d91e"
|
:revision => "e3d65a193e96c7b228589fc9699e39998ec12e4e"
|
||||||
head "https://github.com/mitchellh/packer.git"
|
head "https://github.com/hashicorp/packer.git"
|
||||||
|
|
||||||
bottle do
|
bottle do
|
||||||
cellar :any_skip_relocation
|
cellar :any_skip_relocation
|
||||||
|
@ -15,13 +15,6 @@ class Packer < Formula
|
||||||
sha256 "a7ad3c8b1e29e5dbc0a3e2186a854734857dba886dbce220164e6515d53e1c76" => :yosemite
|
sha256 "a7ad3c8b1e29e5dbc0a3e2186a854734857dba886dbce220164e6515d53e1c76" => :yosemite
|
||||||
end
|
end
|
||||||
|
|
||||||
devel do
|
|
||||||
url "https://github.com/mitchellh/packer.git",
|
|
||||||
:tag => "v1.0.0-rc3",
|
|
||||||
:revision => "974a2fe96fcc3a55787d188aff903b4fd86ab666"
|
|
||||||
version "1.0.0-rc3"
|
|
||||||
end
|
|
||||||
|
|
||||||
depends_on :hg => :build
|
depends_on :hg => :build
|
||||||
depends_on "go" => :build
|
depends_on "go" => :build
|
||||||
depends_on "govendor" => :build
|
depends_on "govendor" => :build
|
||||||
|
@ -38,7 +31,7 @@ class Packer < Formula
|
||||||
|
|
||||||
go_resource "golang.org/x/tools" do
|
go_resource "golang.org/x/tools" do
|
||||||
url "https://go.googlesource.com/tools.git",
|
url "https://go.googlesource.com/tools.git",
|
||||||
:revision => "1dce95f761bfeb6fe2aa3c4e9ffdb261b69b3fc4"
|
:revision => "cbb995d093b2c4a12ac074e53d90373ecc827527"
|
||||||
end
|
end
|
||||||
|
|
||||||
def install
|
def install
|
||||||
|
@ -49,7 +42,12 @@ class Packer < Formula
|
||||||
# doesn't need to be installed permanently.
|
# doesn't need to be installed permanently.
|
||||||
ENV.append_path "PATH", buildpath
|
ENV.append_path "PATH", buildpath
|
||||||
|
|
||||||
packerpath = buildpath/"src/github.com/mitchellh/packer"
|
# TODO: remove "else" (mitchellh path) on next release
|
||||||
|
if build.head?
|
||||||
|
packerpath = buildpath/"src/github.com/hashicorp/packer"
|
||||||
|
else
|
||||||
|
packerpath = buildpath/"src/github.com/mitchellh/packer"
|
||||||
|
end
|
||||||
packerpath.install Dir["{*,.git}"]
|
packerpath.install Dir["{*,.git}"]
|
||||||
Language::Go.stage_deps resources, buildpath/"src"
|
Language::Go.stage_deps resources, buildpath/"src"
|
||||||
|
|
||||||
|
@ -63,7 +61,7 @@ class Packer < Formula
|
||||||
buildpath.install "stringer"
|
buildpath.install "stringer"
|
||||||
end
|
end
|
||||||
|
|
||||||
cd "src/github.com/mitchellh/packer" do
|
cd packerpath do
|
||||||
# We handle this step above. Don't repeat it.
|
# We handle this step above. Don't repeat it.
|
||||||
inreplace "Makefile" do |s|
|
inreplace "Makefile" do |s|
|
||||||
s.gsub! "go get github.com/mitchellh/gox", ""
|
s.gsub! "go get github.com/mitchellh/gox", ""
|
||||||
|
@ -72,7 +70,11 @@ class Packer < Formula
|
||||||
end
|
end
|
||||||
|
|
||||||
(buildpath/"bin").mkpath
|
(buildpath/"bin").mkpath
|
||||||
system "make", "releasebin"
|
if build.head?
|
||||||
|
system "make", "bin"
|
||||||
|
else
|
||||||
|
system "make", "releasebin"
|
||||||
|
end
|
||||||
bin.install buildpath/"bin/packer"
|
bin.install buildpath/"bin/packer"
|
||||||
zsh_completion.install "contrib/zsh-completion/_packer"
|
zsh_completion.install "contrib/zsh-completion/_packer"
|
||||||
prefix.install_metafiles
|
prefix.install_metafiles
|
||||||
|
|
Loading…
Reference in a new issue