2011-01-19 05:47:02 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Mosquitto < Formula
|
2011-07-29 01:28:14 +00:00
|
|
|
homepage 'http://mosquitto.org/'
|
2013-12-06 23:13:25 +00:00
|
|
|
url 'http://mosquitto.org/files/source/mosquitto-1.2.3.tar.gz'
|
|
|
|
sha1 '1675048286e0e32dc33126ec62466d083c0857f3'
|
2011-01-19 05:47:02 +00:00
|
|
|
|
2012-08-21 09:18:49 +00:00
|
|
|
depends_on 'pkg-config' => :build
|
2011-01-19 05:47:02 +00:00
|
|
|
depends_on 'cmake' => :build
|
2013-09-23 11:04:06 +00:00
|
|
|
|
2012-08-21 09:18:49 +00:00
|
|
|
# mosquitto requires OpenSSL >=1.0 for TLS support
|
|
|
|
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
|
|
|
|
(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>
|
|
|
|
<string>#{opt_prefix}/sbin/mosquitto</string>
|
|
|
|
<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
|