--- nmap-7.80-r1.ebuild 2020-01-17 12:45:22.184898432 +0800 +++ /usr/portage/net-analyzer/nmap/nmap-7.80.ebuild 2019-10-12 00:11:19.000000000 +0800 @@ -1,11 +1,9 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2019 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 - -PYTHON_COMPAT=( python3_{6,7} ) +PYTHON_COMPAT=( python2_7 ) PYTHON_REQ_USE="sqlite,xml" - inherit autotools desktop flag-o-matic python-single-r1 toolchain-funcs user MY_P=${P/_beta/BETA} @@ -21,15 +19,16 @@ LICENSE="GPL-2" SLOT="0" -IUSE="ipv6 libressl libssh2 ncat ndiff nls nmap-update nping +nse ssl system-lua" -# zenmap - -#NMAP_LINGUAS=( de fr hi hr it ja pl pt_BR ru zh ) +IUSE=" + ipv6 libressl libssh2 ncat ndiff nls nmap-update nping +nse ssl system-lua + zenmap +" +NMAP_LINGUAS=( de fr hi hr it ja pl pt_BR ru zh ) REQUIRED_USE=" system-lua? ( nse ) - ndiff? ( ${PYTHON_REQUIRED_USE} )" -# zenmap? ( ${PYTHON_REQUIRED_USE} ) - + ndiff? ( ${PYTHON_REQUIRED_USE} ) + zenmap? ( ${PYTHON_REQUIRED_USE} ) +" RDEPEND=" dev-libs/liblinear:= dev-libs/libpcre @@ -50,12 +49,11 @@ libressl? ( dev-libs/libressl:= ) ) system-lua? ( >=dev-lang/lua-5.2:*[deprecated] ) + zenmap? ( + dev-python/pygtk:2[${PYTHON_USEDEP}] + ${PYTHON_DEPS} + ) " -# zenmap? ( -# dev-python/pygtk:2[${PYTHON_USEDEP}] -# ${PYTHON_DEPS} -# ) - DEPEND=" ${RDEPEND} nls? ( sys-devel/gettext ) @@ -70,13 +68,11 @@ "${FILESDIR}"/${PN}-7.25-libpcre.patch "${FILESDIR}"/${PN}-7.31-libnl.patch "${FILESDIR}"/${PN}-7.80-ac-config-subdirs.patch - "${FILESDIR}"/${PN}-7.80-python3-port-of-ndiff.patch - "${FILESDIR}"/${PN}-7.80-python3-configure.patch ) S="${WORKDIR}/${MY_P}" pkg_setup() { - if use ndiff; then + if use ndiff || use zenmap; then python-single-r1_pkg_setup fi } @@ -88,30 +84,30 @@ default -# local lingua -# if use nls; then -# for lingua in ${NMAP_LINGUAS[@]}; do -# if ! has ${lingua} ${LINGUAS-${lingua}}; then -# rm -r zenmap/share/zenmap/locale/${lingua} || die -# rm zenmap/share/zenmap/locale/${lingua}.po || die -# fi -# done -# else -# # configure/make ignores --disable-nls -# for lingua in ${NMAP_LINGUAS[@]}; do -# rm -r zenmap/share/zenmap/locale/${lingua} || die -# rm zenmap/share/zenmap/locale/${lingua}.po || die -# done -# fi + local lingua + if use nls; then + for lingua in ${NMAP_LINGUAS[@]}; do + if ! has ${lingua} ${LINGUAS-${lingua}}; then + rm -r zenmap/share/zenmap/locale/${lingua} || die + rm zenmap/share/zenmap/locale/${lingua}.po || die + fi + done + else + # configure/make ignores --disable-nls + for lingua in ${NMAP_LINGUAS[@]}; do + rm -r zenmap/share/zenmap/locale/${lingua} || die + rm zenmap/share/zenmap/locale/${lingua}.po || die + done + fi sed -i \ -e '/^ALL_LINGUAS =/{s|$| id|g;s|jp|ja|g}' \ Makefile.in || die # Fix desktop files wrt bug #432714 -# sed -i \ -# -e 's|^Categories=.*|Categories=Network;System;Security;|g' \ -# zenmap/install_scripts/unix/zenmap-root.desktop \ -# zenmap/install_scripts/unix/zenmap.desktop || die + sed -i \ + -e 's|^Categories=.*|Categories=Network;System;Security;|g' \ + zenmap/install_scripts/unix/zenmap-root.desktop \ + zenmap/install_scripts/unix/zenmap.desktop || die cp libdnet-stripped/include/config.h.in{,.nmap-orig} || die @@ -135,6 +131,7 @@ $(use_with nmap-update) \ $(use_with nping) \ $(use_with ssl openssl) \ + $(use_with zenmap) \ $(usex libssh2 --with-zlib) \ $(usex nse --with-zlib) \ $(usex nse --with-liblua=$(usex system-lua /usr included '' '') --without-liblua) \ @@ -143,8 +140,6 @@ --with-pcre=/usr # Commented out because configure does weird things # --with-liblinear=/usr \ - # $(use_with zenmap) \ - } src_compile() { @@ -179,8 +174,8 @@ dodoc CHANGELOG HACKING docs/README docs/*.txt -# if use zenmap; then -# doicon "${DISTDIR}/nmap-logo-64.png" -# python_optimize -# fi + if use zenmap; then + doicon "${DISTDIR}/nmap-logo-64.png" + python_optimize + fi }