<?xml version="1.0"?>
<!DOCTYPE moduleset SYSTEM "moduleset.dtd" [
<!ENTITY nmap_version "7.991">
<!ENTITY openssl_version "3.0.21">
<!ENTITY libpcap_version "1.10.6">
<!ENTITY libssh2_version "1.11.1">
]>
<?xml-stylesheet type="text/xsl" href="moduleset.xsl"?>
<moduleset>

    <!-- REPOSITORIES -->

    <repository type="tarball" name="openssl" href="https://github.com/openssl/openssl/releases/download/openssl-&openssl_version;/"/>
    <repository type="tarball" name="nmap-local" href="http://localhost:8000/"/>
    <repository type="tarball" name="tcpdump-org" href="https://www.tcpdump.org/release/"/>
    <repository type="tarball" name="libssh2-org" href="https://www.libssh2.org/download/"/>

    <!-- MODULES -->
    <cmake id="libpcap">
        <branch repo="tcpdump-org" version="&libpcap_version;" module="libpcap-&libpcap_version;.tar.xz"/>
        <dependencies>
            <dep package="openssl" />
        </dependencies>
    </cmake>
    <cmake id="libssh2">
        <branch repo="libssh2-org" version="&libssh2_version;" module="libssh2-&libssh2_version;.tar.xz"/>
        <dependencies>
            <dep package="openssl" />
            <dep package="zlib" />
        </dependencies>
    </cmake>

    <autotools id="xopenssl" autogen-sh="Configure" autogenargs="shared no-dso enable-legacy enable-ssl3 enable-ssl3-method enable-weak-ssl-ciphers"
        autogen-template="%(srcdir)s/%(autogen-sh)s --prefix=%(prefix)s
            --openssldir=%(prefix)s/etc/ssl %(autogenargs)s"
            makeargs="depend all"
        makeinstallargs="INSTALL_PREFIX='$(DESTDIR)' install_dev"
        supports-parallel-builds="no"
        supports-non-srcdir-builds="no">
        <branch repo="openssl" version="&openssl_version;" module="openssl-&openssl_version;.tar.gz"/>
    </autotools>

<!-- Remove "-\-with-libssh2=included" when libssh2 upstream releases a version greater than 1.11.1 to address CVEs we patched in our copy. -->
    <autotools id="nmap" supports-non-srcdir-builds="no"
       autogen-sh="configure" autogenargs="--with-libdnet=included --with-liblua=included
--with-libssh2=included
--without-zenmap --without-ncat --without-ndiff --without-nping"
    >
        <branch repo="nmap-local" module="nmap-&nmap_version;.tar.gz" version="&nmap_version;"/>
        <dependencies>
            <dep package="libpcap" />
            <dep package="libpcre2" />
            <dep package="libssh2" />
            <dep package="openssl" />
            <dep package="zlib" />
        </dependencies>
    </autotools>
 
    <autotools id="ncat" supports-non-srcdir-builds="no"
       autogen-sh="configure" autogenargs="--with-libdnet=included --with-liblua=included
--without-zenmap --without-ndiff --without-nping"
        makeargs='build-ncat'
        makeinstallargs='install-ncat'
    >
        <branch repo="nmap-local" module="nmap-&nmap_version;.tar.gz" version="&nmap_version;"/>
        <dependencies>
            <dep package="openssl" />
        </dependencies>
    </autotools>

    <autotools id="nping" supports-non-srcdir-builds="no"
       autogen-sh="configure" autogenargs="--with-libdnet=included
--without-zenmap --without-ncat --without-ndiff"
        makeargs='build-nping'
        makeinstallargs='install-nping'
    >
        <branch repo="nmap-local" module="nmap-&nmap_version;.tar.gz" version="&nmap_version;"/>
        <dependencies>
            <dep package="libpcap" />
            <dep package="openssl" />
        </dependencies>
    </autotools>

    <!-- METAMODULE -->

    <metamodule id="nmap-deps">
        <dependencies>
            <dep package="libpcap" />
            <dep package="libpcre2" />
            <dep package="libssh2" />
            <dep package="openssl" />
            <dep package="zlib" />
        </dependencies>
    </metamodule>
    <metamodule id="nmap-packages">
        <dependencies>
            <dep package="nmap" />
            <dep package="ncat" />
            <dep package="nping" />
        </dependencies>
    </metamodule>

</moduleset>
