Make brew pass all audit tests.
This commit is contained in:
		
							parent
							
								
									c35266af2f
								
							
						
					
					
						commit
						077cab1cd2
					
				
							
								
								
									
										2
									
								
								Makefile
								
								
								
								
							
							
						
						
									
										2
									
								
								Makefile
								
								
								
								
							|  | @ -4,7 +4,7 @@ | ||||||
| BINARY:=unifi-poller | BINARY:=unifi-poller | ||||||
| URL:=https://github.com/davidnewhall/$(BINARY) | URL:=https://github.com/davidnewhall/$(BINARY) | ||||||
| MAINT=David Newhall II <david at sleepers dot pro> | MAINT=David Newhall II <david at sleepers dot pro> | ||||||
| DESC=This daemon polls a UniFi controller at a short interval and stores the collected measurements in an Influx Database. | DESC=Polls a UniFi controller and stores metrics in InfluxDB | ||||||
| GOLANGCI_LINT_ARGS=--enable-all -D gochecknoglobals | GOLANGCI_LINT_ARGS=--enable-all -D gochecknoglobals | ||||||
| DOCKER_REPO=golift | DOCKER_REPO=golift | ||||||
| MD2ROFF_BIN=github.com/github/hub/md2roff-bin | MD2ROFF_BIN=github.com/github/hub/md2roff-bin | ||||||
|  |  | ||||||
|  | @ -1,13 +1,10 @@ | ||||||
| # Homebrew Formula Template. Built by Makefile: `make fomula` | # Homebrew Formula Template. Built by Makefile: `make fomula` | ||||||
| require "language/go" |  | ||||||
| 
 |  | ||||||
| class UnifiPoller < Formula | class UnifiPoller < Formula | ||||||
|   version "{{Version}}" |  | ||||||
|   sha256 "{{SHA256}}" |  | ||||||
|   url "{{URL}}/archive/v#{version}.tar.gz" |  | ||||||
|   head "{{URL}}" |  | ||||||
|   desc "{{Desc}}" |   desc "{{Desc}}" | ||||||
|   homepage "{{URL}}" |   homepage "{{URL}}" | ||||||
|  |   url "{{URL}}/archive/v{{Version}}.tar.gz" | ||||||
|  |   sha256 "{{SHA256}}" | ||||||
|  |   head "{{URL}}" | ||||||
| 
 | 
 | ||||||
|   depends_on "go" => :build |   depends_on "go" => :build | ||||||
|   depends_on "dep" |   depends_on "dep" | ||||||
|  | @ -20,16 +17,17 @@ class UnifiPoller < Formula | ||||||
|     # to $GOPATH/src/github.com/davidnewhall/unifi-poller |     # to $GOPATH/src/github.com/davidnewhall/unifi-poller | ||||||
|     bin_path.install Dir["*"] |     bin_path.install Dir["*"] | ||||||
|     cd bin_path do |     cd bin_path do | ||||||
|       system "dep", "ensure" |       system "dep", "ensure", "-vendor-only" | ||||||
|       system "make", "install", "VERSION=#{version}", "PREFIX=#{prefix}", "ETC=#{etc}" |       system "make", "install", "VERSION=#{version}", "PREFIX=#{prefix}", "ETC=#{etc}" | ||||||
|       # If this fails, the user gets a nice big warning about write permissions on their |       # If this fails, the user gets a nice big warning about write permissions on their | ||||||
|       # #{var}/log folder. The alternative could be letting the app silently fail |       # #{var}/log folder. The alternative could be letting the app silently fail | ||||||
|       # to start when it cannot write logs. This is better. Fix perms; reinstall. |       # to start when it cannot write logs. This is better. Fix perms; reinstall. | ||||||
|       system "touch", "#{var}/log/unifi-poller.log" |       touch("#{var}/log/unifi-poller.log") | ||||||
|     end |     end | ||||||
|   end |   end | ||||||
|  | 
 | ||||||
|   def caveats |   def caveats | ||||||
|     s = <<-EOS |     <<-EOS | ||||||
|   This application will not work until the config file has authentication |   This application will not work until the config file has authentication | ||||||
|   information for a UniFi Controller and an Influx Database. Edit the config |   information for a UniFi Controller and an Influx Database. Edit the config | ||||||
|   file at #{etc}/unifi-poller/up.conf then start the application with |   file at #{etc}/unifi-poller/up.conf then start the application with | ||||||
|  | @ -38,7 +36,10 @@ class UnifiPoller < Formula | ||||||
|     EOS |     EOS | ||||||
|   end |   end | ||||||
| 
 | 
 | ||||||
|   def plist; <<-EOS |   plist_options :startup => true | ||||||
|  | 
 | ||||||
|  |   def plist | ||||||
|  |     <<-EOS | ||||||
|   <?xml version="1.0" encoding="UTF-8"?> |   <?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"> |   <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||||||
|   <plist version="1.0"> |   <plist version="1.0"> | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue