2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-09-01 15:01:20 +00:00
|
|
|
|
|
|
|
class Rabbitmq <Formula
|
2009-10-02 09:53:14 +00:00
|
|
|
homepage 'http://rabbitmq.com'
|
2009-10-14 16:41:16 +00:00
|
|
|
url 'http://www.rabbitmq.com/releases/rabbitmq-server/v1.7.0/rabbitmq-server-1.7.0.tar.gz'
|
|
|
|
md5 '4505ca0fd8718439bd6f5e2af2379e56'
|
2009-09-01 15:01:20 +00:00
|
|
|
|
|
|
|
depends_on 'erlang'
|
|
|
|
|
|
|
|
def install
|
2009-10-02 09:53:14 +00:00
|
|
|
erlang_libdir = lib + "rabbitmq" + "erlang" + "lib"
|
|
|
|
target_dir = "#{erlang_libdir}/rabbitmq-#{version}"
|
2009-09-01 15:01:20 +00:00
|
|
|
system "make"
|
2009-11-11 19:27:37 +00:00
|
|
|
ENV['TARGET_DIR'] = target_dir
|
|
|
|
ENV['MAN_DIR'] = man
|
|
|
|
ENV['SBIN_DIR'] = sbin
|
|
|
|
system "make install"
|
2009-10-02 09:53:14 +00:00
|
|
|
|
|
|
|
(etc + "rabbitmq").mkpath
|
|
|
|
(var + "lib" + "rabbitmq").mkpath
|
|
|
|
(var + "log" + "couchdb").mkpath
|
|
|
|
|
2009-10-17 19:27:27 +00:00
|
|
|
%w{rabbitmq-server rabbitmq-multi rabbitmqctl rabbitmq-env}.each do |script|
|
2009-10-02 09:53:14 +00:00
|
|
|
inreplace sbin+script, '/etc/rabbitmq', "#{etc}/rabbitmq"
|
|
|
|
inreplace sbin+script, '/var/log/rabbitmq', "#{var}/log/rabbitmq"
|
|
|
|
inreplace sbin+script, '/var/lib/rabbitmq', "#{var}/lib/rabbitmq"
|
2009-10-17 19:27:27 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
%w{rabbitmq-env}.each do |script|
|
2009-10-02 09:53:14 +00:00
|
|
|
# RabbitMQ Erlang binaries are installed in lib/rabbitmq/erlang/lib/rabbitmq-x.y.z/ebin
|
|
|
|
# therefore need to add this path for erl -pa
|
2009-10-17 19:27:27 +00:00
|
|
|
inreplace sbin+script, '${SCRIPT_DIR}/..', "#{target_dir}"
|
2009-10-02 09:53:14 +00:00
|
|
|
end
|
2009-09-01 15:01:20 +00:00
|
|
|
end
|
|
|
|
end
|