65 lines
1.9 KiB
Ruby
65 lines
1.9 KiB
Ruby
class Mosquitto < Formula
|
|
desc "Message broker implementing the MQTT protocol"
|
|
homepage "https://mosquitto.org/"
|
|
url "https://mosquitto.org/files/source/mosquitto-1.5.4.tar.gz"
|
|
sha256 "5fd7f3454fd6d286645d032bc07f44a1c8583cec02ef2422c9eb32e0a89a9b2f"
|
|
revision 1
|
|
|
|
bottle do
|
|
sha256 "15166a17cbe69e9c310b758aa857ff2acef732dbc15a19565c39faee4bf67fe4" => :mojave
|
|
sha256 "e168ecdbd5627729d265b3381097a89449267bc13065cd23bec81068c771f130" => :high_sierra
|
|
sha256 "00df58c369a81e7ba735cf40f07e0e791db11a105bfc3ba133e3be188dfae70e" => :sierra
|
|
end
|
|
|
|
depends_on "cmake" => :build
|
|
depends_on "pkg-config" => :build
|
|
depends_on "libwebsockets"
|
|
depends_on "openssl"
|
|
|
|
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
|