brew/Library/Homebrew/requirements/tuntap_requirement.rb
Mike McQuaid 1e86730289 Rename requirements named *Dependency.
Dependency is another similar, related class and it's super confusing
to have some Requirements that are named *Dependency.

Closes Homebrew/homebrew#38891.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-06-16 08:12:01 +01:00

15 lines
479 B
Ruby

require "requirement"
class TuntapRequirement < 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