brew/Library/Homebrew/requirements/tuntap_dependency.rb
Mike McQuaid 515395171c Set cask and download DSL values on requirements.
Closes Homebrew/homebrew#35257.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2014-12-28 12:14:49 +00:00

15 lines
478 B
Ruby

require "requirement"
class TuntapDependency < Requirement
fatal true
default_formula "tuntap"
cask "tuntap"
satisfy { self.class.binary_tuntap_installed? || Formula["tuntap"].installed? }
def self.binary_tuntap_installed?
File.exist?("/Library/Extensions/tun.kext") && File.exist?("/Library/Extensions/tap.kext")
File.exist?("/Library/LaunchDaemons/net.sf.tuntaposx.tun.plist")
File.exist?("/Library/LaunchDaemons/net.sf.tuntaposx.tap.plist")
end
end