2014-04-02 01:27:36 +00:00
|
|
|
require "formula"
|
2009-12-30 10:40:35 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Ejabberd < Formula
|
2014-04-02 01:27:36 +00:00
|
|
|
homepage "http://www.ejabberd.im"
|
2014-07-24 05:15:55 +00:00
|
|
|
url "https://www.process-one.net/downloads/ejabberd/14.07/ejabberd-14.07.tgz"
|
|
|
|
sha1 "321b28faedbc28f80664d4b301424b118dd0bad0"
|
2014-05-16 08:34:48 +00:00
|
|
|
|
|
|
|
head 'https://github.com/processone/ejabberd.git'
|
2009-12-30 10:40:35 +00:00
|
|
|
|
2014-04-02 01:35:12 +00:00
|
|
|
bottle do
|
2014-07-24 05:30:53 +00:00
|
|
|
sha1 "059ccab62554453458e922aee4ba753287ed2098" => :mavericks
|
|
|
|
sha1 "b739b73fed4312709473a80a637cec8d8c8d37dc" => :mountain_lion
|
|
|
|
sha1 "df284f6d0ce9d5eb86754b59e6ff2a598d847984" => :lion
|
2014-04-02 01:35:12 +00:00
|
|
|
end
|
|
|
|
|
2014-05-16 08:34:48 +00:00
|
|
|
option "32-bit"
|
|
|
|
|
2014-04-02 01:27:36 +00:00
|
|
|
depends_on "openssl"
|
2009-12-30 10:40:35 +00:00
|
|
|
depends_on "erlang"
|
2014-04-02 01:27:36 +00:00
|
|
|
depends_on "libyaml"
|
2014-05-16 08:34:48 +00:00
|
|
|
# for CAPTCHA challenges
|
|
|
|
depends_on "imagemagick" => :optional
|
2011-05-24 16:56:29 +00:00
|
|
|
|
2009-12-30 10:40:35 +00:00
|
|
|
def install
|
2014-04-02 01:27:36 +00:00
|
|
|
ENV["TARGET_DIR"] = ENV["DESTDIR"] = "#{lib}/ejabberd/erlang/lib/ejabberd-#{version}"
|
|
|
|
ENV["MAN_DIR"] = man
|
|
|
|
ENV["SBIN_DIR"] = sbin
|
2014-05-16 08:34:48 +00:00
|
|
|
# Homebrew's 'C compiler cannot create executables' bug workaround
|
|
|
|
ENV["HOMEBREW_ARCHFLAGS"] = " "
|
2009-12-30 10:40:35 +00:00
|
|
|
|
2012-08-28 04:33:50 +00:00
|
|
|
if build.build_32_bit?
|
2012-01-01 04:17:28 +00:00
|
|
|
%w{ CFLAGS LDFLAGS }.each do |compiler_flag|
|
2013-08-02 03:40:42 +00:00
|
|
|
ENV.remove compiler_flag, "-arch #{Hardware::CPU.arch_64_bit}"
|
|
|
|
ENV.append compiler_flag, "-arch #{Hardware::CPU.arch_32_bit}"
|
2012-01-01 04:17:28 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-04-02 01:27:36 +00:00
|
|
|
args = ["--prefix=#{prefix}",
|
|
|
|
"--sysconfdir=#{etc}",
|
2014-05-16 08:34:48 +00:00
|
|
|
"--localstatedir=#{var}",
|
|
|
|
"--enable-pgsql",
|
|
|
|
"--enable-mysql",
|
|
|
|
"--enable-odbc",
|
|
|
|
"--enable-pam"]
|
2011-05-24 16:56:29 +00:00
|
|
|
|
2014-04-02 01:27:36 +00:00
|
|
|
system "./configure", *args
|
|
|
|
system "make"
|
|
|
|
system "make", "install"
|
2009-12-30 10:40:35 +00:00
|
|
|
|
|
|
|
(etc+"ejabberd").mkpath
|
|
|
|
(var+"lib/ejabberd").mkpath
|
|
|
|
(var+"spool/ejabberd").mkpath
|
|
|
|
end
|
|
|
|
|
2011-02-24 15:31:01 +00:00
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
If you face nodedown problems, concat your machine name to:
|
|
|
|
/private/etc/hosts
|
|
|
|
after 'localhost'.
|
2009-12-30 10:40:35 +00:00
|
|
|
EOS
|
|
|
|
end
|
2014-05-16 08:34:48 +00:00
|
|
|
|
|
|
|
plist_options :manual => "#{HOMEBREW_PREFIX}/sbin/ejabberdctl start"
|
|
|
|
|
|
|
|
def plist; <<-EOS.undent
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
|
|
<plist version="1.0">
|
|
|
|
<dict>
|
|
|
|
<key>Label</key>
|
|
|
|
<string>#{plist_name}</string>
|
|
|
|
<key>ProgramArguments</key>
|
|
|
|
<array>
|
|
|
|
<string>#{opt_sbin}/ejabberdctl</string>
|
|
|
|
<string>start</string>
|
|
|
|
</array>
|
|
|
|
<key>RunAtLoad</key>
|
|
|
|
<true/>
|
|
|
|
</dict>
|
|
|
|
</plist>
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
2009-12-30 10:40:35 +00:00
|
|
|
end
|