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-27 09:35:20 +00:00
|
|
|
, testers
|
2021-10-08 15:17:17 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "1.7.9";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "pmacct";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pmacct";
|
2021-10-08 15:17:17 +00:00
|
|
|
repo = "pmacct";
|
2024-09-26 11:04:55 +00:00
|
|
|
rev = "v${finalAttrs.version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-3gV6GUhTQnH09NRIJQI0xBn05Bgo3AJsE2cSxNPXITo=";
|
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 = {
|
2024-09-26 11:04:55 +00:00
|
|
|
version = testers.testVersion { package = finalAttrs.finalPackage; command = "pmacct -V"; };
|
2022-04-15 01:41:22 +00:00
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "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";
|
2024-05-15 15:35:15 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2020-08-20 17:08:02 +00:00
|
|
|
maintainers = with maintainers; [ _0x4A6F ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2024-09-26 11:04:55 +00:00
|
|
|
})
|