Files
termux-packages/packages/nmap/build.sh
termux-pacman-bot cc317b2fd6 fix(main/nmap): fix configure-time check for PF_PACKET support in libdnet
- Fixes https://github.com/termux/termux-packages/issues/25258

- After 210d6c0847, `nmap` has upgraded to a `libdnet` 1.18.0. Unfortunately, this version of `libdnet` includes a malformed autotools configure-time compiler check for the definition of `ETH_P_ALL` that has a function defintion inside another function definition, causing a near-silent error `error: function definition is not allowed here` when **Clang** is used to compile (as opposed to GCC, which is somehow able to successfully compile the same code):

06ecd5d459/configure (L15565-L15571)

- This works around the problem by patching the `libdnet-stripped/configure` file to run the check in such a way that the code checking for `ETH_P_ALL` properly compiles with no errors.

- Issue opened upstream here: https://github.com/ofalk/libdnet/issues/109
2025-07-08 01:34:59 +00:00

38 lines
1.3 KiB
Bash

TERMUX_PKG_HOMEPAGE=https://nmap.org/
TERMUX_PKG_DESCRIPTION="Utility for network discovery and security auditing"
TERMUX_PKG_LICENSE="custom"
TERMUX_PKG_LICENSE_FILE="LICENSE"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="7.97"
TERMUX_PKG_REVISION=4
TERMUX_PKG_SRCURL=https://nmap.org/dist/nmap-${TERMUX_PKG_VERSION}.tar.bz2
TERMUX_PKG_SHA256=af98f27925c670c257dd96a9ddf2724e06cb79b2fd1e0d08c9206316be1645c0
TERMUX_PKG_DEPENDS="libc++, liblua54, libpcap, libssh2, openssl, pcre2, resolv-conf, zlib"
TERMUX_PKG_BREAKS="nmap-ncat"
TERMUX_PKG_REPLACES="nmap-ncat"
TERMUX_PKG_PROVIDES="nc, ncat, netcat"
# --without-nmap-update to avoid linking against libsvn_client:
# --without-zenmap to avoid python scripts for graphical gtk frontend:
# --without-ndiff to avoid python2-using ndiff utility:
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
--enable-static
--with-liblua=$TERMUX_PREFIX
--without-nmap-update
--without-zenmap
--without-ndiff
"
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_BUILD_IN_SRC=true
termux_step_pre_configure() {
if [[ "$TERMUX_DEBUG_BUILD" == "true" ]]; then
STRIP="$(command -v true)"
fi
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_path_STRIP=$STRIP"
}
termux_step_post_massage() {
mv -v bin/ncat bin/netcat-nmap
mv -v share/man/man1/ncat.1.gz share/man/man1/netcat-nmap.1.gz
}