-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathyubikeylockd.rb
63 lines (59 loc) · 2.15 KB
/
yubikeylockd.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
class Yubikeylockd < Formula
desc 'Simple daemon for locking and unlocking macOS with Yubikey.'
homepage 'https://github.com/shtirlic/yubikeylockd'
url 'https://github.com/shtirlic/yubikeylockd/archive/v1.1.zip'
head 'https://github.com/shtirlic/yubikeylockd.git'
sha256 '44ba63cb286c29fa653d2307f053162bb600a7138e6f6766d40144a504a376b7'
def install
# ENV.deparallelize # if your formula fails when building in parallel
system 'make', 'yubikeylockd'
# system "install" # if this fails, try separate make/make install steps
bin.install 'yubikeylockd'
end
plist_options startup: true
def plist
<<-PLIST
<?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}/yubikeylockd</string>
</array>
<key>LaunchEvents</key>
<dict>
<key>com.apple.iokit.matching</key>
<dict>
<key>com.apple.device-attach</key>
<dict>
<key>idProduct</key>
<string>*</string>
<key>idVendor</key>
<integer>4176</integer>
<key>IOProviderClass</key>
<string>IOUSBDevice</string>
<key>IOMatchLaunchStream</key>
<true/>
</dict>
</dict>
</dict>
</dict>
</plist>
PLIST
end
test do
# `test do` will create, run in and delete a temporary directory.
#
# This test will fail and we won't accept that! It's enough to just replace
# "false" with the main program this formula installs, but it'd be nice if you
# were more thorough. Run the test with `brew test yubikeylockd`. Options passed
# to `brew install` such as `--HEAD` also need to be provided to `brew test`.
#
# The installed folder is not in the path, so use the entire path to any
# executables being tested: `system "#{bin}/program", "do", "something"`.
system 'true'
end
end