aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/mosquitto.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Formula/mosquitto.rb')
-rw-r--r--Library/Formula/mosquitto.rb65
1 files changed, 26 insertions, 39 deletions
diff --git a/Library/Formula/mosquitto.rb b/Library/Formula/mosquitto.rb
index ff123d539..c5850742b 100644
--- a/Library/Formula/mosquitto.rb
+++ b/Library/Formula/mosquitto.rb
@@ -33,19 +33,6 @@ class Mosquitto < Formula
You can make changes to the configuration by editing
#{etc}/mosquitto/mosquitto.conf
- If this is your first install, automatically load on login with:
- mkdir -p ~/Library/LaunchAgents
- cp #{plist_path} ~/Library/LaunchAgents/
- launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename}
-
- If this is an upgrade and you already have the #{plist_path.basename} loaded:
- launchctl unload -w ~/Library/LaunchAgents/#{plist_path.basename}
- cp #{plist_path} ~/Library/LaunchAgents/
- launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename}
-
- Start the broker manually by running:
- mosquitto -c #{etc}/mosquitto/mosquitto.conf
-
Python client bindings can be installed from the Python Package Index
pip install mosquitto
@@ -54,31 +41,31 @@ class Mosquitto < Formula
EOD
end
- def startup_plist
- return <<-EOS
-<?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>#{HOMEBREW_PREFIX}/sbin/mosquitto</string>
- <string>-c</string>
- <string>#{etc}/mosquitto/mosquitto.conf</string>
- </array>
- <key>RunAtLoad</key>
- <true/>
- <key>KeepAlive</key>
- <false/>
- <key>UserName</key>
- <string>#{`whoami`.chomp}</string>
- <key>WorkingDirectory</key>
- <string>#{var}/mosquitto</string>
-</dict>
-</plist>
-EOS
- end
+ plist_options :manual => "mosquitto -c #{HOMEBREW_PREFIX}/etc/mosquitto/mosquitto.conf"
+ 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>UserName</key>
+ <string>#{`whoami`.chomp}</string>
+ <key>WorkingDirectory</key>
+ <string>#{var}/mosquitto</string>
+ </dict>
+ </plist>
+ EOS
+ end
end