2015-03-15 22:25:02 +00:00
|
|
|
{ stdenv, fetchurl, libpcap, gnutls, libgcrypt, libxml2, glib
|
|
|
|
, geoip, geolite-legacy, sqlite, which, autoreconfHook, subversion
|
|
|
|
, pkgconfig, groff
|
2014-01-02 16:53:57 +00:00
|
|
|
}:
|
2013-11-05 22:11:57 +00:00
|
|
|
|
|
|
|
# ntopng includes LuaJIT, mongoose, rrdtool and zeromq in its third-party/
|
|
|
|
# directory.
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2014-09-27 14:41:58 +01:00
|
|
|
name = "ntopng-1.2.1";
|
2014-08-26 10:22:05 +01:00
|
|
|
|
2013-11-05 22:11:57 +00:00
|
|
|
src = fetchurl {
|
2015-08-03 06:36:27 +01:00
|
|
|
urls = [
|
|
|
|
"mirror://sourceforge/project/ntop/ntopng/old/${name}.tgz"
|
|
|
|
"mirror://sourceforge/project/ntop/ntopng/${name}.tgz"
|
|
|
|
];
|
2014-09-27 14:41:58 +01:00
|
|
|
sha256 = "1db83cd1v4ivl8hxzzdvvdcgk22ji7mwrfnd5nnwll6kb11i364v";
|
2013-11-05 22:11:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
./0001-Undo-weird-modification-of-data_dir.patch
|
|
|
|
./0002-Remove-requirement-to-have-writeable-callback-dir.patch
|
|
|
|
];
|
|
|
|
|
2015-03-15 22:25:02 +00:00
|
|
|
buildInputs = [ libpcap gnutls libgcrypt libxml2 glib geoip geolite-legacy
|
|
|
|
sqlite which autoreconfHook subversion pkgconfig groff ];
|
2013-11-05 22:11:57 +00:00
|
|
|
|
2014-08-26 10:22:05 +01:00
|
|
|
preConfigure = ''
|
|
|
|
find . -name Makefile.in | xargs sed -i "s|/bin/rm|rm|"
|
|
|
|
'';
|
2013-11-05 22:11:57 +00:00
|
|
|
|
2014-08-26 10:22:05 +01:00
|
|
|
preBuild = ''
|
2013-11-05 22:11:57 +00:00
|
|
|
sed -e "s|/usr/local|$out|g" \
|
|
|
|
-i Ntop.cpp
|
|
|
|
|
|
|
|
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" \
|
|
|
|
-i ntop_defines.h
|
2014-08-26 10:22:05 +01:00
|
|
|
|
2015-03-15 22:25:02 +00:00
|
|
|
rmdir httpdocs/geoip
|
|
|
|
ln -s ${geolite-legacy}/share/GeoIP httpdocs/geoip
|
2013-11-05 22:11:57 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "High-speed web-based traffic analysis and flow collection tool";
|
|
|
|
homepage = http://www.ntop.org/products/ntop/;
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.bjornfor ];
|
|
|
|
};
|
|
|
|
}
|