commit:     4b3b89a166b295db16dcbee179bae41eefd8c324
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 27 00:00:44 2020 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Sun Dec 27 00:05:32 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4b3b89a1

net-analyzer/nmap: migrate to lua-single.eclass

The live ebuild, the latest release currently in the tree and the latest
release available under the GPL. In all three cases, upstream build
scripts require version 5.3 of Lua and while they do not use pkgconfig,
they check for versioned files/directories first.

IUSE=system-lua is still there but defaults to enabled now.

Bug: https://bugs.gentoo.org/253269
Closes: https://bugs.gentoo.org/752774
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>

 .../nmap/{nmap-9999.ebuild => nmap-7.80-r2.ebuild} | 54 ++++++++++++++++------
 .../nmap/{nmap-9999.ebuild => nmap-7.91-r1.ebuild} | 23 +++++----
 net-analyzer/nmap/nmap-9999.ebuild                 | 18 ++++++--
 3 files changed, 69 insertions(+), 26 deletions(-)

diff --git a/net-analyzer/nmap/nmap-9999.ebuild 
b/net-analyzer/nmap/nmap-7.80-r2.ebuild
similarity index 62%
copy from net-analyzer/nmap/nmap-9999.ebuild
copy to net-analyzer/nmap/nmap-7.80-r2.ebuild
index 00bb4385aaa..7b40515497d 100644
--- a/net-analyzer/nmap/nmap-9999.ebuild
+++ b/net-analyzer/nmap/nmap-7.80-r2.ebuild
@@ -2,17 +2,21 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
-inherit autotools flag-o-matic git-r3 toolchain-funcs
+
+LUA_COMPAT=( lua5-3 )
+LUA_REQ_USE="deprecated"
+
+inherit autotools desktop flag-o-matic lua-single toolchain-funcs
 
 DESCRIPTION="Network exploration tool and security / port scanner"
 HOMEPAGE="https://nmap.org/";
+SRC_URI="https://nmap.org/dist/${P}.tar.bz2";
 
-EGIT_REPO_URI="https://github.com/nmap/nmap";
-
-LICENSE="NPSL"
+LICENSE="GPL-2"
 SLOT="0"
-IUSE="ipv6 libressl libssh2 ncat nping +nse ssl system-lua"
-REQUIRED_USE="system-lua? ( nse )"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc 
~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="ipv6 libressl libssh2 ncat nmap-update nping +nse ssl +system-lua"
+REQUIRED_USE="system-lua? ( nse ${LUA_REQUIRED_USE} )"
 
 RDEPEND="
        dev-libs/liblinear:=
@@ -22,12 +26,16 @@ RDEPEND="
                net-libs/libssh2[zlib]
                sys-libs/zlib
        )
+       nmap-update? (
+               dev-libs/apr
+               dev-vcs/subversion
+       )
        nse? ( sys-libs/zlib )
        ssl? (
                !libressl? ( dev-libs/openssl:0= )
                libressl? ( dev-libs/libressl:= )
        )
-       system-lua? ( >=dev-lang/lua-5.2:*[deprecated] )
+       system-lua? ( ${LUA_DEPS} )
 "
 DEPEND="${RDEPEND}"
 
@@ -36,14 +44,17 @@ PATCHES=(
        "${FILESDIR}"/${PN}-5.21-python.patch
        "${FILESDIR}"/${PN}-6.46-uninstaller.patch
        "${FILESDIR}"/${PN}-6.25-liblua-ar.patch
+       "${FILESDIR}"/${PN}-7.25-no-FORTIFY_SOURCE.patch
        "${FILESDIR}"/${PN}-7.25-CXXFLAGS.patch
        "${FILESDIR}"/${PN}-7.25-libpcre.patch
        "${FILESDIR}"/${PN}-7.31-libnl.patch
        "${FILESDIR}"/${PN}-7.80-ac-config-subdirs.patch
-       "${FILESDIR}"/${PN}-7.91-no-FORTIFY_SOURCE.patch
-       "${FILESDIR}"/${PN}-9999-netutil-else.patch
 )
 
