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'
|
2010-09-07 14:24:34 +00:00
|
|
|
url 'http://mirror.rabbitmq.com/releases/rabbitmq-server/v2.0.0/rabbitmq-server-2.0.0.tar.gz'
|
|
|
|
md5 '04b99018085d4156b404d56377fc1c62'
|
2009-09-01 15:01:20 +00:00
|
|
|
|
|
|
|
depends_on 'erlang'
|
2010-01-13 09:00:24 +00:00
|
|
|
depends_on 'simplejson' => :python if MACOS_VERSION < 10.6
|
2009-09-01 15:01:20 +00:00
|
|
|
|
2010-06-29 19:23:10 +00:00
|
|
|
def patches
|
2010-09-07 14:24:34 +00:00
|
|
|
# Can't build manpages without a lot of other junk, so disable
|
2010-06-29 19:23:10 +00:00
|
|
|
DATA
|
|
|
|
end
|
|
|
|
|
2009-09-01 15:01:20 +00:00
|
|
|
def install
|
2010-02-17 18:14:00 +00:00
|
|
|
target_dir = "#{lib}/rabbitmq/erlang/lib/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
|
|
|
|
2010-09-07 14:24:34 +00:00
|
|
|
(etc+'rabbitmq').mkpath
|
|
|
|
(var+'lib/rabbitmq').mkpath
|
|
|
|
(var+'log/rabbitmq').mkpath
|
2009-10-02 09:53:14 +00:00
|
|
|
|
2009-10-17 19:27:27 +00:00
|
|
|
%w{rabbitmq-server rabbitmq-multi rabbitmqctl rabbitmq-env}.each do |script|
|
2010-01-13 11:06:52 +00:00
|
|
|
inreplace sbin+script do |contents|
|
|
|
|
contents.gsub! '/etc/rabbitmq', "#{etc}/rabbitmq"
|
2010-02-17 18:14:00 +00:00
|
|
|
contents.gsub! '/var/lib/rabbitmq', "#{var}/lib/rabbitmq"
|
|
|
|
contents.gsub! '/var/log/rabbitmq', "#{var}/log/rabbitmq"
|
2010-01-13 11:06:52 +00:00
|
|
|
end
|
2009-10-17 19:27:27 +00:00
|
|
|
end
|
|
|
|
|
2010-01-13 11:06:52 +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
|
2010-09-07 21:34:39 +00:00
|
|
|
inreplace sbin+'rabbitmq-env', '${SCRIPT_DIR}/..', target_dir
|
2009-09-01 15:01:20 +00:00
|
|
|
end
|
|
|
|
end
|
2010-06-29 19:23:10 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
diff --git a/Makefile b/Makefile
|
2010-09-07 14:24:34 +00:00
|
|
|
index 46b1842..82d71a0 100644
|
2010-06-29 19:23:10 +00:00
|
|
|
--- a/Makefile
|
|
|
|
+++ b/Makefile
|
2010-09-07 14:24:34 +00:00
|
|
|
@@ -265,7 +265,7 @@ $(SOURCE_DIR)/%_usage.erl:
|
|
|
|
|
2010-06-29 19:23:10 +00:00
|
|
|
docs_all: $(MANPAGES) $(WEB_MANPAGES)
|
2010-09-07 14:24:34 +00:00
|
|
|
|
2010-06-29 19:23:10 +00:00
|
|
|
-install: all docs_all install_dirs
|
|
|
|
+install: all install_dirs
|
|
|
|
cp -r ebin include LICENSE LICENSE-MPL-RabbitMQ INSTALL $(TARGET_DIR)
|
2010-09-07 14:24:34 +00:00
|
|
|
|
2010-06-29 19:23:10 +00:00
|
|
|
chmod 0755 scripts/*
|
2010-09-07 14:24:34 +00:00
|
|
|
@@ -273,12 +273,6 @@ install: all docs_all install_dirs
|
2010-06-29 19:23:10 +00:00
|
|
|
cp scripts/$$script $(TARGET_DIR)/sbin; \
|
|
|
|
[ -e $(SBIN_DIR)/$$script ] || ln -s $(SCRIPTS_REL_PATH)/$$script $(SBIN_DIR)/$$script; \
|
|
|
|
done
|
|
|
|
- for section in 1 5; do \
|
|
|
|
- mkdir -p $(MAN_DIR)/man$$section; \
|
|
|
|
- for manpage in $(DOCS_DIR)/*.$$section.gz; do \
|
|
|
|
- cp $$manpage $(MAN_DIR)/man$$section; \
|
|
|
|
- done; \
|
|
|
|
- done
|
2010-09-07 14:24:34 +00:00
|
|
|
mkdir -p $(TARGET_DIR)/plugins
|
|
|
|
echo Put your .ez plugin files in this directory. > $(TARGET_DIR)/plugins/README
|
|
|
|
|