netatop: package netatop.service

This commit is contained in:
Paul Schyska 2021-05-14 02:07:17 +02:00
parent 5bf5cb1b1b
commit 2703a7999a
No known key found for this signature in database
GPG Key ID: D49D4F8259DB724F

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, kernel, zlib }:
{ lib, stdenv, fetchurl, kernel, kmod, zlib }:
let
version = "3.1";
@ -12,10 +12,11 @@ stdenv.mkDerivation {
sha256 = "0qjw8glfdmngfvbn1w63q128vxdz2jlabw13y140ga9i5ibl6vvk";
};
buildInputs = [ zlib ];
buildInputs = [ kmod zlib ];
hardeningDisable = [ "pic" ];
patches = [ ./netatop.service.patch ];
preConfigure = ''
patchShebangs mkversion
sed -i -e 's,^KERNDIR.*,KERNDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build,' \
@ -24,12 +25,14 @@ stdenv.mkDerivation {
-e s,/usr,$out, \
-e /init.d/d \
-e /depmod/d \
-e /netatop.service/d \
-e s,/lib/systemd,$out/lib/systemd, \
Makefile
kmod=${kmod} substituteAllInPlace netatop.service
'';
preInstall = ''
mkdir -p $out/bin $out/sbin $out/share/man/man{4,8}
mkdir -p $out/lib/systemd/system $out/bin $out/sbin $out/share/man/man{4,8}
mkdir -p $out/lib/modules/${kernel.modDirVersion}/extra
'';
@ -38,6 +41,6 @@ stdenv.mkDerivation {
homepage = "https://www.atoptool.nl/downloadnetatop.php";
license = lib.licenses.gpl2;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [viric];
maintainers = with lib.maintainers; [ viric ];
};
}