class Mosquitto < Formula desc "Message broker implementing the MQTT protocol" homepage "https://mosquitto.org/" url "https://mosquitto.org/files/source/mosquitto-1.6.4.tar.gz" sha256 "a3d5822c249f6a6e13311b1b09eff6807ea01608a5a77934e1769842e9d146ef" revision 1 bottle do cellar :any sha256 "af872a69b14e4afb695e0a1b3b5cbab1c173745786f8ca50b96c97fa69a3bdf3" => :mojave sha256 "b6aa2771c20eb913832555dac11f82ba2708cd6d635726c763a759e4db05db6d" => :high_sierra sha256 "44f0b813a9e12316a893c933e5c86dc30433a89b580f781c89f4f0db35adfd4a" => :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