distributable:
  url: https://nmap.org/dist/nmap-{{version.raw}}.tgz
  strip-components: 1

versions:
  url: https://nmap.org/dist/
  match: /nmap-\d+\.\d+(\.\d+)?\.tgz/
  strip:
    - /nmap-/
    - /.tgz/

dependencies:
  openssl.org: ^1.1

build:
  dependencies:
    gnu.org/patch: '*'
    crates.io/semverator: '*'
  script:
    # https://github.com/openresty/openresty/issues/372
    - >
      semverator satisfies '<7.94.0' {{version}} &&
      patch -p1 <props/openssl-1.1.1.patch

    - ./configure --prefix={{prefix}}
    - make -j {{hw.concurrency}}
    - make install
  test:
    make test

test:
  script: nmap -vvvv localhost

provides:
  - bin/nmap
  - bin/ncat
  - bin/nping
