1 { lib, stdenv, fetchurl, libpcap,/* gnutls, libgcrypt,*/ libxml2, glib
2 , geoip, geolite-legacy, sqlite, which, autoreconfHook, git
3 , pkg-config, groff, curl, json_c, luajit, zeromq, rrdtool
6 # ntopng includes LuaJIT, mongoose, rrdtool and zeromq in its third-party/
7 # directory, but we use luajit, zeromq, and rrdtool from nixpkgs
9 stdenv.mkDerivation rec {
14 "mirror://sourceforge/project/ntop/ntopng/old/${name}.tar.gz"
15 "mirror://sourceforge/project/ntop/ntopng/${name}.tar.gz"
17 sha256 = "0l82ivh05cmmqcvs26r6y69z849d28njipphqzvnakf43ggddgrw";
21 ./0001-Undo-weird-modification-of-data_dir.patch
22 ./0002-Remove-requirement-to-have-writeable-callback-dir.patch
23 ./0003-New-libpcap-defines-SOCKET.patch
26 buildInputs = [ libpcap/* gnutls libgcrypt*/ libxml2 glib geoip geolite-legacy
27 sqlite which autoreconfHook git pkg-config groff curl json_c luajit zeromq
32 substituteInPlace autogen.sh --replace "/bin/rm" "rm"
33 substituteInPlace nDPI/autogen.sh --replace "/bin/rm" "rm"
38 substituteInPlace Makefile.in --replace "/bin/rm" "rm"
42 substituteInPlace src/Ntop.cpp --replace "/usr/local" "$out"
44 sed -e "s|\(#define CONST_DEFAULT_DATA_DIR\).*|\1 \"/var/lib/ntopng\"|g" \
45 -e "s|\(#define CONST_DEFAULT_DOCS_DIR\).*|\1 \"$out/share/ntopng/httpdocs\"|g" \
46 -e "s|\(#define CONST_DEFAULT_SCRIPTS_DIR\).*|\1 \"$out/share/ntopng/scripts\"|g" \
47 -e "s|\(#define CONST_DEFAULT_CALLBACKS_DIR\).*|\1 \"$out/share/ntopng/scripts/callbacks\"|g" \
48 -e "s|\(#define CONST_DEFAULT_INSTALL_DIR\).*|\1 \"$out/share/ntopng\"|g" \
49 -i include/ntop_defines.h
52 ln -s ${geolite-legacy}/share/GeoIP httpdocs/geoip
53 '' + lib.optionalString stdenv.isDarwin ''
54 sed 's|LIBS += -lstdc++.6||' -i Makefile
57 NIX_CFLAGS_COMPILE = "-fpermissive"
58 + lib.optionalString stdenv.cc.isClang " -Wno-error=reserved-user-defined-literal";
61 description = "High-speed web-based traffic analysis and flow collection tool";
62 homepage = "http://www.ntop.org/products/ntop/";
63 license = licenses.gpl3Plus;
64 platforms = platforms.linux ++ platforms.darwin;
65 maintainers = [ maintainers.bjornfor ];