2016-07-01 12:52:59 +00:00
|
|
|
class Minio < Formula
|
|
|
|
desc "object storage server compatible with Amazon S3"
|
|
|
|
homepage "https://github.com/minio/minio"
|
2016-07-16 20:14:06 +00:00
|
|
|
url "https://github.com/minio/minio.git", :tag => "RELEASE.2016-07-13T21-46-05Z", :revision => "3f27734c22212f224037a223439a425e6d2b653a"
|
|
|
|
version "20160713214605"
|
2016-07-01 12:52:59 +00:00
|
|
|
|
2016-07-08 18:38:56 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
|
|
|
sha256 "29d5d319618c235dc75b86b9849b1b8f9d3ccc8c5b313c28e73167119ae43c4e" => :el_capitan
|
|
|
|
sha256 "431a20fe6725e32f3a576937815b28e7af8fecfa1faab29e3c1d24d97edb0941" => :yosemite
|
|
|
|
sha256 "c79ee7ccfea2b00db2b8792a479bac3142ce9567c7c69eade8a435b99600a77b" => :mavericks
|
|
|
|
end
|
|
|
|
|
2016-07-01 12:52:59 +00:00
|
|
|
depends_on "go" => :build
|
|
|
|
|
|
|
|
def install
|
|
|
|
ENV["GOPATH"] = buildpath
|
|
|
|
|
|
|
|
clipath = buildpath/"src/github.com/minio/minio"
|
|
|
|
clipath.install Dir["*"]
|
|
|
|
|
2016-07-16 20:14:06 +00:00
|
|
|
cd clipath do
|
|
|
|
if build.head?
|
|
|
|
system "go", "build", "-o", buildpath/"minio"
|
|
|
|
else
|
|
|
|
minio_release = `git tag --points-at HEAD`.chomp
|
|
|
|
minio_version = minio_release.gsub(/RELEASE\./, "").chomp
|
|
|
|
minio_commit = `git rev-parse HEAD`.chomp
|
|
|
|
|
|
|
|
system "go", "build", "-ldflags", "-X main.minioVersion=#{minio_version} -X main.minioReleaseTag=#{minio_release} -X main.minioCommitID=#{minio_commit}", "-o", buildpath/"minio"
|
|
|
|
end
|
2016-07-01 12:52:59 +00:00
|
|
|
end
|
2016-07-16 20:14:06 +00:00
|
|
|
|
|
|
|
bin.install buildpath/"minio"
|
2016-07-01 12:52:59 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2016-07-16 20:14:06 +00:00
|
|
|
system "#{bin}/minio", "version"
|
2016-07-01 12:52:59 +00:00
|
|
|
end
|
|
|
|
end
|