blob: 923439fd27522a3939d9f43fe45a5688fa79c3e2 [file] [log] [blame]
#
# Copyright 2023 Google LLC
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation.
#
# This program 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.
#
EAPI=7
inherit flag-o-matic toolchain-funcs
DESCRIPTION="A console-based network monitoring utility"
HOMEPAGE="https://github.com/iptraf-ng/iptraf-ng"
SRC_URI="https://github.com/iptraf-ng/iptraf-ng/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="* ~alpha amd64 arm ~arm64 ~hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86"
RDEPEND="
>=sys-libs/ncurses-6.1:0=
"
DEPEND="
${RDEPEND}
virtual/os-headers
!net-analyzer/iptraf
"
RESTRICT="test"
src_prepare() {
# shellcheck disable=SC2016
sed -i \
-e '/^CC =/d' \
-e '/^CFLAGS/s:= -g -O2:+= :' \
-e '/^LDFLAGS =/d' \
-e 's|$(QUIET_[[:alpha:]]*)||g' \
Makefile || die
default
}
src_configure() {
# The configure script does not do very much we do not already control
append-cppflags '-DLOCKDIR=\"/run/lock/iptraf-ng\"'
tc-export CC
}
src_compile() {
emake \
CC="$(tc-getCC)" \
NCURSES_CFLAGS="$("${SYSROOT}"/usr/bin/ncurses6-config --cflags)" \
NCURSES_LDFLAGS="$("${SYSROOT}"/usr/bin/ncurses6-config --libs-only-l)" \
LDFLAGS="-L${ESYSROOT}/usr/$(get_libdir) -lpanel"
}
src_install() {
dosbin ${PN}
}