homebrew-core/Formula/dnstwist.rb

133 lines
6.2 KiB
Ruby

class Dnstwist < Formula
include Language::Python::Virtualenv
desc "Test domains for typo squatting, phishing and corporate espionage"
homepage "https://github.com/elceef/dnstwist"
url "https://files.pythonhosted.org/packages/75/f9/0297d7572ab235e767e85279b3f28aee1cbfe59eaefa4d936836f796c9ea/dnstwist-20220815.tar.gz"
sha256 "82d6749b15461289413b6db9c6cc9000c18b33bbaed759657ab36183135885a5"
license "Apache-2.0"
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "8738d192dc5cda5e1e885ead7efa88d632e794ead4e3361f9290cf762a804a6c"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "42e80b6dc6ab07f4072e6b0d205c6a99146aecab6ea8721a9f3101a62ef91a6c"
sha256 cellar: :any_skip_relocation, monterey: "99701b420526d86e59f5b8d8124664f2f66b5dc1ef6a9e81405a3f88cc07b35a"
sha256 cellar: :any_skip_relocation, big_sur: "d5bc59c9698d207b484ce9900fa2c9f58b2917770384e24982ff8267f1c22038"
sha256 cellar: :any_skip_relocation, catalina: "372864f1f640d8cc303169e47005c7d2305d580ea1171339776d37ddedc1d7fe"
sha256 cellar: :any_skip_relocation, x86_64_linux: "a8d4be77912ecb1549e3e954684c90fdc8fb39c83002c15c73771dcf7cf2ae07"
end
depends_on "geoip"
depends_on "python@3.10"
depends_on "ssdeep"
uses_from_macos "libffi"
resource "aiohttp" do
url "https://files.pythonhosted.org/packages/5a/86/5f63de7a202550269a617a5d57859a2961f3396ecd1739a70b92224766bc/aiohttp-3.8.1.tar.gz"
sha256 "fc5471e1a54de15ef71c1bc6ebe80d4dc681ea600e68bfd1cbce40427f0b7578"
end
resource "aiosignal" do
url "https://files.pythonhosted.org/packages/27/6b/a89fbcfae70cf53f066ec22591938296889d3cc58fec1e1c393b10e8d71d/aiosignal-1.2.0.tar.gz"
sha256 "78ed67db6c7b7ced4f98e495e572106d5c432a93e1ddd1bf475e1dc05f5b7df2"
end
resource "async-timeout" do
url "https://files.pythonhosted.org/packages/54/6e/9678f7b2993537452710ffb1750c62d2c26df438aa621ad5fa9d1507a43a/async-timeout-4.0.2.tar.gz"
sha256 "2163e1640ddb52b7a8c80d0a67a08587e5d245cc9c553a74a847056bc2976b15"
end
resource "attrs" do
url "https://files.pythonhosted.org/packages/1a/cb/c4ffeb41e7137b23755a45e1bfec9cbb76ecf51874c6f1d113984ecaa32c/attrs-22.1.0.tar.gz"
sha256 "29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6"
end
resource "certifi" do
url "https://files.pythonhosted.org/packages/cc/85/319a8a684e8ac6d87a1193090e06b6bbb302717496380e225ee10487c888/certifi-2022.6.15.tar.gz"
sha256 "84c85a9078b11105f04f3036a9482ae10e4621616db313fe045dd24743a0820d"
end
resource "charset-normalizer" do
url "https://files.pythonhosted.org/packages/93/1d/d9392056df6670ae2a29fcb04cfa5cee9f6fbde7311a1bb511d4115e9b7a/charset-normalizer-2.1.0.tar.gz"
sha256 "575e708016ff3a5e3681541cb9d79312c416835686d054a23accb873b254f413"
end
resource "dnspython" do
url "https://files.pythonhosted.org/packages/99/fb/e7cd35bba24295ad41abfdff30f6b4c271fd6ac70d20132fa503c3e768e0/dnspython-2.2.1.tar.gz"
sha256 "0f7569a4a6ff151958b64304071d370daa3243d15941a7beedf0c9fe5105603e"
end
resource "frozenlist" do
url "https://files.pythonhosted.org/packages/8a/95/229aacfe85daa28e2792481a98c336bc30d3729533e6a44db537880aca21/frozenlist-1.3.1.tar.gz"
sha256 "3a735e4211a04ccfa3f4833547acdf5d2f863bfeb01cfd3edaffbc251f15cec8"
end
resource "geoip2" do
url "https://files.pythonhosted.org/packages/03/51/3fb1651db4bcb44d69a19b5e82e037f4de1b077974c7549adf8f3d42218b/geoip2-4.6.0.tar.gz"
sha256 "f0e80bce80b06bb38bd08bf4877d5a84e354e932095e6ccfb4d27bb598fa4f83"
end
resource "idna" do
url "https://files.pythonhosted.org/packages/62/08/e3fc7c8161090f742f504f40b1bccbfc544d4a4e09eb774bf40aafce5436/idna-3.3.tar.gz"
sha256 "9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d"
end
resource "maxminddb" do
url "https://files.pythonhosted.org/packages/64/56/fa6d67569af1038a253d2499a3d8cb0566228ff623527cda5ac570a2d165/maxminddb-2.2.0.tar.gz"
sha256 "e37707ec4fab115804670e0fb7aedb4b57075a8b6f80052bdc648d3c005184e5"
end
resource "multidict" do
url "https://files.pythonhosted.org/packages/fa/a7/71c253cdb8a1528802bac7503bf82fe674367e4055b09c28846fdfa4ab90/multidict-6.0.2.tar.gz"
sha256 "5ff3bd75f38e4c43f1f470f2df7a4d430b821c4ce22be384e1459cb57d6bb013"
end
resource "ppdeep" do
url "https://files.pythonhosted.org/packages/64/ad/ca722788606970d227b1778c158d4a04ffd8190487fa80b3273e3fa587ac/ppdeep-20200505.tar.gz"
sha256 "acc74bb902e6d21b03d39aed740597093c6562185bfe06da9b5272e01c80a1ff"
end
resource "requests" do
url "https://files.pythonhosted.org/packages/a5/61/a867851fd5ab77277495a8709ddda0861b28163c4613b011bc00228cc724/requests-2.28.1.tar.gz"
sha256 "7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983"
end
resource "tld" do
url "https://files.pythonhosted.org/packages/c1/39/68d5ecb596e02d235fc3b0914b1bf0840d8fbc155fa6ff194eee718469d9/tld-0.12.6.tar.gz"
sha256 "69fed19d26bb3f715366fb4af66fdeace896c55c052b00e8aaba3a7b63f3e7f0"
end
resource "urllib3" do
url "https://files.pythonhosted.org/packages/6d/d5/e8258b334c9eb8eb78e31be92ea0d5da83ddd9385dc967dd92737604d239/urllib3-1.26.11.tar.gz"
sha256 "ea6e8fb210b19d950fab93b60c9009226c63a28808bc8386e05301e25883ac0a"
end
resource "whois" do
url "https://files.pythonhosted.org/packages/3b/1d/a71a86f3a69a097f1c86b5225f6e962ad8156a72526249f29a34ab01d91a/whois-0.9.16.tar.gz"
sha256 "68df47af49c2e70a0e118efc5d34e9563256a81820deb8f86aff5af5ee309304"
end
resource "yarl" do
url "https://files.pythonhosted.org/packages/d6/04/255c68974ec47fa754564c4abba8f61f9ed68b869bbbb854198d6259c4f7/yarl-1.8.1.tar.gz"
sha256 "af887845b8c2e060eb5605ff72b6f2dd2aab7a761379373fd89d314f4752abbf"
end
def install
ENV.append "CPPFLAGS", "-I#{MacOS.sdk_path_if_needed}/usr/include/ffi"
venv = virtualenv_create(libexec, "python3.10")
venv.pip_install resources
(libexec/"bin").install "dnstwist.py" => "dnstwist"
(bin/"dnstwist").write_env_script libexec/"bin/dnstwist", PATH: "#{libexec}/bin:$PATH"
end
test do
output = shell_output("#{bin}/dnstwist -rsw brew.sh 2>&1")
assert_match version.to_s, output
assert_match "brew.sh", output
assert_match "NS:ns1.dnsimple.com", output
end
end