nixpkgs-suyu/pkgs/os-specific/linux/netatop/default.nix

44 lines
1.2 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, kernel, zlib }:
2013-05-20 10:00:03 +02:00
2016-01-07 10:06:40 +01:00
let
2016-06-21 14:44:51 +02:00
version = "1.0";
2016-01-07 10:06:40 +01:00
in
2013-05-20 10:00:03 +02:00
stdenv.mkDerivation {
2016-01-07 10:06:40 +01:00
name = "netatop-${kernel.version}-${version}";
2013-05-20 10:00:03 +02:00
src = fetchurl {
2016-01-07 10:06:40 +01:00
url = "http://www.atoptool.nl/download/netatop-${version}.tar.gz";
2016-06-21 14:44:51 +02:00
sha256 = "1l7xs3hnfbk6h5gdrw1ikfa0fvfpb5vd447xhwfllvicblqyip8b";
2013-05-20 10:00:03 +02:00
};
buildInputs = [ zlib ];
hardeningDisable = [ "pic" ];
2013-05-20 10:00:03 +02:00
preConfigure = ''
patchShebangs mkversion
sed -i -e 's,^KERNDIR.*,KERNDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build,' \
2013-05-20 10:00:03 +02:00
*/Makefile
sed -i -e 's,/lib/modules.*extra,'$out'/lib/modules/${kernel.modDirVersion}/extra,' \
2013-05-20 10:00:03 +02:00
-e s,/usr,$out, \
-e /init.d/d \
-e /depmod/d \
Makefile
'';
preInstall = ''
mkdir -p $out/bin $out/sbin $out/share/man/man{4,8}
mkdir -p $out/lib/modules/${kernel.modDirVersion}/extra
2013-05-20 10:00:03 +02:00
'';
2016-01-07 10:06:40 +01:00
2013-05-20 10:00:03 +02:00
meta = {
description = "Network monitoring module for atop";
homepage = http://www.atoptool.nl/downloadnetatop.php;
license = stdenv.lib.licenses.gpl2;
2013-05-20 10:00:03 +02:00
platforms = stdenv.lib.platforms.linux;
maintainers = with stdenv.lib.maintainers; [viric];
broken = !stdenv.lib.versionOlder kernel.version "4.13";
2013-05-20 10:00:03 +02:00
};
}