# frozen_string_literal: true # Generated by generate_tap.py for local/mirror class Nmap < Formula desc "Port scanning utility for large networks" homepage "https://nmap.org/" url "https://homebrew.hyprnet/sources/99a99a91c5ac9ee8b2a036ca65aec48d1e640eaa04840c4b6d755610cf8cfee3--nmap--7.99.x86_64_linux.bottle.tar.gz" sha256 "df512492ffd108e53a27a06f26d8635bbe89e0e569455dc8ffef058c035d51b2" license :cannot_represent compatibility_version 1 head "https://svn.nmap.org/nmap/" livecheck do url "https://nmap.org/download" regex(/href=.*?nmap[._-]v?(\d+(?:\.\d+)+)\.t/i) end bottle do root_url "https://homebrew.hyprnet/bottles" sha256 arm64_tahoe: "610785e4dd545c5f71d3af2d221f8a92951714710cf98ac4ed10f6fd0d0c5153" sha256 arm64_sequoia: "5840513b1bcc8c8e20b68a1a9e71977d424827ba9e26c157e79760dc218fb55e" sha256 arm64_sonoma: "47740d854f1669dc68deabbfd6f5d54036c99ddb606ba39d70e747f7632f4f85" sha256 sonoma: "a5c5594350aad5168e64c364c6508b669cd5ea2273ad0f88d005b27de75cd5bd" sha256 arm64_linux: "55edc13eebfb103bdc26cdcb479daf81d709b727d6c6e2e22ae2c447cebc638a" sha256 x86_64_linux: "71db30907d6cd22b65e60fbb825cbc394ea291123aba6f9422342026bdddd6ad" end depends_on "python-setuptools" => :build depends_on "liblinear" depends_on "libssh2" # Check supported Lua version at https://github.com/nmap/nmap/tree/master/liblua. depends_on "lua" depends_on "openssl@3" depends_on "pcre2" depends_on "python@3.14" # for ndiff uses_from_macos "bison" => :build uses_from_macos "flex" => :build uses_from_macos "libpcap" on_linux do depends_on "zlib-ng-compat" end conflicts_with "cern-ndiff", "ndiff", because: "both install `ndiff` binaries" conflicts_with cask: "zenmap", because: "both install `nmap` binaries" def install # Fix to missing VERSION file # https://github.com/nmap/nmap/pull/3111 mv "libpcap/VERSION.txt", "libpcap/VERSION" ENV.deparallelize libpcap_path = if OS.mac? MacOS.sdk_path/"usr/" else formula_opt_prefix("libpcap") end args = %W[ --with-liblua=#{formula_opt_prefix("lua")} --with-libpcre=#{formula_opt_prefix("pcre2")} --with-openssl=#{formula_opt_prefix("openssl@3")} --with-libpcap=#{libpcap_path} --without-nmap-update --disable-universal --without-zenmap --without-ndiff ] system "./configure", *args, *std_configure_args system "make" # separate steps required otherwise the build fails system "make", "install" # Install `ndiff` separately so that we can use `pip` and `setuptools`. system "python3", "-m", "pip", "install", *std_pip_args, "./ndiff" bin.glob("uninstall_*").map(&:unlink) # Users should use brew uninstall. end test do system bin/"nmap", "-p80,443", "-oX", "scan1.xml", "google.com" cp "scan1.xml", "scan2.xml" system bin/"ndiff", "scan1.xml", "scan2.xml" end end