2014-11-04 04:01:10 +00:00
|
|
|
require "requirement"
|
|
|
|
|
2015-06-15 09:56:04 +01:00
|
|
|
class TuntapRequirement < Requirement
|
2014-11-04 04:01:10 +00:00
|
|
|
fatal true
|
2014-12-25 20:44:43 +00:00
|
|
|
cask "tuntap"
|
2016-09-17 15:32:44 +01:00
|
|
|
satisfy(build_env: false) { self.class.binary_tuntap_installed? }
|
2014-11-04 04:01:10 +00:00
|
|
|
|
|
|
|
def self.binary_tuntap_installed?
|
2016-07-10 13:53:37 +01:00
|
|
|
%w[
|
|
|
|
/Library/Extensions/tun.kext
|
|
|
|
/Library/Extensions/tap.kext
|
|
|
|
/Library/LaunchDaemons/net.sf.tuntaposx.tun.plist
|
|
|
|
/Library/LaunchDaemons/net.sf.tuntaposx.tap.plist
|
|
|
|
].all? { |file| File.exist?(file) }
|
2014-11-04 04:01:10 +00:00
|
|
|
end
|
|
|
|
end
|