iftop: add package

This commit is contained in:
Lukas Rusak 2016-04-25 10:29:24 -07:00
parent 13c45a6042
commit f9eb76226d
2 changed files with 118 additions and 0 deletions

View File

@ -0,0 +1,45 @@
################################################################################
# This file is part of LibreELEC - http://www.libreelec.tv
# Copyright (C) 2016 Team LibreELEC
#
# LibreELEC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# LibreELEC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
################################################################################
PKG_NAME="iftop"
PKG_VERSION="1.0pre4"
PKG_REV="0"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="http://htop.sourceforge.net/"
PKG_URL="http://www.ex-parrot.com/pdw/iftop/download/$PKG_NAME-$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain netbsd-curses libpcap libnl"
PKG_PRIORITY="optional"
PKG_SECTION="network/analyzer"
PKG_SHORTDESC="iftop: display bandwidth usage on an interface"
PKG_LONGDESC="iftop does for network usage what top(1) does for CPU usage. It listens to network traffic on a named interface and displays a table of current bandwidth usage by pairs of hosts. Handy for answering the question 'why is our ADSL link so slow?'."
PKG_AUTORECONF="yes"
pre_build_target() {
mkdir -p $PKG_BUILD/.$TARGET_NAME
cp -RP $PKG_BUILD/* $PKG_BUILD/.$TARGET_NAME
}
pre_configure_target() {
export CFLAGS="$CFLAGS -I$SYSROOT_PREFIX/usr/include/pcap"
export LIBS="-lpcap -lnl-3 -lnl-genl-3 -lncurses -ltermcap"
}
makeinstall_target() {
: # nop
}

View File

@ -0,0 +1,73 @@
diff --git a/configure.ac b/configure.ac
index 671241e..b6fece6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -294,42 +294,6 @@ if test x$libpcap_prefix = x ; then
libpcap_prefix="/usr /usr/local /opt /software"
fi
-AC_MSG_CHECKING([where to find pcap.h])
-foundpcaph=0
-oldCPPFLAGS=$CPPFLAGS
-for test_prefix in "" $libpcap_prefix ; do
- for x in "" /pcap ; do
- if test x$test_prefix != x ; then
- CPPFLAGS="$oldCPPFLAGS -I$test_prefix/include$x"
- fi
- AC_TRY_CPP([
-#include <pcap.h>
- ], [
- AC_MSG_RESULT([$test_prefix/include$x])
- foundpcaph=1
- break
- ])
- done
- if test $foundpcaph = 1 ; then
- break
- fi
-done
-
-if test $foundpcaph = 0 ; then
- AC_MSG_RESULT([no idea])
- AC_MSG_ERROR([can't find pcap.h
- You're not going to get very far without libpcap.])
-else
- dnl assume that -lpcap is under $test_prefix/lib
- if test x$test_prefix != x ; then
- LDFLAGS="$LDFLAGS -L$test_prefix/lib"
- fi
- AC_CHECK_LIB(pcap, pcap_open_live, , [
- AC_MSG_ERROR([can't find libpcap
- You're not going to get very far without libpcap.])
- ])
-fi
-
foundpcap=0
AC_CHECK_HEADERS([pcap.h pcap/pcap.h], [
foundpcap=1
diff --git a/edline.c b/edline.c
index 75f1a5a..aed80cf 100644
--- a/edline.c
+++ b/edline.c
@@ -7,7 +7,7 @@
static const char rcsid[] = "$Id: edline.c,v 1.2 2002/11/04 12:27:35 chris Exp $";
#include <ctype.h>
-#include <curses.h>
+#include <ncurses.h>
#include <string.h>
#include "iftop.h"
diff --git a/iftop.c b/iftop.c
index a090dcf..5851c86 100644
--- a/iftop.c
+++ b/iftop.c
@@ -23,7 +23,7 @@
#endif
#include <pthread.h>
-#include <curses.h>
+#include <ncurses.h>
#include <signal.h>
#include <string.h>
#include <unistd.h>