2021-02-13 14:17:33 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2019-06-17 21:41:53 +01:00
|
|
|
, fetchFromGitHub
|
2021-01-17 03:51:22 +00:00
|
|
|
, pkg-config
|
2019-06-17 21:41:53 +01:00
|
|
|
, autoreconfHook
|
|
|
|
, libtool
|
|
|
|
, libpcap
|
2021-02-13 14:17:33 +00:00
|
|
|
, libcdada
|
2019-06-17 21:41:53 +01:00
|
|
|
# Optional Dependencies
|
2021-02-13 14:17:33 +00:00
|
|
|
, withJansson ? true, jansson
|
|
|
|
, withNflog ? true, libnetfilter_log
|
|
|
|
, withSQLite ? true, sqlite
|
|
|
|
, withPgSQL ? true, postgresql
|
2022-03-04 21:37:21 +00:00
|
|
|
, withMysql ? true, libmysqlclient, zlib, numactl
|
2021-02-13 14:17:33 +00:00
|
|
|
, gnutlsSupport ? false, gnutls
|
2022-04-20 15:40:48 +01:00
|
|
|
, testers
|
2022-03-04 21:37:21 +00:00
|
|
|
, pmacct
|
2021-02-13 14:17:33 +00:00
|
|
|
}:
|
2019-06-17 21:41:53 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2022-03-04 21:37:21 +00:00
|
|
|
version = "1.7.7";
|
2019-06-17 21:41:53 +01:00
|
|
|
pname = "pmacct";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pmacct";
|
2021-02-13 14:17:33 +00:00
|
|
|
repo = "pmacct";
|
2019-06-17 21:41:53 +01:00
|
|
|
rev = "v${version}";
|
2022-03-04 21:37:21 +00:00
|
|
|
sha256 = "1pjaa44qj3y5dfwsd1a9r7a4riy7afza8phx2npcsyyarssxc63w";
|
2019-06-17 21:41:53 +01:00
|
|
|
};
|
|
|
|
|
2021-02-13 14:17:33 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
|
|
|
pkg-config
|
|
|
|
libtool
|
|
|
|
];
|
|
|
|
buildInputs = [
|
|
|
|
libcdada
|
|
|
|
libpcap
|
|
|
|
] ++ lib.optional withJansson jansson
|
|
|
|
++ lib.optional withNflog libnetfilter_log
|
|
|
|
++ lib.optional withSQLite sqlite
|
|
|
|
++ lib.optional withPgSQL postgresql
|
2022-03-04 21:37:21 +00:00
|
|
|
++ lib.optionals withMysql [ libmysqlclient zlib numactl ]
|
2021-02-13 14:17:33 +00:00
|
|
|
++ lib.optional gnutlsSupport gnutls;
|
2019-06-17 21:41:53 +01:00
|
|
|
|
2021-02-13 14:17:33 +00:00
|
|
|
MYSQL_CONFIG = lib.optionalString withMysql "${lib.getDev libmysqlclient}/bin/mysql_config";
|
2020-09-12 12:09:52 +01:00
|
|
|
|
2019-06-17 21:41:53 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--with-pcap-includes=${libpcap}/include"
|
2021-02-13 14:17:33 +00:00
|
|
|
] ++ lib.optional withJansson "--enable-jansson"
|
|
|
|
++ lib.optional withNflog "--enable-nflog"
|
|
|
|
++ lib.optional withSQLite "--enable-sqlite3"
|
|
|
|
++ lib.optional withPgSQL "--enable-pgsql"
|
|
|
|
++ lib.optional withMysql "--enable-mysql"
|
|
|
|
++ lib.optional gnutlsSupport "--enable-gnutls";
|
2019-06-17 21:41:53 +01:00
|
|
|
|
2022-03-04 21:37:21 +00:00
|
|
|
passthru.tests = {
|
2022-04-20 15:40:48 +01:00
|
|
|
version = testers.testVersion { package = pmacct; command = "pmacct -V"; };
|
2022-03-04 21:37:21 +00:00
|
|
|
};
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-10-26 04:08:40 +00:00
|
|
|
description = "A small set of multi-purpose passive network monitoring tools";
|
2019-06-17 21:41:53 +01:00
|
|
|
longDescription = ''
|
|
|
|
pmacct is a small set of multi-purpose passive network monitoring tools
|
|
|
|
[NetFlow IPFIX sFlow libpcap BGP BMP RPKI IGP Streaming Telemetry]
|
|
|
|
'';
|
|
|
|
homepage = "http://www.pmacct.net/";
|
2022-03-04 21:37:21 +00:00
|
|
|
changelog = "https://github.com/pmacct/pmacct/blob/v${version}/ChangeLog";
|
2019-06-17 21:41:53 +01:00
|
|
|
license = licenses.gpl2;
|
2020-07-29 11:49:07 +01:00
|
|
|
maintainers = with maintainers; [ _0x4A6F ];
|
2019-06-17 21:41:53 +01:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|