ntopng: 1.2.1 -> 2.0.0

+35 -56
+7 -19
pkgs/tools/networking/ntopng/0001-Undo-weird-modification-of-data_dir.patch
··· 1 - From d0c56a14e0432faca1e9438b84e5e4090d293bb9 Mon Sep 17 00:00:00 2001 2 - From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= <bjorn.forsman@gmail.com> 3 - Date: Tue, 3 Dec 2013 20:42:24 +0000 4 - Subject: [PATCH 1/2] Undo weird modification of data_dir 5 - 6 - --- 7 - Prefs.cpp | 1 - 8 - 1 file changed, 1 deletion(-) 9 - 10 - diff --git a/Prefs.cpp b/Prefs.cpp 11 - index b4fde5f..ca04ca1 100644 12 - --- a/Prefs.cpp 13 - +++ b/Prefs.cpp 14 - @@ -408,7 +408,6 @@ int Prefs::checkOptions() { 15 - ntop->getTrace()->traceEvent(TRACE_ERROR, "Unable to create log %s", path); 16 - } 1 + diff --git a/src/Prefs.cpp b/src/Prefs.cpp 2 + index 76385c4..db8d20d 100755 3 + --- a/src/Prefs.cpp 4 + +++ b/src/Prefs.cpp 5 + @@ -795,7 +795,6 @@ int Prefs::checkOptions() { 6 + ntop->getTrace()->traceEvent(TRACE_ERROR, "Unable to create log %s", path); 7 + } 17 8 18 9 - free(data_dir); data_dir = strdup(ntop->get_install_dir()); 19 10 docs_dir = ntop->getValidPath(docs_dir); 20 11 scripts_dir = ntop->getValidPath(scripts_dir); 21 12 callbacks_dir = ntop->getValidPath(callbacks_dir); 22 - -- 23 - 1.8.4.3 24 -
+8 -23
pkgs/tools/networking/ntopng/0002-Remove-requirement-to-have-writeable-callback-dir.patch
··· 1 - From d77b42003d13e2775be3255a26f380d6ccda8042 Mon Sep 17 00:00:00 2001 2 - From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= <bjorn.forsman@gmail.com> 3 - Date: Tue, 3 Dec 2013 21:10:06 +0000 4 - Subject: [PATCH 2/2] Remove requirement to have writeable callback dir 5 - 6 - * ntopng doesn't write anything to the callback dir 7 - * it seems to be a copy-paste leftover error from data_dir a couple of 8 - lines above 9 - --- 10 - Ntop.cpp | 3 +-- 11 - 1 file changed, 1 insertion(+), 2 deletions(-) 12 - 13 - diff --git a/Ntop.cpp b/Ntop.cpp 14 - index 2fb027b..0b4881b 100644 15 - --- a/Ntop.cpp 16 - +++ b/Ntop.cpp 17 - @@ -114,8 +114,7 @@ void Ntop::registerPrefs(Prefs *_prefs) { 1 + diff --git a/src/Ntop.cpp b/src/Ntop.cpp 2 + index 8de92a9..510418f 100644 3 + --- a/src/Ntop.cpp 4 + +++ b/src/Ntop.cpp 5 + @@ -197,8 +197,7 @@ void Ntop::registerPrefs(Prefs *_prefs) { 18 6 } 19 7 20 8 if(stat(prefs->get_callbacks_dir(), &statbuf) 21 - - || (!(statbuf.st_mode & S_IFDIR)) /* It's not a directory */ 9 + - || (!(statbuf.st_mode & S_IFDIR)) /* It's not a directory */ 22 10 - || (!(statbuf.st_mode & S_IWRITE)) /* It's not writable */) { 23 - + || (!(statbuf.st_mode & S_IFDIR))) { /* It's not a directory */ 11 + + || (!(statbuf.st_mode & S_IFDIR)) /* It's not a directory */) { 24 12 ntop->getTrace()->traceEvent(TRACE_ERROR, "Invalid directory %s specified", 25 13 prefs->get_callbacks_dir()); 26 - exit(-1); 27 - -- 28 - 1.8.4.3 29 - 14 + _exit(-1);
+20 -14
pkgs/tools/networking/ntopng/default.nix
··· 1 - { stdenv, fetchurl, libpcap, gnutls, libgcrypt, libxml2, glib 2 - , geoip, geolite-legacy, sqlite, which, autoreconfHook, subversion 3 - , pkgconfig, groff 1 + { stdenv, fetchurl, libpcap,/* gnutls, libgcrypt,*/ libxml2, glib 2 + , geoip, geolite-legacy, sqlite, which, autoreconfHook, git 3 + , pkgconfig, groff, curl, json_c 4 4 }: 5 5 6 6 # ntopng includes LuaJIT, mongoose, rrdtool and zeromq in its third-party/ 7 7 # directory. 8 8 9 9 stdenv.mkDerivation rec { 10 - name = "ntopng-1.2.1"; 10 + name = "ntopng-2.0"; 11 11 12 12 src = fetchurl { 13 13 urls = [ 14 - "mirror://sourceforge/project/ntop/ntopng/old/${name}.tgz" 15 - "mirror://sourceforge/project/ntop/ntopng/${name}.tgz" 14 + "mirror://sourceforge/project/ntop/ntopng/old/${name}.tar.gz" 15 + "mirror://sourceforge/project/ntop/ntopng/${name}.tar.gz" 16 16 ]; 17 - sha256 = "1db83cd1v4ivl8hxzzdvvdcgk22ji7mwrfnd5nnwll6kb11i364v"; 17 + sha256 = "0l82ivh05cmmqcvs26r6y69z849d28njipphqzvnakf43ggddgrw"; 18 18 }; 19 19 20 20 patches = [ ··· 22 22 ./0002-Remove-requirement-to-have-writeable-callback-dir.patch 23 23 ]; 24 24 25 - buildInputs = [ libpcap gnutls libgcrypt libxml2 glib geoip geolite-legacy 26 - sqlite which autoreconfHook subversion pkgconfig groff ]; 25 + buildInputs = [ libpcap/* gnutls libgcrypt*/ libxml2 glib geoip geolite-legacy 26 + sqlite which autoreconfHook git pkgconfig groff curl json_c ]; 27 + 28 + 29 + autoreconfPhase = '' 30 + substituteInPlace autogen.sh --replace "/bin/rm" "rm" 31 + substituteInPlace nDPI/autogen.sh --replace "/bin/rm" "rm" 32 + $shell autogen.sh 33 + ''; 27 34 28 35 preConfigure = '' 29 - find . -name Makefile.in | xargs sed -i "s|/bin/rm|rm|" 36 + substituteInPlace Makefile.in --replace "/bin/rm" "rm" 30 37 ''; 31 38 32 39 preBuild = '' 33 - sed -e "s|/usr/local|$out|g" \ 34 - -i Ntop.cpp 40 + substituteInPlace src/Ntop.cpp --replace "/usr/local" "$out" 35 41 36 42 sed -e "s|\(#define CONST_DEFAULT_DATA_DIR\).*|\1 \"/var/lib/ntopng\"|g" \ 37 43 -e "s|\(#define CONST_DEFAULT_DOCS_DIR\).*|\1 \"$out/share/ntopng/httpdocs\"|g" \ 38 44 -e "s|\(#define CONST_DEFAULT_SCRIPTS_DIR\).*|\1 \"$out/share/ntopng/scripts\"|g" \ 39 45 -e "s|\(#define CONST_DEFAULT_CALLBACKS_DIR\).*|\1 \"$out/share/ntopng/scripts/callbacks\"|g" \ 40 46 -e "s|\(#define CONST_DEFAULT_INSTALL_DIR\).*|\1 \"$out/share/ntopng\"|g" \ 41 - -i ntop_defines.h 47 + -i include/ntop_defines.h 42 48 43 - rmdir httpdocs/geoip 49 + rm -rf httpdocs/geoip 44 50 ln -s ${geolite-legacy}/share/GeoIP httpdocs/geoip 45 51 ''; 46 52