2021-04-05 15:23:46 +00:00
|
|
|
{ lib, stdenv, fetchurl, makeWrapper, binutils-unwrapped }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-04-05 15:23:46 +00:00
|
|
|
pname = "chkrootkit";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "0.58b";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-11-16 04:20:00 +00:00
|
|
|
url = "ftp://ftp.chkrootkit.org/pub/seg/pac/${pname}-${version}.tar.gz";
|
2024-01-02 11:29:13 +00:00
|
|
|
sha256 = "sha256-de0qzoHw+j6cP7ZNqw6IV+1ZJH6nVfWJhBb+ssZoB7k=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# TODO: a lazy work-around for linux build failure ...
|
|
|
|
makeFlags = [ "STATIC=" ];
|
|
|
|
|
2021-04-05 15:23:46 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
postPatch = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
substituteInPlace chkrootkit \
|
|
|
|
--replace " ./" " $out/bin/"
|
2021-04-05 15:23:46 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/sbin
|
|
|
|
cp check_wtmpx chkdirs chklastlog chkproc chkrootkit chkutmp chkwtmp ifpromisc strings-static $out/sbin
|
2021-04-05 15:23:46 +00:00
|
|
|
|
|
|
|
wrapProgram $out/sbin/chkrootkit \
|
|
|
|
--prefix PATH : "${lib.makeBinPath [ binutils-unwrapped ]}"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Locally checks for signs of a rootkit";
|
2023-11-16 04:20:00 +00:00
|
|
|
homepage = "https://www.chkrootkit.org/";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.bsd2;
|
|
|
|
platforms = with platforms; linux;
|
|
|
|
};
|
|
|
|
}
|