2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv, fetchurl, libpcap,/* gnutls, libgcrypt,*/ libxml2, glib
|
2015-10-28 13:35:09 +01:00
|
|
|
, geoip, geolite-legacy, sqlite, which, autoreconfHook, git
|
2021-01-17 04:51:22 +01:00
|
|
|
, pkg-config, groff, curl, json_c, luajit, zeromq, rrdtool
|
2014-01-02 17:53:57 +01:00
|
|
|
}:
|
2013-11-05 23:11:57 +01:00
|
|
|
|
|
|
|
# ntopng includes LuaJIT, mongoose, rrdtool and zeromq in its third-party/
|
2016-05-12 01:33:08 +02:00
|
|
|
# directory, but we use luajit, zeromq, and rrdtool from nixpkgs
|
2013-11-05 23:11:57 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-08-01 20:11:18 +02:00
|
|
|
pname = "ntopng";
|
|
|
|
version = "2.0";
|
2014-08-26 11:22:05 +02:00
|
|
|
|
2013-11-05 23:11:57 +01:00
|
|
|
src = fetchurl {
|
2015-08-03 07:36:27 +02:00
|
|
|
urls = [
|
2021-08-01 20:11:18 +02:00
|
|
|
"mirror://sourceforge/project/ntop/ntopng/old/ntopng-${version}.tar.gz"
|
|
|
|
"mirror://sourceforge/project/ntop/ntopng/ntopng-${version}.tar.gz"
|
2015-08-03 07:36:27 +02:00
|
|
|
];
|
2015-10-28 13:35:09 +01:00
|
|
|
sha256 = "0l82ivh05cmmqcvs26r6y69z849d28njipphqzvnakf43ggddgrw";
|
2013-11-05 23:11:57 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
./0001-Undo-weird-modification-of-data_dir.patch
|
|
|
|
./0002-Remove-requirement-to-have-writeable-callback-dir.patch
|
2019-09-19 09:02:15 +02:00
|
|
|
./0003-New-libpcap-defines-SOCKET.patch
|
2013-11-05 23:11:57 +01:00
|
|
|
];
|
|
|
|
|
2015-10-28 13:35:09 +01:00
|
|
|
buildInputs = [ libpcap/* gnutls libgcrypt*/ libxml2 glib geoip geolite-legacy
|
2021-01-17 04:51:22 +01:00
|
|
|
sqlite which autoreconfHook git pkg-config groff curl json_c luajit zeromq
|
2016-05-12 01:33:08 +02:00
|
|
|
rrdtool ];
|
2015-10-28 13:35:09 +01:00
|
|
|
|
|
|
|
|
|
|
|
autoreconfPhase = ''
|
|
|
|
substituteInPlace autogen.sh --replace "/bin/rm" "rm"
|
|
|
|
substituteInPlace nDPI/autogen.sh --replace "/bin/rm" "rm"
|
|
|
|
$shell autogen.sh
|
|
|
|
'';
|
2013-11-05 23:11:57 +01:00
|
|
|
|
2014-08-26 11:22:05 +02:00
|
|
|
preConfigure = ''
|
2015-10-28 13:35:09 +01:00
|
|
|
substituteInPlace Makefile.in --replace "/bin/rm" "rm"
|
2014-08-26 11:22:05 +02:00
|
|
|
'';
|
2013-11-05 23:11:57 +01:00
|
|
|
|
2014-08-26 11:22:05 +02:00
|
|
|
preBuild = ''
|
2015-10-28 13:35:09 +01:00
|
|
|
substituteInPlace src/Ntop.cpp --replace "/usr/local" "$out"
|
2013-11-05 23:11:57 +01:00
|
|
|
|
|
|
|
sed -e "s|\(#define CONST_DEFAULT_DATA_DIR\).*|\1 \"/var/lib/ntopng\"|g" \
|
|
|
|
-e "s|\(#define CONST_DEFAULT_DOCS_DIR\).*|\1 \"$out/share/ntopng/httpdocs\"|g" \
|
|
|
|
-e "s|\(#define CONST_DEFAULT_SCRIPTS_DIR\).*|\1 \"$out/share/ntopng/scripts\"|g" \
|
|
|
|
-e "s|\(#define CONST_DEFAULT_CALLBACKS_DIR\).*|\1 \"$out/share/ntopng/scripts/callbacks\"|g" \
|
|
|
|
-e "s|\(#define CONST_DEFAULT_INSTALL_DIR\).*|\1 \"$out/share/ntopng\"|g" \
|
2015-10-28 13:35:09 +01:00
|
|
|
-i include/ntop_defines.h
|
2014-08-26 11:22:05 +02:00
|
|
|
|
2015-10-28 13:35:09 +01:00
|
|
|
rm -rf httpdocs/geoip
|
2015-03-15 23:25:02 +01:00
|
|
|
ln -s ${geolite-legacy}/share/GeoIP httpdocs/geoip
|
2021-01-15 10:19:50 +01:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
2016-05-12 01:33:08 +02:00
|
|
|
sed 's|LIBS += -lstdc++.6||' -i Makefile
|
2013-11-05 23:11:57 +01:00
|
|
|
'';
|
|
|
|
|
2019-10-30 12:34:47 +01:00
|
|
|
NIX_CFLAGS_COMPILE = "-fpermissive"
|
2021-01-15 10:19:50 +01:00
|
|
|
+ lib.optionalString stdenv.cc.isClang " -Wno-error=reserved-user-defined-literal";
|
2018-02-18 14:12:43 +01:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2013-11-05 23:11:57 +01:00
|
|
|
description = "High-speed web-based traffic analysis and flow collection tool";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://www.ntop.org/products/ntop/";
|
2013-11-05 23:11:57 +01:00
|
|
|
license = licenses.gpl3Plus;
|
2016-05-12 01:33:08 +02:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2013-11-05 23:11:57 +01:00
|
|
|
maintainers = [ maintainers.bjornfor ];
|
|
|
|
};
|
|
|
|
}
|