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 Label #{plist_name} ProgramArguments #{opt_sbin}/mosquitto -c #{etc}/mosquitto/mosquitto.conf RunAtLoad KeepAlive WorkingDirectory #{var}/mosquitto EOS end test do quiet_system "#{sbin}/mosquitto", "-h" assert_equal 3, $CHILD_STATUS.exitstatus end end