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 +lua system-lua ncat ndiff nls nmap-update nping ssl zenmap"
25 NMAP_LINGUAS=( de es fr hr hu id it ja pl pt_BR pt_PT ro ru sk zh )
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
79 for lingua in ${NMAP_LINGUAS}; do
80 if ! use linguas_${lingua}; then
81 rm -rf zenmap/share/zenmap/locale/${lingua}
82 rm -f zenmap/share/zenmap/locale/${lingua}.po
86 # configure/make ignores --disable-nls
87 for lingua in ${NMAP_LINGUAS}; do
88 rm -rf zenmap/share/zenmap/locale/${lingua}
89 rm -f zenmap/share/zenmap/locale/${lingua}.po
94 -e '/^ALL_LINGUAS =/{s|$| id|g;s|jp|ja|g}' \
97 # Fix desktop files wrt bug #432714
100 -e 's|^Categories=.*|Categories=Network;System;Security;|g' \
101 zenmap/install_scripts/unix/zenmap-root.desktop \
102 zenmap/install_scripts/unix/zenmap.desktop || die
108 # The bundled libdnet is incompatible with the version available in the
109 # tree, so we cannot use the system library here.
114 $(usex lua --with-liblua=$(usex system-lua /usr included '' '') --without-liblua) \
117 $(use_with nmap-update) \
119 $(use_with ssl openssl) \
120 --with-libdnet=included \
122 # --with-liblinear=/usr \
123 # Commented because configure does weird things, while autodetection works
129 RANLIB=$(tc-getRANLIB )
136 nmapdatadir="${EPREFIX}"/usr/share/nmap \
138 if use nmap-update;then
143 nmapdatadir="${EPREFIX}"/usr/share/nmap \
147 dodoc CHANGELOG HACKING docs/README docs/*.txt
150 doicon "${DISTDIR}/nmap-logo-64.png"