<commit_before>require "formula"

class Tuntap < Formula
  homepage "http://tuntaposx.sourceforge.net/"

  stable do
    url "https://downloads.sourceforge.net/project/tuntaposx/tuntap/20111101/tuntap_20111101_src.tar.gz"
    sha1 "826f79f60dc40cee607ffc2b7e79874b1c686f28"
    # Get Kernel.framework headers from the SDK
    patch :p2, :DATA
  end

  head do
    url "git://git.code.sf.net/p/tuntaposx/code"
    # Get Kernel.framework headers from the SDK
    patch :DATA
  end

  bottle do
    cellar :any
    sha1 "66c5936c679b961089df84668a8c04bce56d992c" => :mavericks
    sha1 "80bfd6bcec776491065be0450ce2c47dc2d7a567" => :mountain_lion
    sha1 "a3e380d8080ce9cf75f04cc80dcc869cf93b0276" => :lion
  end

  depends_on UnsignedKextRequirement

  def install
    cd "tuntap" if build.head?
    ENV.j1 # to avoid race conditions (can't open: ../tuntap.o)
    system "make", "CC=#{ENV.cc}", "CCP=#{ENV.cxx}"
    kext_prefix.install "tun.kext", "tap.kext"
    prefix.install "startup_item/tap", "startup_item/tun"
  end

  def caveats; <<-EOS.undent
      In order for TUN/TAP network devices to work, the tun/tap kernel extensions
      must be installed by the root user:<commit_msg>tuntap: set kext cask and binary.<commit_after>require "formula"

class Tuntap < Formula
  homepage "http://tuntaposx.sourceforge.net/"

  stable do
    url "https://downloads.sourceforge.net/project/tuntaposx/tuntap/20111101/tuntap_20111101_src.tar.gz"
    sha1 "826f79f60dc40cee607ffc2b7e79874b1c686f28"
    # Get Kernel.framework headers from the SDK
    patch :p2, :DATA
  end

  head do
    url "git://git.code.sf.net/p/tuntaposx/code"
    # Get Kernel.framework headers from the SDK
    patch :DATA
  end

  bottle do
    cellar :any
    sha1 "66c5936c679b961089df84668a8c04bce56d992c" => :mavericks
    sha1 "80bfd6bcec776491065be0450ce2c47dc2d7a567" => :mountain_lion
    sha1 "a3e380d8080ce9cf75f04cc80dcc869cf93b0276" => :lion
  end

  depends_on UnsignedKextRequirement => [ :cask => "tuntap",
      :binary => "http://sourceforge.net/projects/tuntaposx/files/tuntap/" ]

  def install
    cd "tuntap" if build.head?
    ENV.j1 # to avoid race conditions (can't open: ../tuntap.o)
    system "make", "CC=#{ENV.cc}", "CCP=#{ENV.cxx}"
    kext_prefix.install "tun.kext", "tap.kext"
    prefix.install "startup_item/tap", "startup_item/tun"
  end

  def caveats; <<-EOS.undent
      In order for TUN/TAP network devices to work, the tun/tap kernel extensions
      must be installed by the root user:
{'fraction_non_alphanumeric': 0.10821643286573146, 'fraction_numerical': 0.09859719438877755, 'mean_word_length': 3.6394052044609664, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 12, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5584837', 'n_tokens_mistral': 1140, 'n_tokens_neox': 993, 'n_words': 206}