+pkg_setup() {
+       use system-lua && lua-single_pkg_setup
+}
+
 src_prepare() {
        rm -r liblinear/ libpcap/ libpcre/ libssh2/ libz/ || die
 
@@ -54,6 +65,11 @@ src_prepare() {
        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
 
        cp libdnet-stripped/include/config.h.in{,.nmap-orig} || die
 
@@ -72,22 +88,26 @@ src_configure() {
                $(use_enable ipv6) \
                $(use_with libssh2) \
                $(use_with ncat) \
+               --without-ndiff \
+               $(use_with nmap-update) \
                $(use_with nping) \
                $(use_with ssl openssl) \
+               --without-zenmap \
                $(usex libssh2 --with-zlib) \
-               $(usex nse --with-liblua=$(usex system-lua /usr included '' '') 
--without-liblua) \
                $(usex nse --with-zlib) \
+               $(usex nse --with-liblua=$(usex system-lua yes included '' '') 
--without-liblua) \
                --cache-file="${S}"/config.cache \
                --with-libdnet=included \
-               --with-pcre=/usr \
-               --without-ndiff \
-               --without-zenmap
+               --with-pcre=/usr
+       #       Commented out because configure does weird things
+       #       --with-liblinear=/usr \
 }
 
 src_compile() {
        local directory
        for directory in . libnetutil nsock/src \
                $(usex ncat ncat '') \
+               $(usex nmap-update nmap-update '') \
                $(usex nping nping '')
        do
                emake -C "${directory}" makefile.dep
@@ -104,6 +124,14 @@ src_install() {
                STRIP=: \
                nmapdatadir="${EPREFIX}"/usr/share/nmap \
                install
+       if use nmap-update;then
+               LC_ALL=C emake -j1 \
+                       -C nmap-update \
+                       DESTDIR="${D}" \
+                       STRIP=: \
+                       nmapdatadir="${EPREFIX}"/usr/share/nmap \
+                       install
+       fi
 
        dodoc CHANGELOG HACKING docs/README docs/*.txt
 }

diff --git a/net-analyzer/nmap/nmap-9999.ebuild 
b/net-analyzer/nmap/nmap-7.91-r1.ebuild
similarity index 79%
copy from net-analyzer/nmap/nmap-9999.ebuild
copy to net-analyzer/nmap/nmap-7.91-r1.ebuild
index 00bb4385aaa..3b611d01445 100644
--- a/net-analyzer/nmap/nmap-9999.ebuild
+++ b/net-analyzer/nmap/nmap-7.91-r1.ebuild
@@ -2,17 +2,21 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
-inherit autotools flag-o-matic git-r3 toolchain-funcs
+
+LUA_COMPAT=( lua5-3 )
+LUA_REQ_USE="deprecated"
+
+inherit autotools flag-o-matic lua-single toolchain-funcs
 
 DESCRIPTION="Network exploration tool and security / port scanner"
 HOMEPAGE="https://nmap.org/";
-
-EGIT_REPO_URI="https://github.com/nmap/nmap";
+SRC_URI="https://nmap.org/dist/${P}.tar.bz2";
 
 LICENSE="NPSL"
 SLOT="0"
-IUSE="ipv6 libressl libssh2 ncat nping +nse ssl system-lua"
-REQUIRED_USE="system-lua? ( nse )"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc 
~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="ipv6 libressl libssh2 ncat nping +nse ssl +system-lua"
+REQUIRED_USE="system-lua? ( nse ${LUA_REQUIRED_USE} )"
 
 RDEPEND="
        dev-libs/liblinear:=
@@ -27,7 +31,7 @@ RDEPEND="
                !libressl? ( dev-libs/openssl:0= )
                libressl? ( dev-libs/libressl:= )
        )
-       system-lua? ( >=dev-lang/lua-5.2:*[deprecated] )
+       system-lua? ( ${LUA_DEPS} )
 "
 DEPEND="${RDEPEND}"
 
@@ -41,9 +45,12 @@ PATCHES=(
        "${FILESDIR}"/${PN}-7.31-libnl.patch
        "${FILESDIR}"/${PN}-7.80-ac-config-subdirs.patch
        "${FILESDIR}"/${PN}-7.91-no-FORTIFY_SOURCE.patch
-       "${FILESDIR}"/${PN}-9999-netutil-else.patch
 )
 
+pkg_setup() {
+       use system-lua && lua-single_pkg_setup
+}
+
 src_prepare() {
        rm -r liblinear/ libpcap/ libpcre/ libssh2/ libz/ || die
 
@@ -75,7 +82,7 @@ src_configure() {
                $(use_with nping) \
                $(use_with ssl openssl) \
                $(usex libssh2 --with-zlib) \
-               $(usex nse --with-liblua=$(usex system-lua /usr included '' '') 
--without-liblua) \
+               $(usex nse --with-liblua=$(usex system-lua yes included '' '') 
--without-liblua) \
                $(usex nse --with-zlib) \
                --cache-file="${S}"/config.cache \
                --with-libdnet=included \

diff --git a/net-analyzer/nmap/nmap-9999.ebuild 
b/net-analyzer/nmap/nmap-9999.ebuild
index 00bb4385aaa..782f91bf13e 100644
--- a/net-analyzer/nmap/nmap-9999.ebuild
+++ b/net-analyzer/nmap/nmap-9999.ebuild
@@ -2,7 +2,11 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
-inherit autotools flag-o-matic git-r3 toolchain-funcs
+
+LUA_COMPAT=( lua5-3 )
+LUA_REQ_USE="deprecated"
+
+inherit autotools flag-o-matic git-r3 lua-single toolchain-funcs
 
 DESCRIPTION="Network exploration tool and security / port scanner"
 HOMEPAGE="https://nmap.org/";
@@ -11,8 +15,8 @@ EGIT_REPO_URI="https://github.com/nmap/nmap";
 
 LICENSE="NPSL"
 SLOT="0"
-IUSE="ipv6 libressl libssh2 ncat nping +nse ssl system-lua"
-REQUIRED_USE="system-lua? ( nse )"
+IUSE="ipv6 libressl libssh2 ncat nping +nse ssl +system-lua"
+REQUIRED_USE="system-lua? ( nse ${LUA_REQUIRED_USE} )"
 
 RDEPEND="
        dev-libs/liblinear:=
@@ -27,7 +31,7 @@ RDEPEND="
                !libressl? ( dev-libs/openssl:0= )
                libressl? ( dev-libs/libressl:= )
        )
-       system-lua? ( >=dev-lang/lua-5.2:*[deprecated] )
+       system-lua? ( ${LUA_DEPS} )
 "
 DEPEND="${RDEPEND}"
 
@@ -44,6 +48,10 @@ PATCHES=(
        "${FILESDIR}"/${PN}-9999-netutil-else.patch
 )
 
+pkg_setup() {
+       use system-lua && lua-single_pkg_setup
+}
+
 src_prepare() {
        rm -r liblinear/ libpcap/ libpcre/ libssh2/ libz/ || die
 
@@ -75,7 +83,7 @@ src_configure() {
                $(use_with nping) \
                $(use_with ssl openssl) \
                $(usex libssh2 --with-zlib) \
-               $(usex nse --with-liblua=$(usex system-lua /usr included '' '') 
--without-liblua) \
+               $(usex nse --with-liblua=$(usex system-lua yes included '' '') 
--without-liblua) \
                $(usex nse --with-zlib) \
                --cache-file="${S}"/config.cache \
                --with-libdnet=included \

Reply via email to