Forgot the template
This commit is contained in:
parent
96d52bf465
commit
45b8ce3cec
|
|
@ -0,0 +1,2 @@
|
||||||
|
This folder contains build templates.
|
||||||
|
Used to create packages and homebrew formula.
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
# Homebrew Formula, still under development - June 2019
|
||||||
|
require "language/go"
|
||||||
|
|
||||||
|
# Classname should match the name of the installed package.
|
||||||
|
class UnifiPoller < Formula
|
||||||
|
version "{{Version}}"
|
||||||
|
sha256 "{{SHA256}}"
|
||||||
|
url "{{URL}}/archive/v#{version}.tar.gz"
|
||||||
|
head "{{URL}}"
|
||||||
|
desc "{{Desc}}"
|
||||||
|
homepage "{{URL}}"
|
||||||
|
|
||||||
|
depends_on "go" => :build
|
||||||
|
depends_on "dep"
|
||||||
|
|
||||||
|
def install
|
||||||
|
ENV["GOPATH"] = buildpath
|
||||||
|
|
||||||
|
bin_path = buildpath/"src/github.com/davidnewhall/unifi-poller"
|
||||||
|
# Copy all files from their current location (GOPATH root)
|
||||||
|
# to $GOPATH/src/github.com/davidnewhall/unifi-poller
|
||||||
|
bin_path.install Dir["*"]
|
||||||
|
cd bin_path do
|
||||||
|
system "dep", "ensure"
|
||||||
|
system "make", "install", "VERSION=#{version}", "PREFIX=#{prefix}"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
test do
|
||||||
|
assert_match "unifi-poller v#{version}", shell_output("#{bin}/unifi-poller -v 2>&1", 2)
|
||||||
|
end
|
||||||
|
end
|
||||||
Loading…
Reference in New Issue