1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 PYTHON_COMPAT=( python2_7 )
8 PYTHON_REQ_USE="sqlite,xml"
9 inherit eutils flag-o-matic python-single-r1 toolchain-funcs
13 DESCRIPTION="A utility for network discovery and security auditing"
14 HOMEPAGE="http://nmap.org/"
16 http://nmap.org/dist/${MY_P}.tar.bz2
17 https://dev.gentoo.org/~jer/nmap-logo-64.png
22 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
24 IUSE="ipv6 +nse system-lua ncat ndiff nls nmap-update nping ssl zenmap"
25 NMAP_LINGUAS=( de fr hr it ja pl pt_BR ru )
26 IUSE+=" ${NMAP_LINGUAS[@]/#/linguas_}"
30 ndiff? ( ${PYTHON_REQUIRED_USE} )
31 zenmap? ( ${PYTHON_REQUIRED_USE} )
37 net-libs/libpcap[ipv6?]
39 dev-python/pygtk:2[${PYTHON_USEDEP}]
42 system-lua? ( >=dev-lang/lua-5.2[deprecated] )
43 ndiff? ( ${PYTHON_DEPS} )
44 nls? ( virtual/libintl )
45 nmap-update? ( dev-libs/apr dev-vcs/subversion )
46 ssl? ( dev-libs/openssl:0= )
50 nls? ( sys-devel/gettext )
53 S="${WORKDIR}/${MY_P}"
56 if use ndiff || use zenmap; then
57 python-single-r1_pkg_setup
62 # prevent unpacking the logo
63 unpack ${MY_P}.tar.bz2
68 "${FILESDIR}"/${PN}-4.75-nolua.patch \
69 "${FILESDIR}"/${PN}-5.10_beta1-string.patch \
70 "${FILESDIR}"/${PN}-5.21-python.patch \
71 "${FILESDIR}"/${PN}-6.01-make.patch \
72 "${FILESDIR}"/${PN}-6.25-liblua-ar.patch \
73 "${FILESDIR}"/${PN}-6.46-uninstaller.patch \
74 "${FILESDIR}"/${PN}-6.47-no-libnl.patch \
75 "${FILESDIR}"/${PN}-6.47-no-FORTIFY_SOURCE.patch \
76 "${FILESDIR}"/${PN}-6.47-ncat-lua.patch
80 for lingua in ${NMAP_LINGUAS[@]}; do
81 if ! use linguas_${lingua}; then
82 rm -r zenmap/share/zenmap/locale/${lingua} || die
83 rm zenmap/share/zenmap/locale/${lingua}.po || die
87 # configure/make ignores --disable-nls
88 for lingua in ${NMAP_LINGUAS[@]}; do
89 rm -r zenmap/share/zenmap/locale/${lingua} || die
90 rm zenmap/share/zenmap/locale/${lingua}.po || die
95 -e '/^ALL_LINGUAS =/{s|$| id|g;s|jp|ja|g}' \
98 # Fix desktop files wrt bug #432714
101 -e 's|^Categories=.*|Categories=Network;System;Security;|g' \
102 zenmap/install_scripts/unix/zenmap-root.desktop \
103 zenmap/install_scripts/unix/zenmap.desktop || die
109 # The bundled libdnet is incompatible with the version available in the
110 # tree, so we cannot use the system library here.
115 $(usex nse --with-liblua=$(usex system-lua /usr included '' '') --without-liblua) \
118 $(use_with nmap-update) \
120 $(use_with ssl openssl) \
121 --with-libdnet=included \
123 # --with-liblinear=/usr \
124 # Commented because configure does weird things, while autodetection works
130 RANLIB=$(tc-getRANLIB )
137 nmapdatadir="${EPREFIX}"/usr/share/nmap \
139 if use nmap-update;then
144 nmapdatadir="${EPREFIX}"/usr/share/nmap \
148 dodoc CHANGELOG HACKING docs/README docs/*.txt
151 doicon "${DISTDIR}/nmap-logo-64.png"