diff --git a/security/zenmap/Makefile b/security/zenmap/Makefile new file mode 100644 index 000000000..77d013168 --- /dev/null +++ b/security/zenmap/Makefile @@ -0,0 +1,61 @@ +PORTNAME= zenmap +DISTVERSION= 7.99 +PORTREVISION= 1 +CATEGORIES= security +MASTER_SITES= https://nmap.org/dist/ \ + LOCAL/ohauer +DISTNAME= nmap-${DISTVERSION} + +MAINTAINER= woodsb02@FreeBSD.org +COMMENT= GUI frontend for the Nmap scanning utility + +LICENSE= NPSL +LICENSE_NAME= Nmap Public Source License +LICENSE_PERMS= auto-accept dist-mirror pkg-mirror pkg-sell +LICENSE_FILE= ${WRKDIR}/nmap-${PORTVERSION}/LICENSE + +RUN_DEPENDS= nmap:security/nmap \ + ${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} +BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools>0:devel/py-setuptools@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}setuptools-gettext>0:devel/py-setuptools-gettext@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR} + +WRKSRC_SUBDIR= ${PORTNAME} +USES= dos2unix gnome python tar:bzip2 +DOS2UNIX_GLOB= *.xml +USE_GNOME= pygobject3 +USE_PYTHON= pep517 autoplist +PEP517_INSTALL_CMD?= ${PYTHON_CMD} -m installer --destdir ${STAGEDIR} --prefix ${PREFIX} ${BUILD_WRKSRC}/dist/${PKGNAMEPREFIX}${PORTNAME:C|[-_]+|_|g}-${DISTVERSION}*.whl + +NO_ARCH= yes + +OPTIONS_DEFINE= NLS +OPTIONS_SUB= yes + +NLS_CONFIGURE_ENABLE= nls +NLS_USES= gettext + +SUB_FILES= zenmap-root + +post-patch: + @${FIND} ${WRKDIR}/nmap-${PORTVERSION}/${PORTNAME} -name '*.py' -or -name '*.pyw' | ${XARGS} \ + ${REINPLACE_CMD} -e 's|^.*#!.*python.*$$|#!${PYTHON_CMD}|' + @${REINPLACE_CMD} -e 's|^.*#!.*python.*$$|#!${PYTHON_CMD}|' \ + ${WRKDIR}/nmap-${PORTVERSION}/${PORTNAME}/zenmap + +post-install: + ${INSTALL_SCRIPT} ${WRKDIR}/zenmap-root ${STAGEDIR}${PREFIX}/bin/ + @(cd ${STAGEDIR}${PREFIX}/share/pixmaps && ${LN} -sf ../zenmap/pixmaps/zenmap.png zenmap.png) + ${MKDIR} ${STAGEDIR}${PREFIX}${MAN1PREFIX}/man/man1 + ${INSTALL_MAN} ${WRKDIR}/nmap-${PORTVERSION}/docs/zenmap.1 \ + ${STAGEDIR}${PREFIX}${MAN1PREFIX}/man/man1/ + +.include + +.if defined(SSL_DEFAULT) +.if ${SSL_DEFAULT} == libressl +BROKEN= error: OpenSSL-3.0.0 is the minimum supported version. LibreSSL is not supported +.endif +.endif + +.include diff --git a/security/zenmap/distinfo b/security/zenmap/distinfo new file mode 100644 index 000000000..75f0f8b47 --- /dev/null +++ b/security/zenmap/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1779488647 +SHA256 (nmap-7.99.tar.bz2) = df512492ffd108e53a27a06f26d8635bbe89e0e569455dc8ffef058c035d51b2 +SIZE (nmap-7.99.tar.bz2) = 13036588 diff --git a/security/zenmap/files/patch-install_scripts_unix.diff b/security/zenmap/files/patch-install_scripts_unix.diff new file mode 100644 index 000000000..0ff8a76cc --- /dev/null +++ b/security/zenmap/files/patch-install_scripts_unix.diff @@ -0,0 +1,87 @@ +--- install_scripts/unix/su-to-zenmap.sh.bak 2026-05-22 18:09:23.374832000 -0500 ++++ install_scripts/unix/su-to-zenmap.sh 2026-05-22 18:09:41.345809000 -0500 +@@ -1,57 +1,34 @@ + #!/bin/sh +-#this code is bassed off of the debian su-to-root command +-#Joost Witteveen +-#Morten Brix Pedersen +-#Bill Allombert ++# Wrapper script which finds the right "su" program ++# to use for graphical root execution + +-PRIV=root +-COMMAND="zenmap" ++if [ `id -r -u` != "0" ] ; then ++ VARS="`echo $@`" + +-quote () { printf %s\\n "$1" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/'/" ; } ++ # Try qsudo first, should always be the default ++ which qsudo >/dev/null 2>/dev/null ++ if [ $? -eq 0 ] ; then ++ qsudo $VARS ++ exit $? ++ fi + +-for i in "$@"; do +- COMMAND="$COMMAND $(quote "$i")" +-done ++ # Now try gksu ++ which gksu >/dev/null 2>/dev/null ++ if [ $? -eq 0 ] ; then ++ gksu -a "$VARS" ++ exit $? ++ fi + +-euid=$(id -u) +-privid=$(id -u $PRIV) +-if test "$euid" = "$privid"; then +- $COMMAND ++ # Lastly we have kdesu ++ which kdesu >/dev/null 2>/dev/null ++ if [ $? -eq 0 ] ; then ++ kdesu -t -c "$VARS" ++ exit $? ++ fi ++ ++ # If no utility could be found... ++ echo "No graphical switch-user utility found!" ++ exit 1 + else +- if test -z "$SU_TO_ROOT_X"; then +- if which gksu >/dev/null 2>&1 ; then +- SU_TO_ROOT_X=gksu +- if test "X$KDE_FULL_SESSION" = "Xtrue" ; then +- if which kdesu >/dev/null 2>&1 ; then +- SU_TO_ROOT_X=kdesu +- elif test -x /usr/lib/kde4/libexec/kdesu ; then +- SU_TO_ROOT_X=kde4su +- fi; +- fi; +- elif which kdesu >/dev/null 2>&1 ; then +- SU_TO_ROOT_X=kdesu +- elif test -x /usr/lib/kde4/libexec/kdesu ; then +- SU_TO_ROOT_X=kde4su +- elif which ktsuss >/dev/null 2>&1 ; then +- SU_TO_ROOT_X=ktsuss +- elif which xterm>/dev/null 2>&1 ;then +- if which sudo>/dev/null 2>&1 ;then +- SU_TO_ROOT_X=sdterm +- else +- SU_TO_ROOT_X=sterm +- fi; +- else +- SU_TO_ROOT_X=su-to-root +- fi +- fi +- case $SU_TO_ROOT_X in +- gksu) gksu -u "$PRIV" "$COMMAND";; +- kdesu) kdesu -u "$PRIV" -c "$COMMAND";; +- kde4su) /usr/lib/kde4/libexec/kdesu -u "$PRIV" -c "$COMMAND";; +- ktsuss) ktsuss -u "$PRIV" "$COMMAND";; +- # As a last resort, open a new xterm use sudo/su +- sdterm) xterm -e "sudo -u $PRIV $COMMAND";; +- sterm) xterm -e "su -l $PRIV -c $COMMAND";; +- esac; ++ ${@} + fi +- diff --git a/security/zenmap/files/zenmap-root.in b/security/zenmap/files/zenmap-root.in new file mode 100644 index 000000000..51d0b61ab --- /dev/null +++ b/security/zenmap/files/zenmap-root.in @@ -0,0 +1,6 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +exec %%DATADIR%%/su-to-zenmap.sh zenmap diff --git a/security/zenmap/pkg-descr b/security/zenmap/pkg-descr new file mode 100644 index 000000000..ae2f9ead2 --- /dev/null +++ b/security/zenmap/pkg-descr @@ -0,0 +1,3 @@ +Zenmap is the official GUI front end for the Nmap port scanning tool. +Originally based on Umit, it has replaced NmapFE as per Nmap 4.50. +Also included are python based Nmap auxiliary tools (currently Ndiff). diff --git a/security/zenmap/pkg-plist b/security/zenmap/pkg-plist new file mode 100644 index 000000000..11043fdb6 --- /dev/null +++ b/security/zenmap/pkg-plist @@ -0,0 +1,3 @@ +bin/zenmap-root +man/man1/zenmap.1 +share/pixmaps/zenmap.png