Last active
December 19, 2015 13:29
-
-
Save solidsnack/5962537 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'formula' | |
class Mesos < Formula | |
homepage 'http://incubator.apache.org/mesos/' | |
head 'https://git-wip-us.apache.org/repos/asf/mesos.git' | |
depends_on 'autoconf' => :build | |
depends_on 'automake' => :build | |
depends_on 'libtool' => :build | |
depends_on 'zookeeper' | |
def java_ok? | |
`java -version 2>&1 | fgrep -q 'java version "1.7.'` | |
$?.success? | |
end | |
def install | |
ENV.j1 | |
if not java_ok? | |
onoe <<-EOS.undent | |
Unable to find an acceptable version of Java for building. | |
Mesos is only known to build against Oracle JAVA 7 on OS X: | |
http://www.oracle.com/technetwork/java/javase/downloads/index.html | |
Be sure to download the JDK and not the JRE. | |
EOS | |
exit 1 | |
end | |
system 'env', 'CC=gcc', 'CXX=g++', './bootstrap' | |
system 'env', 'CC=gcc', 'CXX=g++', './configure' | |
system 'make' | |
system 'make', 'install' | |
end | |
def caveats | |
<<-EOS.undent | |
# Launching a basic Mesos cluster: | |
## Start the Zookeeper server. | |
:; zkServer start /usr/local/etc/zookeeper/zoo_sample.cfg | |
## Start a Mesos master node. | |
:; /usr/local/sbin/mesos-master --zk=zk://localhost:2181/mesos | |
## Start a Mesos slave node. | |
:; /usr/local/sbin/mesos-slave --master=zk://localhost:2181/mesos | |
# Unfortunately, you still need to install Apple's JDK 6 in | |
# order to actually run Mesos. | |
EOS | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment