<commit_before>require "formula"

class P0f < Formula
  homepage "http://lcamtuf.coredump.cx/p0f3/"
  url "http://lcamtuf.coredump.cx/p0f3/releases/p0f-3.07b.tgz"
  sha1 "ae2c4fbcddf2a5ced33abd81992405b93207e7c8"

  def install
    inreplace "config.h", "p0f.fp", "#{etc}/p0f/p0f.fp"
    system "./build.sh"
    sbin.install "p0f"
    (etc+"p0f").install "p0f.fp"
  end

  test do
    require "base64"

    pcap = "1MOyoQIABAAAAAAAAAAAAP//AAAAAAAA92EsVI67DgBEAAAA" \
           "RAAAAAIAAABFAABAbvpAAEAGAAB/AAABfwAAAcv8Iyjt2/Pg" \
           "AAAAALAC///+NAAAAgQ/2AEDAwQBAQgKCyrc9wAAAAAEAgAA"
    (testpath / "test.pcap").write(Base64.decode64(pcap))
    system "#{sbin}/p0f", "-r", "test.pcap"
  end
end<commit_msg>p0f: add 3.07b bottle.<commit_after>require "formula"

class P0f < Formula
  homepage "http://lcamtuf.coredump.cx/p0f3/"
  url "http://lcamtuf.coredump.cx/p0f3/releases/p0f-3.07b.tgz"
  sha1 "ae2c4fbcddf2a5ced33abd81992405b93207e7c8"

  bottle do
    cellar :any
    sha1 "eceeb864d78eb22bd5808690f1ce818f196b0c9b" => :mavericks
    sha1 "261610220600d44a55fd31c2ca68849cc9e4db4f" => :mountain_lion
    sha1 "47e0e995504b87ea470c5ebb6583bd67cd447f95" => :lion
  end

  def install
    inreplace "config.h", "p0f.fp", "#{etc}/p0f/p0f.fp"
    system "./build.sh"
    sbin.install "p0f"
    (etc+"p0f").install "p0f.fp"
  end

  test do
    require "base64"

    pcap = "1MOyoQIABAAAAAAAAAAAAP//AAAAAAAA92EsVI67DgBEAAAA" \
           "RAAAAAIAAABFAABAbvpAAEAGAAB/AAABfwAAAcv8Iyjt2/Pg" \
           "AAAAALAC///+NAAAAgQ/2AEDAwQBAQgKCyrc9wAAAAAEAgAA"
    (testpath / "test.pcap").write(Base64.decode64(pcap))
    system "#{sbin}/p0f", "-r", "test.pcap"
  end
end
{'fraction_non_alphanumeric': 0.14166168559474, 'fraction_numerical': 0.11297071129707113, 'mean_word_length': 3.598901098901099, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '773144', 'n_tokens_mistral': 883, 'n_tokens_neox': 793, 'n_words': 96}