class Mosquitto < Formula desc "Message broker implementing MQ telemetry transport protocol" homepage "https://mosquitto.org/" url "https://mosquitto.org/files/source/mosquitto-1.4.5.tar.gz" sha256 "b432e19fee0c549f4a0fb0e866d1b6a897b38dbf1ddfda92bb43e2a24f01df66" bottle do revision 1 sha256 "00390161ca1e2afc6dda57931c5f0adcc7c03bec8a706b3e6aab193c7e2ba0ee" => :el_capitan sha256 "7aab82f99f359c047341e1c5e18ea00c81b4c58dff6de2754605dc2072a24a32" => :yosemite sha256 "b2d6e9ba45f454b61d71929340e55c7851400264e42c94a77f82da34075af4d0" => :mavericks end depends_on "pkg-config" => :build depends_on "cmake" => :build depends_on "c-ares" depends_on "openssl" depends_on "libwebsockets" => :recommended def install args = std_cmake_args args << "-DWITH_WEBSOCKETS=ON" if build.with? "libwebsockets" system "cmake", ".", *args system "make", "install" # Create the working directory (var/"mosquitto").mkpath end def caveats; <<-EOS.undent 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.undent 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, $?.exitstatus end end