aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorDominyk Tiller2014-11-04 04:01:10 +0000
committerMike McQuaid2014-11-07 09:12:29 +0000
commit97eac8853efdce75f9007ee8b0af77bca0973947 (patch)
tree2f40e0c9e726803b7299dc1bc75f41809bfcc5d2 /Library/Homebrew
parentc5f549e33c417bd60c44f203b7bb3356d4f30271 (diff)
downloadbrew-97eac8853efdce75f9007ee8b0af77bca0973947.tar.bz2
tuntap: recommend upstream signed binary.
We have an upstream signed binary available! Big big love to Mattias for this. This PR converts all the existing tuntap dependencies into binary-friendly tuntap dependencies, and adds a tuntap dependency to requirements to look for the kexts. Closes Homebrew/homebrew#33894. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/dependency_collector.rb1
-rw-r--r--Library/Homebrew/requirements.rb1
-rw-r--r--Library/Homebrew/requirements/tuntap_dependency.rb13
3 files changed, 15 insertions, 0 deletions
diff --git a/Library/Homebrew/dependency_collector.rb b/Library/Homebrew/dependency_collector.rb
index 1641c71e6..b7bd1376b 100644
--- a/Library/Homebrew/dependency_collector.rb
+++ b/Library/Homebrew/dependency_collector.rb
@@ -120,6 +120,7 @@ class DependencyCollector
when :python3 then Python3Dependency.new(tags)
when :java then JavaDependency.new(tags)
when :osxfuse then OsxfuseDependency.new(tags)
+ when :tuntap then TuntapDependency.new(tags)
# Tiger's ld is too old to properly link some software
when :ld64 then LD64Dependency.new if MacOS.version < :leopard
when :ant then ant_dep(spec, tags)
diff --git a/Library/Homebrew/requirements.rb b/Library/Homebrew/requirements.rb
index 7dcd5039f..d387d3871 100644
--- a/Library/Homebrew/requirements.rb
+++ b/Library/Homebrew/requirements.rb
@@ -6,6 +6,7 @@ require 'requirements/maximum_macos_requirement'
require 'requirements/mpi_dependency'
require 'requirements/osxfuse_dependency'
require 'requirements/python_dependency'
+require 'requirements/tuntap_dependency'
require 'requirements/unsigned_kext_requirement'
require 'requirements/x11_dependency'
diff --git a/Library/Homebrew/requirements/tuntap_dependency.rb b/Library/Homebrew/requirements/tuntap_dependency.rb
new file mode 100644
index 000000000..cf306b5cd
--- /dev/null
+++ b/Library/Homebrew/requirements/tuntap_dependency.rb
@@ -0,0 +1,13 @@
+require "requirement"
+
+class TuntapDependency < Requirement
+ fatal true
+ default_formula "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