2021-10-08 15:17:17 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
, autoreconfHook
|
|
|
|
, libtool
|
|
|
|
, libpcap
|
2021-10-08 15:17:17 +00:00
|
|
|
, libcdada
|
2020-04-24 23:36:52 +00:00
|
|
|
# Optional Dependencies
|
2021-10-08 15:17:17 +00:00
|
|
|
, withJansson ? true, jansson
|
|
|
|
, withNflog ? true, libnetfilter_log
|
|
|
|
, withSQLite ? true, sqlite
|
|
|
|
, withPgSQL ? true, postgresql
|
2022-04-15 01:41:22 +00:00
|
|
|
, withMysql ? true, libmysqlclient, zlib, numactl
|
2021-10-08 15:17:17 +00:00
|
|
|
, gnutlsSupport ? false, gnutls
|
2022-04-15 01:41:22 +00:00
|
|
|
, testVersion
|
|
|
|
, pmacct
|
2021-10-08 15:17:17 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2022-04-15 01:41:22 +00:00
|
|
|
version = "1.7.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "pmacct";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pmacct";
|
2021-10-08 15:17:17 +00:00
|
|
|
repo = "pmacct";
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = "v${version}";
|
2022-04-15 01:41:22 +00:00
|
|
|
sha256 = "1pjaa44qj3y5dfwsd1a9r7a4riy7afza8phx2npcsyyarssxc63w";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-10-08 15:17:17 +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-04-15 01:41:22 +00:00
|
|
|
++ lib.optionals withMysql [ libmysqlclient zlib numactl ]
|
2021-10-08 15:17:17 +00:00
|
|
|
++ lib.optional gnutlsSupport gnutls;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-10-08 15:17:17 +00:00
|
|
|
MYSQL_CONFIG = lib.optionalString withMysql "${lib.getDev libmysqlclient}/bin/mysql_config";
|
2020-10-16 20:44:37 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--with-pcap-includes=${libpcap}/include"
|
2021-10-08 15:17:17 +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";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
passthru.tests = {
|
|
|
|
version = testVersion { package = pmacct; command = "pmacct -V"; };
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-11-03 02:18:15 +00:00
|
|
|
description = "A small set of multi-purpose passive network monitoring tools";
|
2020-04-24 23:36:52 +00: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-04-15 01:41:22 +00:00
|
|
|
changelog = "https://github.com/pmacct/pmacct/blob/v${version}/ChangeLog";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.gpl2;
|
2020-08-20 17:08:02 +00:00
|
|
|
maintainers = with maintainers; [ _0x4A6F ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|