pkg:setup prefix.install Dir["*"] (var/"lib/rabbitmq").mkpath (var/"log/rabbitmq").mkpath erlang = Formula["erlang"] inreplace sbin/"rabbitmq-defaults" do |s| s.gsub! "SYS_PREFIX=${RABBITMQ_HOME}", "SYS_PREFIX=#{HOMEBREW_PREFIX}" s.gsub! /^ERL_DIR=$/, "ERL_DIR=#{erlang.opt_bin}/" s.gsub! "CLEAN_BOOT_FILE=start_clean", "CLEAN_BOOT_FILE=#{erlang.opt_lib/"erlang/bin/start_clean"}" s.gsub! "SASL_BOOT_FILE=start_sasl", "SASL_BOOT_FILE=#{erlang.opt_lib/"erlang/bin/start_clean"}"