ntopng: use new geolite-legacy package

This commit is contained in:
Tobias Geerinckx-Rice 2015-03-15 23:25:02 +01:00
parent b9e0e67604
commit 55b218160d

View File

@ -1,5 +1,6 @@
{ stdenv, fetchurl, libpcap, gnutls, libgcrypt, libxml2, glib, geoip, sqlite { stdenv, fetchurl, libpcap, gnutls, libgcrypt, libxml2, glib
, which, autoreconfHook, subversion, pkgconfig, groff , geoip, geolite-legacy, sqlite, which, autoreconfHook, subversion
, pkgconfig, groff
}: }:
# ntopng includes LuaJIT, mongoose, rrdtool and zeromq in its third-party/ # ntopng includes LuaJIT, mongoose, rrdtool and zeromq in its third-party/
@ -8,26 +9,6 @@
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "ntopng-1.2.1"; name = "ntopng-1.2.1";
geoLiteCity = fetchurl {
url = "http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz";
sha256 = "1xqjyz9xnga3dvhj0f38hf78wv781jflvqkxm6qni3sj781nfr4a";
};
geoLiteCityV6 = fetchurl {
url = "http://geolite.maxmind.com/download/geoip/database/GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz";
sha256 = "03s41ffc5a13qy5kgx8jqya97jkw2qlvdkak98hab7xs0i17z9pd";
};
geoIPASNum = fetchurl {
url = "http://geolite.maxmind.com/download/geoip/database/asnum/GeoIPASNum.dat.gz";
sha256 = "1h766l8dsfgzlrz0q76877xksaf5qf91nwnkqwb6zl1gkczbwy6p";
};
geoIPASNumV6 = fetchurl {
url = "http://geolite.maxmind.com/download/geoip/database/asnum/GeoIPASNumv6.dat.gz";
sha256 = "0dwi9b3amfpmpkknf9ipz2r8aq05gn1j2zlvanwwah3ib5cgva9d";
};
src = fetchurl { src = fetchurl {
url = "mirror://sourceforge/project/ntop/ntopng/${name}.tgz"; url = "mirror://sourceforge/project/ntop/ntopng/${name}.tgz";
sha256 = "1db83cd1v4ivl8hxzzdvvdcgk22ji7mwrfnd5nnwll6kb11i364v"; sha256 = "1db83cd1v4ivl8hxzzdvvdcgk22ji7mwrfnd5nnwll6kb11i364v";
@ -38,7 +19,8 @@ stdenv.mkDerivation rec {
./0002-Remove-requirement-to-have-writeable-callback-dir.patch ./0002-Remove-requirement-to-have-writeable-callback-dir.patch
]; ];
buildInputs = [ libpcap gnutls libgcrypt libxml2 glib geoip sqlite which autoreconfHook subversion pkgconfig groff ]; buildInputs = [ libpcap gnutls libgcrypt libxml2 glib geoip geolite-legacy
sqlite which autoreconfHook subversion pkgconfig groff ];
preConfigure = '' preConfigure = ''
find . -name Makefile.in | xargs sed -i "s|/bin/rm|rm|" find . -name Makefile.in | xargs sed -i "s|/bin/rm|rm|"
@ -55,10 +37,8 @@ stdenv.mkDerivation rec {
-e "s|\(#define CONST_DEFAULT_INSTALL_DIR\).*|\1 \"$out/share/ntopng\"|g" \ -e "s|\(#define CONST_DEFAULT_INSTALL_DIR\).*|\1 \"$out/share/ntopng\"|g" \
-i ntop_defines.h -i ntop_defines.h
gunzip -c $geoLiteCity > httpdocs/geoip/GeoLiteCity.dat rmdir httpdocs/geoip
gunzip -c $geoLiteCityV6 > httpdocs/geoip/GeoLiteCityv6.dat ln -s ${geolite-legacy}/share/GeoIP httpdocs/geoip
gunzip -c $geoIPASNum > httpdocs/geoip/GeoIPASNum.dat
gunzip -c $geoIPASNumV6 > httpdocs/geoip/GeoIPASNumv6.dat
''; '';
meta = with stdenv.lib; { meta = with stdenv.lib; {