72 lines
2.0 KiB
Ruby
72 lines
2.0 KiB
Ruby
class Mosquitto < Formula
|
|
desc "Message broker implementing the MQTT protocol"
|
|
homepage "https://mosquitto.org/"
|
|
url "https://mosquitto.org/files/source/mosquitto-1.6.10.tar.gz"
|
|
sha256 "92d1807717f0f6d57d1ac1207ffdb952e8377e916c7b0bb4718f745239774232"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "5ddfb287cb31bebc6ed03919d4dad9929a41a32d208b18e84fa7d93004a4bf4c" => :catalina
|
|
sha256 "26b87ebf33eb37ee27f1ea0eb05841c4e6d68c0ec3436ba1df15c542734fc27e" => :mojave
|
|
sha256 "c93f76bc649b7999229e88478fdae1501a18292fe122353bbcd1eb3323f5747e" => :high_sierra
|
|
end
|
|
|
|
depends_on "cmake" => :build
|
|
depends_on "pkg-config" => :build
|
|
depends_on "libwebsockets"
|
|
depends_on "openssl@1.1"
|
|
|
|
on_linux do
|
|
depends_on "util-linux"
|
|
end
|
|
|
|
def install
|
|
system "cmake", ".", *std_cmake_args, "-DWITH_WEBSOCKETS=ON"
|
|
system "make", "install"
|
|
end
|
|
|
|
def post_install
|
|
(var/"mosquitto").mkpath
|
|
end
|
|
|
|
def caveats
|
|
<<~EOS
|
|
mosquitto has been installed with a default configuration file.
|
|
You can make changes to the configuration by editing:
|
|
#{etc}/mosquitto/mosquitto.conf
|
|
EOS
|
|
end
|
|
|
|
plist_options :manual => "mosquitto -c #{HOMEBREW_PREFIX}/etc/mosquitto/mosquitto.conf"
|
|
|
|
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>Label</key>
|
|
<string>#{plist_name}</string>
|
|
<key>ProgramArguments</key>
|
|
<array>
|
|
<string>#{opt_sbin}/mosquitto</string>
|
|
<string>-c</string>
|
|
<string>#{etc}/mosquitto/mosquitto.conf</string>
|
|
</array>
|
|
<key>RunAtLoad</key>
|
|
<true/>
|
|
<key>KeepAlive</key>
|
|
<false/>
|
|
<key>WorkingDirectory</key>
|
|
<string>#{var}/mosquitto</string>
|
|
</dict>
|
|
</plist>
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
quiet_system "#{sbin}/mosquitto", "-h"
|
|
assert_equal 3, $CHILD_STATUS.exitstatus
|
|
end
|
|
end
|