From 2676c648eaa25553d4c89ec4042ce0813d350eb1 Mon Sep 17 00:00:00 2001 From: Yureka Date: Mon, 20 Mar 2023 18:22:53 +0100 Subject: [PATCH] fastnetmon-advanced: init at 2.0.335 (#218609) --- pkgs/servers/fastnetmon-advanced/default.nix | 55 ++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 57 insertions(+) create mode 100644 pkgs/servers/fastnetmon-advanced/default.nix diff --git a/pkgs/servers/fastnetmon-advanced/default.nix b/pkgs/servers/fastnetmon-advanced/default.nix new file mode 100644 index 000000000000..34e85914e77a --- /dev/null +++ b/pkgs/servers/fastnetmon-advanced/default.nix @@ -0,0 +1,55 @@ +{ lib, stdenv, fetchurl, autoPatchelfHook, bzip2 }: + +stdenv.mkDerivation rec { + pname = "fastnetmon-advanced"; + version = "2.0.335"; + + src = fetchurl { + url = "https://repo.fastnetmon.com/fastnetmon_ubuntu_jammy/pool/fastnetmon/f/fastnetmon/fastnetmon_${version}_amd64.deb"; + hash = "sha256-2WdCQX0AiLTPGM9flVSXgKMrTGCwSXk9IfyS5SRKroY="; + }; + + nativeBuildInputs = [ + autoPatchelfHook + ]; + + buildInputs = [ + bzip2 + ]; + + unpackPhase = '' + ar xf $src + tar xf data.tar.xz + + # "These binaries are not part of FastNetMon and we shipped them by accident. They will be removed in next stable build" + rm opt/fastnetmon/app/bin/{generate_rsa_keys,license_app,fastnetmon_license_server} + + # ships with both 2_0_0 and 2_3_0 but the shared objects are not versioned and only 2_3_0 has the necessary symbols + rm -rf opt/fastnetmon/libraries/libclickhouse_2_0_0/ + + # unused libraries, which have additional dependencies + rm opt/fastnetmon/libraries/gcc1210/lib/libgccjit.so.0.0.1 + rm opt/fastnetmon/libraries/poco_1_10_0/lib/libPocoCryptod.so.70 + rm opt/fastnetmon/libraries/poco_1_10_0/lib/libPocoCrypto.so.70 + rm opt/fastnetmon/libraries/poco_1_10_0/lib/libPocoJWTd.so.70 + rm opt/fastnetmon/libraries/poco_1_10_0/lib/libPocoJWT.so.70 + rm opt/fastnetmon/libraries/wkhtmltopdf-0.12.3/wkhtmltox/lib/libwkhtmltox.so.0.12.3 + ''; + + installPhase = '' + mkdir -p $out/libexec/fastnetmon + cp -r opt/fastnetmon/app/bin $out/bin + cp -r opt/fastnetmon/libraries $out/libexec/fastnetmon + + addAutoPatchelfSearchPath $out/libexec/fastnetmon/libraries + ''; + + meta = with lib; { + description = "A high performance DDoS detector / sensor - commercial edition"; + homepage = "https://fastnetmon.com"; + sourceProvenance = with sourceTypes; [ binaryNativeCode ]; + maintainers = with maintainers; [ yuka ]; + license = licenses.unfree; + platforms = [ "x86_64-linux" ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index db2f3cb8a31a..bdc20e62f5c8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -24775,6 +24775,8 @@ with pkgs; exim = callPackage ../servers/mail/exim { }; + fastnetmon-advanced = callPackage ../servers/fastnetmon-advanced { }; + fcgiwrap = callPackage ../servers/fcgiwrap { }; fedigroups = callPackage ../servers/fedigroups {