netatop-2.0.ebuild 1.06 KB
Newer Older
1 2 3 4 5 6
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="6"

7 8
inherit eutils linux-mod user

9 10 11 12 13 14 15
DESCRIPTION="Optional kernel module for sys-process/atop to gather statistics about TCP/UDP packets transmitted/received per process and per thread"
HOMEPAGE="http://www.atoptool.nl/netatop.php"
SRC_URI="http://www.atoptool.nl/download/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
16
IUSE="pax_kernel"
17
PATCHES="${FILESDIR}/netatop-karch.patch"
18 19 20

CHOST_amd64=x86_64-unknown-linux-gnu
CHOST_x86=i686-unknown-linux-gnu
21

22 23 24 25 26 27 28 29 30 31

BUILD_TARGETS="all"
BUILD_TARGET_ARCH="${ARCH}"
MODULE_NAMES="netatop(misc:${S}:${S}/module)"

pkg_setup() {
	linux-mod_pkg_setup
	BUILD_PARAMS="CC=$(tc-getBUILD_CC) KERN_DIR=${KV_DIR} O=${KV_OUT_DIR} V=1 KBUILD_VERBOSE=1"
}

32 33 34 35 36 37 38
src_prepare() {
	sed -i 's/extra/misc/' Makefile || die "sed expression failed"
	default_src_prepare
	eapply_user
}

src_install() {
39 40 41 42 43 44 45
	linux-mod_src_install
	insinto /usr/lib/modules-load.d/
	doins "${FILESDIR}"/netatop.conf
}

pkg_postinst() {
	linux-mod_pkg_postinst
46
}