net-analyzer/yersinia: Add live ebuild
authorJeroen Roovers <jer@gentoo.org>
Tue, 28 Jan 2020 15:37:51 +0000 (16:37 +0100)
committerJeroen Roovers <jer@gentoo.org>
Tue, 28 Jan 2020 15:38:25 +0000 (16:38 +0100)
Package-Manager: Portage-2.3.85, Repoman-2.3.20
Signed-off-by: Jeroen Roovers <jer@gentoo.org>
net-analyzer/yersinia/files/yersinia-9999-tinfo.patch [new file with mode: 0644]
net-analyzer/yersinia/yersinia-9999.ebuild [new file with mode: 0644]

diff --git a/net-analyzer/yersinia/files/yersinia-9999-tinfo.patch b/net-analyzer/yersinia/files/yersinia-9999-tinfo.patch
new file mode 100644 (file)
index 0000000..b5bf566
--- /dev/null
@@ -0,0 +1,27 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -467,6 +467,7 @@
+      AC_DEFINE(HAVE_REMOTE_ADMIN)
+ fi
++PKG_CHECK_MODULES(ncurses,ncurses)
+ dnl Curses detection: Munged from Midnight Commander's configure.in
+ dnl
+@@ -616,6 +617,16 @@
+               AC_DEFINE(USE_NCURSES)
+               AC_DEFINE(HAS_CURSES)
+               has_curses=true
++        else
++              if test "$ncurses_LIBS" ; then
++                      CURSES_LIBS="$ncurses_LIBS"
++                      CURSES_INCLUDEDIR="$ncurses_CFLAGS"
++                      search_ncurses=false
++                      screen_manager="ncurses"
++                      AC_DEFINE(USE_NCURSES)
++                      AC_DEFINE(HAS_CURSES)
++                      has_curses=true
++              fi
+         fi
+       )
diff --git a/net-analyzer/yersinia/yersinia-9999.ebuild b/net-analyzer/yersinia/yersinia-9999.ebuild
new file mode 100644 (file)
index 0000000..f2825d6
--- /dev/null
@@ -0,0 +1,59 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit autotools flag-o-matic git-r3
+
+DESCRIPTION="A framework for layer 2 attacks"
+HOMEPAGE="https://github.com/tomac/yersinia"
+EGIT_REPO_URI="https://github.com/tomac/yersinia"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE="gtk ncurses"
+
+RDEPEND="
+       ncurses? ( >=sys-libs/ncurses-5.5:= )
+       gtk? (
+               dev-libs/glib:2
+               x11-libs/gdk-pixbuf
+               =x11-libs/gtk+-2*
+       )
+       >=net-libs/libnet-1.1.2
+       >=net-libs/libpcap-0.9.4
+"
+DEPEND="
+       virtual/pkgconfig
+       ${RDEPEND}
+"
+DOCS=( AUTHORS ChangeLog FAQ README THANKS TODO )
+PATCHES=(
+       "${FILESDIR}"/${PN}-0.7.1-no-ncurses.patch
+       "${FILESDIR}"/${PN}-9999-tinfo.patch
+)
+
+src_prepare() {
+       default
+
+       if ! use gtk; then
+               #bug #514802
+               sed -i -e '/AM_GLIB_GNU_GETTEXT/d' configure.in || die
+       fi
+
+       eautoreconf
+}
+
+src_configure() {
+       append-cflags -fcommon
+
+       econf \
+               --enable-admin \
+               --with-pcap-includes=/usr/include \
+               $(use_with ncurses) \
+               $(use_enable gtk)
+}
+
+src_compile() {
+       emake CFLAGS="${CFLAGS}"
+}