2013-11-05 22:11:57 +00:00
|
|
|
{ stdenv, fetchurl, libpcap, gnutls, libgcrypt, libxml2, glib, geoip, sqlite
|
2014-08-26 09:22:05 +00:00
|
|
|
, 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 13:41:58 +00:00
|
|
|
name = "ntopng-1.2.1";
|
2014-08-26 09:22:05 +00:00
|
|
|
|
|
|
|
geoLiteCity = fetchurl {
|
|
|
|
url = "http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz";
|
2015-03-26 15:27:24 +00:00
|
|
|
sha256 = "1xqjyz9xnga3dvhj0f38hf78wv781jflvqkxm6qni3sj781nfr4a";
|
2014-08-26 09:22:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
geoLiteCityV6 = fetchurl {
|
|
|
|
url = "http://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz";
|
2015-03-26 15:27:24 +00:00
|
|
|
sha256 = "03s41ffc5a13qy5kgx8jqya97jkw2qlvdkak98hab7xs0i17z9pd";
|
2014-08-26 09:22:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
geoIPASNum = fetchurl {
|
|
|
|
url = "http://geolite.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz";
|
2015-03-26 15:27:24 +00:00
|
|
|
sha256 = "1h766l8dsfgzlrz0q76877xksaf5qf91nwnkqwb6zl1gkczbwy6p";
|
2014-08-26 09:22:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
geoIPASNumV6 = fetchurl {
|
|
|
|
url = "http://geolite.maxmind.com/download/geoip/database/asnum/GeoIPASNumv6.dat.gz";
|
2015-03-26 15:27:24 +00:00
|
|
|
sha256 = "0dwi9b3amfpmpkknf9ipz2r8aq05gn1j2zlvanwwah3ib5cgva9d";
|
2014-08-26 09:22:05 +00:00
|
|
|
};
|
2013-11-05 22:11:57 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2014-09-27 13:41:58 +00:00
|
|
|
url = "mirror://sourceforge/project/ntop/ntopng/${name}.tgz";
|
|
|
|
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
|
|
|
|
];
|
|
|
|
|
2014-08-26 09:22:05 +00:00
|
|
|
buildInputs = [ libpcap gnutls libgcrypt libxml2 glib geoip sqlite which autoreconfHook subversion pkgconfig groff ];
|
2013-11-05 22:11:57 +00:00
|
|
|
|
2014-08-26 09:22:05 +00:00
|
|
|
preConfigure = ''
|
|
|
|
find . -name Makefile.in | xargs sed -i "s|/bin/rm|rm|"
|
|
|
|
'';
|
2013-11-05 22:11:57 +00:00
|
|
|
|
2014-08-26 09:22:05 +00: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 09:22:05 +00:00
|
|
|
|
|
|
|
gunzip -c $geoLiteCity > httpdocs/geoip/GeoLiteCity.dat
|
|
|
|
gunzip -c $geoLiteCityV6 > httpdocs/geoip/GeoLiteCityv6.dat
|
|
|
|
gunzip -c $geoIPASNum > httpdocs/geoip/GeoIPASNum.dat
|
|
|
|
gunzip -c $geoIPASNumV6 > httpdocs/geoip/GeoIPASNumv6.dat
|
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 ];
|
|
|
|
};
|
|
|
|
}
|