2013-11-09 01:13:19 +00:00
|
|
|
class Mesos < Formula
|
|
|
|
homepage "http://mesos.apache.org"
|
2015-02-22 22:24:45 +00:00
|
|
|
url "http://mirror.cogentco.com/pub/apache/mesos/0.21.1/mesos-0.21.1.tar.gz"
|
|
|
|
sha1 "275d211364699f2861c108fa80764785178f3eeb"
|
2013-11-09 01:13:19 +00:00
|
|
|
|
2014-08-25 20:52:59 +00:00
|
|
|
bottle do
|
2015-03-05 00:40:10 +00:00
|
|
|
sha1 "5c8e6b528c3742de1adfd784a7fb28adee875966" => :yosemite
|
|
|
|
sha1 "fe8c3b6d3e94cf23cf84eb4b6a8fb904e94887e9" => :mavericks
|
|
|
|
sha1 "fa1c65a429462e454edf1da9c9669548f7e8d5df" => :mountain_lion
|
2014-08-25 20:52:59 +00:00
|
|
|
end
|
|
|
|
|
2015-01-30 10:10:15 +00:00
|
|
|
depends_on :java => "1.7+"
|
2014-08-25 20:29:18 +00:00
|
|
|
depends_on :macos => :mountain_lion
|
2013-11-09 01:13:19 +00:00
|
|
|
depends_on "maven" => :build
|
2015-02-22 22:24:45 +00:00
|
|
|
depends_on :apr => :build
|
|
|
|
depends_on "subversion"
|
|
|
|
|
|
|
|
|
|
|
|
needs :cxx11
|
2014-10-07 04:08:27 +00:00
|
|
|
|
2013-11-09 01:13:19 +00:00
|
|
|
def install
|
2015-02-22 22:24:45 +00:00
|
|
|
# work around distutils abusing CC instead of using CXX
|
|
|
|
# https://issues.apache.org/jira/browse/MESOS-799
|
|
|
|
# https://github.com/Homebrew/homebrew/pull/37087
|
|
|
|
inreplace "src/python/native/setup.py.in",
|
|
|
|
"import ext_modules",
|
|
|
|
"import os; os.environ['CC'] = '#{ENV.cxx}'\n\\0"
|
|
|
|
|
2014-10-07 04:08:27 +00:00
|
|
|
args = ["--prefix=#{prefix}",
|
|
|
|
"--disable-debug",
|
|
|
|
"--disable-dependency-tracking",
|
2015-01-30 10:10:15 +00:00
|
|
|
"--disable-silent-rules",
|
2015-02-22 22:24:45 +00:00
|
|
|
"--without-python",
|
|
|
|
"--with-svn=#{Formula["subversion"].opt_prefix}"
|
2014-10-07 04:08:27 +00:00
|
|
|
]
|
|
|
|
|
2015-02-22 22:24:45 +00:00
|
|
|
unless MacOS::CLT.installed?
|
|
|
|
args << "--with-apr=#{Formula["apr"].opt_prefix}/libexec"
|
|
|
|
end
|
|
|
|
|
|
|
|
ENV.cxx11
|
2013-11-09 01:13:19 +00:00
|
|
|
|
2014-10-07 04:08:27 +00:00
|
|
|
system "./configure", *args
|
2013-11-09 01:13:19 +00:00
|
|
|
system "make"
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2014-07-01 22:29:32 +00:00
|
|
|
require "timeout"
|
|
|
|
|
|
|
|
master = fork do
|
|
|
|
exec "#{sbin}/mesos-master", "--ip=127.0.0.1",
|
|
|
|
"--registry=in_memory"
|
|
|
|
end
|
|
|
|
slave = fork do
|
|
|
|
exec "#{sbin}/mesos-slave", "--master=127.0.0.1:5050",
|
|
|
|
"--work_dir=#{testpath}"
|
|
|
|
end
|
2015-01-30 10:10:15 +00:00
|
|
|
Timeout.timeout(15) do
|
2014-07-01 22:29:32 +00:00
|
|
|
system "#{bin}/mesos", "execute",
|
|
|
|
"--master=127.0.0.1:5050",
|
|
|
|
"--name=execute-touch",
|
|
|
|
"--command=touch\s#{testpath}/executed"
|
|
|
|
end
|
|
|
|
Process.kill("TERM", master)
|
|
|
|
Process.kill("TERM", slave)
|
2015-01-30 10:10:15 +00:00
|
|
|
assert File.exist?("#{testpath}/executed")
|
2013-11-09 01:13:19 +00:00
|
|
|
end
|
|
|
|
end
|