diff --git a/packages/addons/addon-depends/network-tools-depends/iftop/package.mk b/packages/addons/addon-depends/network-tools-depends/iftop/package.mk new file mode 100644 index 0000000000..c41d16037d --- /dev/null +++ b/packages/addons/addon-depends/network-tools-depends/iftop/package.mk @@ -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 . +################################################################################ + +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 +} diff --git a/packages/addons/addon-depends/network-tools-depends/iftop/patches/iftop-boo.patch b/packages/addons/addon-depends/network-tools-depends/iftop/patches/iftop-boo.patch new file mode 100644 index 0000000000..e3622aef54 --- /dev/null +++ b/packages/addons/addon-depends/network-tools-depends/iftop/patches/iftop-boo.patch @@ -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 +- ], [ +- 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 +-#include ++#include + #include + + #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 +-#include ++#include + #include + #include + #include