2014-04-04 15:36:13 +00:00
|
|
|
require "formula"
|
2011-01-19 05:47:02 +00:00
|
|
|
|
|
|
|
class Mosquitto < Formula
|
2014-04-04 15:36:13 +00:00
|
|
|
homepage "http://mosquitto.org/"
|
|
|
|
url "http://mosquitto.org/files/source/mosquitto-1.3.1.tar.gz"
|
|
|
|
sha1 "dcba02c12dffa27a0e76e68f88de21fb5f7de29d"
|
2014-04-09 10:25:47 +00:00
|
|
|
revision 1
|
2011-01-19 05:47:02 +00:00
|
|
|
|
2014-03-26 00:20:02 +00:00
|
|
|
bottle do
|
2014-04-09 11:00:23 +00:00
|
|
|
sha1 "72a9d7a8fe725804d1d1b802e598c7ce54e1871b" => :mavericks
|
|
|
|
sha1 "1f97f45bb8937ecde69eb5d3cdca065843be86e8" => :mountain_lion
|
|
|
|
sha1 "8f39cbe81f2c7f3a0df82baaf9dcca8ebb1ff238" => :lion
|
2014-03-26 00:20:02 +00:00
|
|
|
end
|
|
|
|
|
2014-04-04 15:36:13 +00:00
|
|
|
depends_on "pkg-config" => :build
|
|
|
|
depends_on "cmake" => :build
|
|
|
|
depends_on "c-ares"
|
2013-09-23 11:04:06 +00:00
|
|
|
|
2012-08-21 09:18:49 +00:00
|
|
|
# mosquitto requires OpenSSL >=1.0 for TLS support
|
2014-04-04 15:36:13 +00:00
|
|
|
depends_on "openssl"
|
2011-01-19 05:47:02 +00:00
|
|
|
|
|
|
|
def install
|
2012-05-22 21:37:04 +00:00
|
|
|
system "cmake", ".", *std_cmake_args
|
2011-01-19 05:47:02 +00:00
|
|
|
system "make install"
|
2012-08-21 09:18:49 +00:00
|
|
|
|
2013-08-13 22:09:01 +00:00
|
|
|
# Create the working directory
|
2014-04-04 15:36:13 +00:00
|
|
|
(var/"mosquitto").mkpath
|
2011-01-19 05:47:02 +00:00
|
|
|
end
|
2012-01-19 03:47:09 +00:00
|
|
|
|
2013-03-26 17:45:41 +00:00
|
|
|
test do
|
|
|
|
quiet_system "#{sbin}/mosquitto", "-h"
|
2013-08-13 22:09:01 +00:00
|
|
|
assert_equal 3, $?.exitstatus
|
2012-08-21 09:18:49 +00:00
|
|
|
end
|
|
|
|
|
2013-03-25 18:25:57 +00:00
|
|
|
def caveats; <<-EOD.undent
|
2012-08-21 09:18:49 +00:00
|
|
|
mosquitto has been installed with a default configuration file.
|
2013-08-13 22:09:01 +00:00
|
|
|
You can make changes to the configuration by editing:
|
2012-08-21 09:18:49 +00:00
|
|
|
#{etc}/mosquitto/mosquitto.conf
|
|
|
|
|
2013-08-13 22:09:01 +00:00
|
|
|
Python client bindings can be installed from the Python Package Index:
|
2012-08-21 09:18:49 +00:00
|
|
|
pip install mosquitto
|
|
|
|
|
2013-10-28 14:58:26 +00:00
|
|
|
Javascript client has been removed, see Eclipse Paho for an alternative.
|
2013-08-13 22:09:01 +00:00
|
|
|
EOD
|
2012-01-19 03:47:09 +00:00
|
|
|
end
|
2012-08-21 09:18:49 +00:00
|
|
|
|
2012-11-25 15:06:41 +00:00
|
|
|
plist_options :manual => "mosquitto -c #{HOMEBREW_PREFIX}/etc/mosquitto/mosquitto.conf"
|
2012-08-21 09:18:49 +00:00
|
|
|
|
2012-11-25 15:06:41 +00:00
|
|
|
def plist; <<-EOS.undent
|
|
|
|
<?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>
|
2014-03-06 05:28:31 +00:00
|
|
|
<string>#{opt_sbin}/mosquitto</string>
|
2012-11-25 15:06:41 +00:00
|
|
|
<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
|
2011-01-19 05:47:02 +00:00
|
|
|
end
|