#!/bin/mkpkg # description: Network exploration tool and security scanner # url: https://nmap.org name=nmap version=7.991 release=1 depends=(libpcap pcre2 libressl libssh2 lua zlib) capabilities=( /usr/bin/nmap:cap_net_raw,cap_net_admin,cap_net_bind_service+eip ) source=(https://nmap.org/dist/$name-$version.tar.bz2) sha256sums=( "a5d507f29437bef3bedd4771ff9aaa8fc1c2a109ddba1f5b1cf12027456929be" ) patch() { cd $name-$version # --- LibreSSL compatibility (from Gentoo libressl overlay) --- # Enable opaque struct codepaths for LibreSSL >= 3.5.0 # Upstream guards these with '&& !defined LIBRESSL_VERSION_NUMBER' # but LibreSSL has had opaque structs since 2.x for f in nse_ssl_cert.cc nse_openssl.cc ncat/ncat_ssl.c nping/Crypto.cc; do sed -i 's/&& !defined LIBRESSL_VERSION_NUMBER//' "$f" done # EC_GROUP_method_of() removed in LibreSSL >= 4.0 # Explicit curves are rare in X.509 (RFC 5480); default to prime field sed -i 's/EC_METHOD_get_field_type(EC_GROUP_method_of(group))/NID_X9_62_prime_field/' \ nse_ssl_cert.cc sed -i 's/ac_cv_dnet_linux_pf_packet=no/ac_cv_dnet_linux_pf_packet=yes/' \ libdnet-stripped/configure } build() { cd $name-$version ./configure \ CC=${CC:-cc} CXX=${CXX:-c++} \ --prefix=/usr \ --mandir=/usr/share/man \ --without-ncat \ --without-zenmap \ --without-ndiff \ --without-nmap-update \ --with-openssl \ --with-libpcap \ --with-libpcre \ --with-liblua \ --with-libssh2 \ --with-libdnet=included \ --with-liblinear=included make make DESTDIR=$PKG install rm -f $PKG/usr/share/man/man1/ncat.1 } signify() { untrusted comment: public key RWTZ9IduCSQ/mL8337TEUinPwT92xFEUpD92hkS7IxcOnzTt9QdpohT3 } # vim: filetype=sh