96 lines
2.5 KiB
Ruby
96 lines
2.5 KiB
Ruby
class Ejabberd < Formula
|
|
desc "XMPP application server"
|
|
homepage "https://www.ejabberd.im"
|
|
url "https://www.process-one.net/downloads/ejabberd/20.01/ejabberd-20.01.tgz"
|
|
sha256 "860b5ce39e455bde2484f5fd67ad4d6812e86da975d1f26b75959367b7b49bb9"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "82d659032313a97894ab862f9edb41ce6b949e5f563d94aa9770f1d6cbfe29fc" => :catalina
|
|
sha256 "91582805d944ae637e13655d693ce04fc59ce75274dbfc27bf31afd38eed1c1f" => :mojave
|
|
sha256 "32fd8b7fff97ac59e5e4defd7e07742969f7ae6f3342c6e4e20246a52bef7292" => :high_sierra
|
|
end
|
|
|
|
head do
|
|
url "https://github.com/processone/ejabberd.git"
|
|
|
|
depends_on "autoconf" => :build
|
|
depends_on "automake" => :build
|
|
end
|
|
|
|
depends_on "erlang"
|
|
depends_on "gd"
|
|
depends_on "libyaml"
|
|
depends_on "openssl@1.1"
|
|
|
|
def install
|
|
ENV["TARGET_DIR"] = ENV["DESTDIR"] = "#{lib}/ejabberd/erlang/lib/ejabberd-#{version}"
|
|
ENV["MAN_DIR"] = man
|
|
ENV["SBIN_DIR"] = sbin
|
|
|
|
args = ["--prefix=#{prefix}",
|
|
"--sysconfdir=#{etc}",
|
|
"--localstatedir=#{var}",
|
|
"--enable-pgsql",
|
|
"--enable-mysql",
|
|
"--enable-odbc",
|
|
"--enable-pam"]
|
|
|
|
system "./autogen.sh" if build.head?
|
|
system "./configure", *args
|
|
|
|
# Set CPP to work around cpp shim issue:
|
|
# https://github.com/Homebrew/brew/issues/5153
|
|
system "make", "CPP=clang -E"
|
|
|
|
ENV.deparallelize
|
|
system "make", "install"
|
|
|
|
(etc/"ejabberd").mkpath
|
|
end
|
|
|
|
def post_install
|
|
(var/"lib/ejabberd").mkpath
|
|
(var/"spool/ejabberd").mkpath
|
|
end
|
|
|
|
def caveats; <<~EOS
|
|
If you face nodedown problems, concat your machine name to:
|
|
/private/etc/hosts
|
|
after 'localhost'.
|
|
EOS
|
|
end
|
|
|
|
plist_options :manual => "#{HOMEBREW_PREFIX}/sbin/ejabberdctl start"
|
|
|
|
def plist; <<~EOS
|
|
<?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>EnvironmentVariables</key>
|
|
<dict>
|
|
<key>HOME</key>
|
|
<string>#{var}/lib/ejabberd</string>
|
|
</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/>
|
|
<key>WorkingDirectory</key>
|
|
<string>#{var}/lib/ejabberd</string>
|
|
</dict>
|
|
</plist>
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
system sbin/"ejabberdctl", "ping"
|
|
end
|
|
end
|