parent
8c535c40c6
commit
1a91e9477c
|
|
@ -23,10 +23,15 @@ script:
|
|||
# get deploy key for golift/homebrew-repo.
|
||||
after_success:
|
||||
- |
|
||||
openssl aes-256-cbc -K $encrypted_9f3147001275_key -iv $encrypted_9f3147001275_iv -in github_deploy_key.enc -out github_deploy_key -d
|
||||
$(npm bin)/set-up-ssh --key "$encrypted_9f3147001275_key" \
|
||||
--iv "$encrypted_9f3147001275_iv" \
|
||||
--path-encrypted-key ".travis/github_deploy_key.enc"
|
||||
declare -r SSH_FILE="$(mktemp -u $HOME/.ssh/XXXXX)"
|
||||
echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
|
||||
openssl aes-256-cbc -K $encrypted_9f3147001275_key -iv $encrypted_9f3147001275_iv -in ".travis/github_deploy_key.enc" -out "$SSH_FILE" -d
|
||||
chmod 600 "$SSH_FILE" \
|
||||
&& printf "%s\n" \
|
||||
"Host github.com" \
|
||||
" IdentityFile $SSH_FILE" \
|
||||
" StrictHostKeyChecking no" \
|
||||
" LogLevel ERROR" >> ~/.ssh/config
|
||||
deploy:
|
||||
- provider: releases
|
||||
api_key:
|
||||
|
|
|
|||
|
|
@ -179,13 +179,14 @@ install: man readme $(BINARY)
|
|||
@echo - Otherwise, build and install a package: make rpm -or- make deb
|
||||
@echo See the Package Install wiki for more info: $(URL)/wiki/Package-Install
|
||||
@[ "$$(uname)" = "Darwin" ] || (echo "Unable to continue, not a Mac." && false)
|
||||
@[ "$(PREFIX)" != "" ] || (echo "Unable to continue, PREFIX not set. Use: make install PREFIX=/usr/local" && false)
|
||||
@[ "$(PREFIX)" != "" ] || (echo "Unable to continue, PREFIX not set. Use: make install PREFIX=/usr/local ETC=/usr/local/etc" && false)
|
||||
@[ "$(ETC)" != "" ] || (echo "Unable to continue, ETC not set. Use: make install PREFIX=/usr/local ETC=/usr/local/etc" && false)
|
||||
# Copying the binary, config file, unit file, and man page into the env.
|
||||
/usr/bin/install -m 0755 -d $(PREFIX)/bin $(PREFIX)/share/man/man1 $(PREFIX)/etc/$(BINARY) $(PREFIX)/share/doc/$(BINARY)/examples
|
||||
/usr/bin/install -m 0755 -d $(PREFIX)/bin $(PREFIX)/share/man/man1 $(ETC)/$(BINARY) $(PREFIX)/share/doc/$(BINARY)/examples
|
||||
/usr/bin/install -m 0755 -cp $(BINARY) $(PREFIX)/bin/$(BINARY)
|
||||
/usr/bin/install -m 0644 -cp $(BINARY).1.gz $(PREFIX)/share/man/man1
|
||||
/usr/bin/install -m 0644 -cp examples/up.conf.example $(PREFIX)/etc/$(BINARY)/
|
||||
[ -f $(PREFIX)/etc/$(BINARY)/up.conf ] || /usr/bin/install -m 0644 -cp examples/up.conf.example $(PREFIX)/etc/$(BINARY)/up.conf
|
||||
/usr/bin/install -m 0644 -cp examples/up.conf.example $(ETC)/$(BINARY)/
|
||||
[ -f $(ETC)/$(BINARY)/up.conf ] || /usr/bin/install -m 0644 -cp examples/up.conf.example $(ETC)/$(BINARY)/up.conf
|
||||
/usr/bin/install -m 0644 -cp *.html examples/{*dash.json,up.conf.example} $(PREFIX)/share/doc/$(BINARY)/
|
||||
# These go to their own folder so the img src in the html pages continue to work.
|
||||
/usr/bin/install -m 0644 -cp examples/*.png $(PREFIX)/share/doc/$(BINARY)/examples
|
||||
|
|
|
|||
|
|
@ -21,10 +21,42 @@ class UnifiPoller < Formula
|
|||
bin_path.install Dir["*"]
|
||||
cd bin_path do
|
||||
system "dep", "ensure"
|
||||
system "make", "install", "VERSION=#{version}", "PREFIX=#{prefix}"
|
||||
system "make", "install", "VERSION=#{version}", "PREFIX=#{prefix}", "ETC=#{etc}"
|
||||
end
|
||||
end
|
||||
|
||||
plist_options :startup => true
|
||||
|
||||
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>#{bin}/unifi-poller</string>
|
||||
<string>-c</string>
|
||||
<string>#{etc}/unifi-poller/up.conf</string>
|
||||
</array>
|
||||
<key>RunAtLoad</key>
|
||||
<true/>
|
||||
<key>KeepAlive</key>
|
||||
<true/>
|
||||
<key>StandardErrorPath</key>
|
||||
<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
|
||||
end
|
||||
|
||||
test do
|
||||
assert_match "unifi-poller v#{version}", shell_output("#{bin}/unifi-poller -v 2>&1", 2)
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue