2010-08-13 16:58:56 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Disco < Formula
|
2010-08-13 16:58:56 +00:00
|
|
|
homepage 'http://discoproject.com/'
|
2011-04-04 23:15:16 +00:00
|
|
|
url 'https://github.com/tuulos/disco/tarball/0.3.2'
|
2012-09-03 18:33:56 +00:00
|
|
|
sha1 'f676e59b7bec0901566888533fd7eed5ff5c45d5'
|
2012-08-27 14:49:14 +00:00
|
|
|
# Periods in the install path cause disco-worker to complain so change to underscores.
|
|
|
|
version '0_3_2'
|
2011-05-27 05:02:55 +00:00
|
|
|
head 'https://github.com/tuulos/disco.git'
|
2010-08-13 16:58:56 +00:00
|
|
|
|
|
|
|
depends_on 'erlang'
|
2012-09-05 04:04:01 +00:00
|
|
|
depends_on 'simplejson' => :python if MacOS.version == :leopard
|
2010-08-13 16:58:56 +00:00
|
|
|
depends_on 'libcmph'
|
|
|
|
|
|
|
|
def install
|
2011-04-04 23:15:16 +00:00
|
|
|
inreplace "Makefile" do |s|
|
|
|
|
s.change_make_var! "DESTDIR", prefix
|
|
|
|
s.change_make_var! "PREFIX", ""
|
|
|
|
s.change_make_var! "DISCO_ROOT", "#{var}/disco/"
|
|
|
|
end
|
2010-08-13 16:58:56 +00:00
|
|
|
|
|
|
|
# add some helpful config for local development
|
2011-04-04 23:15:16 +00:00
|
|
|
inreplace "conf/gen.settings.sys-Darwin" do |s|
|
|
|
|
s.gsub! "${DESTDIR}", HOMEBREW_PREFIX
|
|
|
|
s.gsub! "DDFS_TAG_MIN_REPLICAS = 3", "DDFS_TAG_MIN_REPLICAS = 1"
|
|
|
|
s.gsub! "DDFS_TAG_REPLICAS = 3", "DDFS_TAG_REPLICAS = 1"
|
|
|
|
s.gsub! "DDFS_BLOB_REPLICAS = 3", "DDFS_BLOB_REPLICAS = 1\n" +
|
2010-08-13 16:58:56 +00:00
|
|
|
"DISCO_MASTER_HOST = 'localhost'\n" +
|
|
|
|
"DISCODEX_HOME = os.path.join(os.path.dirname(DISCO_HOME), 'discodex')"
|
2011-04-04 23:15:16 +00:00
|
|
|
end
|
2010-08-13 16:58:56 +00:00
|
|
|
|
|
|
|
system "make"
|
|
|
|
system "make install"
|
|
|
|
ENV.delete('CC')
|
|
|
|
system "make install-discodb install-discodex"
|
2012-11-11 19:20:09 +00:00
|
|
|
bin.install %w[contrib/discodex/bin/discodex contrib/discodex/bin/discodexcli.py]
|
|
|
|
prefix.install %w[contrib doc examples node]
|
2010-08-13 16:58:56 +00:00
|
|
|
end
|
|
|
|
|
2011-04-04 23:15:16 +00:00
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
Please symlink #{etc}/disco/settings.py to ~/.disco and edit accordingly:
|
|
|
|
ln -s #{etc}/disco/settings.py ~/.disco
|
2010-08-13 16:58:56 +00:00
|
|
|
|
2011-04-04 23:15:16 +00:00
|
|
|
To run the discodex server for development:
|
2012-11-25 19:42:57 +00:00
|
|
|
cd #{opt_prefix}/contrib/discodex/www
|
2011-04-04 23:15:16 +00:00
|
|
|
./manage.py runserver 8080
|
2010-08-13 16:58:56 +00:00
|
|
|
|
2011-04-04 23:15:16 +00:00
|
|
|
The DDFS_*_REPLICA settings have been set to 1 assuming a single-machine install.
|
|
|
|
Please see http://discoproject.org/doc/start/install.html for further instructions.
|
2010-08-13 16:58:56 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|