diff options
| author | Gavin M. Roy | 2012-05-04 21:46:05 -0400 |
|---|---|---|
| committer | Adam Vandenberg | 2012-05-15 20:35:56 -0700 |
| commit | 181e445c5701070adb63ac3365c68040f26f6a6a (patch) | |
| tree | cd41e15b023dd30373fdf4317c5b434e7182dc18 /Library/Formula | |
| parent | 183bf1e1852ba82eaa54e85ed51cd76616c36b1b (diff) | |
| download | homebrew-181e445c5701070adb63ac3365c68040f26f6a6a.tar.bz2 | |
RabbitMQ 2.8.2
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/rabbitmq.rb | 92 |
1 files changed, 40 insertions, 52 deletions
diff --git a/Library/Formula/rabbitmq.rb b/Library/Formula/rabbitmq.rb index a5ea1138c..ad3f142b7 100644 --- a/Library/Formula/rabbitmq.rb +++ b/Library/Formula/rabbitmq.rb @@ -2,45 +2,35 @@ require 'formula' class Rabbitmq < Formula homepage 'http://www.rabbitmq.com' - url 'http://www.rabbitmq.com/releases/rabbitmq-server/v2.7.1/rabbitmq-server-2.7.1.tar.gz' - md5 '44eb09d2dff8ce641a1fe7f255a4c546' + url 'http://www.rabbitmq.com/releases/rabbitmq-server/v2.8.2/rabbitmq-server-generic-unix-2.8.2.tar.gz' + md5 '7e9ae4f01341bff61c78bfe7e3ea17be' depends_on 'erlang' depends_on 'simplejson' => :python if MacOS.leopard? - def patches - # Fixes build on 10.5, already fixed upstream but was not in 2.7.1 release - # https://github.com/rabbitmq/rabbitmq-public-umbrella/commit/b46edc7433 - DATA - end - def install - # Building the manual requires additional software, so skip it. - inreplace "Makefile", "install: install_bin install_docs", "install: install_bin" - - target_dir = "#{lib}/rabbitmq/erlang/lib/rabbitmq-#{version}" - system "make" - ENV['TARGET_DIR'] = target_dir - ENV['MAN_DIR'] = man - ENV['SBIN_DIR'] = sbin - system "make install" + # Install the base files + prefix.install Dir['*'] - (etc+'rabbitmq').mkpath + # Setup the lib files (var+'lib/rabbitmq').mkpath (var+'log/rabbitmq').mkpath - %w{rabbitmq-server rabbitmqctl rabbitmq-env rabbitmq-plugins}.each do |script| - inreplace sbin+script do |s| - s.gsub! '/etc/rabbitmq', "#{etc}/rabbitmq" - s.gsub! '/var/lib/rabbitmq', "#{var}/lib/rabbitmq" - s.gsub! '/var/log/rabbitmq', "#{var}/log/rabbitmq" - end - end + # Replace the SYS_PREFIX for things like rabbitmq-plugins + inreplace (sbin + 'rabbitmq-defaults'), 'SYS_PREFIX=${RABBITMQ_HOME}', "SYS_PREFIX=#{HOMEBREW_PREFIX}" + + # Set the RABBITMQ_HOME in rabbitmq-env + inreplace (sbin + 'rabbitmq-env'), 'RABBITMQ_HOME="${SCRIPT_DIR}/.."', "RABBITMQ_HOME=#{prefix}" + + # Create the rabbitmq-env.conf file + rabbitmq_env_conf = etc+'rabbitmq/rabbitmq-env.conf' + rabbitmq_env_conf.write rabbitmq_env unless rabbitmq_env_conf.exist? - # RabbitMQ Erlang binaries are installed in lib/rabbitmq/erlang/lib/rabbitmq-x.y.z/ebin - # therefore need to add this path for erl -pa - inreplace sbin+'rabbitmq-env', '${SCRIPT_DIR}/..', target_dir + # Enable the management web UI + enabled_plugins_path = etc+'rabbitmq/enabled_plugins' + enabled_plugins_path.write enabled_plugins unless enabled_plugins_path.exist? + # Create the plist file plist_path.write startup_plist plist_path.chmod 0644 end @@ -57,11 +47,27 @@ class Rabbitmq < Formula cp #{plist_path} ~/Library/LaunchAgents/ launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename} - To start rabbitmq-server manually: + Management Plugin enabled by default at http://localhost:55672 + + To start rabbitmq-server manually: rabbitmq-server EOS end + + def enabled_plugins + return <<-EOS.undent + [rabbitmq_management,rabbitmq_management_visualiser]. + EOS + end + def rabbitmq_env + return <<-EOS.undent + CONFIG_FILE=#{etc}/rabbitmq/rabbitmq + NODE_IP_ADDRESS=127.0.0.1 + NODENAME=rabbit@localhost + EOS + end + def startup_plist return <<-EOPLIST <?xml version="1.0" encoding="UTF-8"?> @@ -77,38 +83,20 @@ class Rabbitmq < Formula <true/> <key>UserName</key> <string>#{`whoami`.chomp}</string> - <!-- need erl in the path --> <key>EnvironmentVariables</key> <dict> + <!-- need erl in the path --> <key>PATH</key> <string>/usr/local/sbin:/usr/bin:/bin:/usr/local/bin</string> + <!-- specify the path to the rabbitmq-env.conf file --> + <key>CONF_ENV_FILE</key> + <string>#{etc}/rabbitmq/rabbitmq-env.conf</string> </dict> </dict> </plist> EOPLIST end + end __END__ -diff --git a/plugins-src/do-package.mk b/plugins-src/do-package.mk -index d7f8752..023042a 100644 ---- a/plugins-src/do-package.mk -+++ b/plugins-src/do-package.mk -@@ -286,7 +286,7 @@ $(eval $(foreach D,$(TEST_SOURCE_DIRS),$(call package_source_dir_targets,$(D),$( - define run_broker - rm -rf $(TEST_TMPDIR) - mkdir -p $(foreach D,log plugins $(NODENAME),$(TEST_TMPDIR)/$(D)) -- cp -a $(PACKAGE_DIR)/dist/*.ez $(TEST_TMPDIR)/plugins -+ cp -p $(PACKAGE_DIR)/dist/*.ez $(TEST_TMPDIR)/plugins - $(call copy,$(3),$(TEST_TMPDIR)/plugins) - rm -f $(TEST_TMPDIR)/plugins/rabbit_common*.ez - for plugin in \ -@@ -375,7 +375,7 @@ $(APP_DONE): $(EBIN_BEAMS) $(INCLUDE_HRLS) $(APP_FILE) $(CONSTRUCT_APP_PREREQS) - mkdir -p $(APP_DIR)/ebin $(APP_DIR)/include - @echo [elided] copy beams to ebin - @$(call copy,$(EBIN_BEAMS),$(APP_DIR)/ebin) -- cp -a $(APP_FILE) $(APP_DIR)/ebin/$(APP_NAME).app -+ cp -p $(APP_FILE) $(APP_DIR)/ebin/$(APP_NAME).app - $(call copy,$(INCLUDE_HRLS),$(APP_DIR)/include) - $(construct_app_commands) - touch $$@ |
