Fix homebrew formula template

This commit is contained in:
David Newhall II 2019-06-13 02:25:41 -07:00
parent 8cd80fcf83
commit 094705d76c
1 changed files with 35 additions and 31 deletions

View File

@ -22,10 +22,18 @@ class UnifiPoller < Formula
cd bin_path do
system "dep", "ensure"
system "make", "install", "VERSION=#{version}", "PREFIX=#{prefix}", "ETC=#{etc}"
system "mkdir", "-p", "#{var}/log/unifi-poller"
end
end
plist_options :startup => true
def caveats
s = <<-EOS
This application will not work until the config file has authentication
information for a Unifi Controller and an Influx Database. Edit the config
file at #{etc}/unifi-poller/up.conf then start the application with
brew services start unifi-poller ~ log file: #{var}/log/unifi-poller/log
The manual explains the config file options: man unifi-poller
EOS
end
def plist; <<-EOS
<?xml version="1.0" encoding="UTF-8"?>
@ -48,10 +56,6 @@ class UnifiPoller < Formula
<string>#{var}/log/unifi-poller/log</string>
<key>StandardOutPath</key>
<string>#{var}/log/unifi-poller/log</string>
<key>UserName</key>
<string>nobody</string>
<key>GroupName</key>
<string>nobody</string>
</dict>
</plist>
EOS