require "formula" class Mosquitto < Formula homepage "http://mosquitto.org/" url "http://mosquitto.org/files/source/mosquitto-1.3.4.tar.gz" sha1 "b818672cc0db723995d7c3201ef6962931dd891a" bottle do sha1 "92e579915297c3dcbed3682c5a4f0bb2dd67389a" => :mavericks sha1 "5a92a49a4e09cf73cf9c102600483c8c87a66214" => :mountain_lion sha1 "a0a7141690ed684c08358655d3b3a5802e52ae31" => :lion end depends_on "pkg-config" => :build depends_on "cmake" => :build depends_on "c-ares" # mosquitto requires OpenSSL >=1.0 for TLS support depends_on "openssl" def install system "cmake", ".", *std_cmake_args system "make install" # Create the working directory (var/"mosquitto").mkpath end test do quiet_system "#{sbin}/mosquitto", "-h" assert_equal 3, $?.exitstatus end def caveats; <<-EOD.undent mosquitto has been installed with a default configuration file. You can make changes to the configuration by editing: #{etc}/mosquitto/mosquitto.conf Python client bindings can be installed from the Python Package Index: pip install mosquitto Javascript client has been removed, see Eclipse Paho for an alternative. EOD 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 end