2022-01-25 03:21:06 +00:00
|
|
|
{ lib, stdenv, fetchurl, cmake, swig, wireshark, check, rsync, libpcap, gawk, libedit, pcre, nixosTests }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let version = "0.3.0"; in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "haka";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
name = "haka_${version}_source.tar.gz";
|
|
|
|
url = "https://github.com/haka-security/haka/releases/download/v${version}/haka_${version}_source.tar.gz";
|
|
|
|
sha256 = "0dm39g3k77sa70zrjsqadidg27a6iqq61jzfdxazpllnrw4mjy4w";
|
|
|
|
};
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-Wno-error";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
sed -i 's,/etc,'$out'/etc,' src/haka/haka.c
|
|
|
|
sed -i 's,/etc,'$out'/etc,' src/haka/CMakeLists.txt
|
|
|
|
sed -i 's,/opt/haka/etc,$out/opt/haka/etc,' src/haka/haka.1
|
|
|
|
sed -i 's,/etc,'$out'/etc,' doc/user/tool_suite_haka.rst
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
buildInputs = [ swig wireshark check rsync libpcap gawk libedit pcre ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-25 03:21:06 +00:00
|
|
|
passthru.tests = { inherit (nixosTests) haka; };
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Collection of tools that allows capturing TCP/IP packets and filtering them based on Lua policy files";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://www.haka-security.org/";
|
2021-01-15 22:18:51 +00:00
|
|
|
license = lib.licenses.mpl20;
|
|
|
|
maintainers = [ lib.maintainers.tvestelind ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" ]; # fails on aarch64
|
|
|
|
};
|
|
|
|
}
|