diff options
author | Bjørn Forsman <bjorn.forsman@gmail.com> | 2013-11-05 23:11:57 +0100 |
---|---|---|
committer | Bjørn Forsman <bjorn.forsman@gmail.com> | 2013-12-09 21:35:01 +0100 |
commit | 3cff0a80149003620405d841d441119a64936e32 (patch) | |
tree | cd53616989a140fbdad5d1395ded8f7e41192895 /pkgs/tools | |
parent | 799062bcb624e65c39ec6c876d1ea45d4c66bfce (diff) | |
download | nixlib-3cff0a80149003620405d841d441119a64936e32.tar nixlib-3cff0a80149003620405d841d441119a64936e32.tar.gz nixlib-3cff0a80149003620405d841d441119a64936e32.tar.bz2 nixlib-3cff0a80149003620405d841d441119a64936e32.tar.lz nixlib-3cff0a80149003620405d841d441119a64936e32.tar.xz nixlib-3cff0a80149003620405d841d441119a64936e32.tar.zst nixlib-3cff0a80149003620405d841d441119a64936e32.zip |
ntopng: new package
ntopng is a high-speed web-based traffic analysis and flow collection tool. ntopng => ntop next generation. http://www.ntop.org/products/ntop/
Diffstat (limited to 'pkgs/tools')
3 files changed, 104 insertions, 0 deletions
diff --git a/pkgs/tools/networking/ntopng/0001-Undo-weird-modification-of-data_dir.patch b/pkgs/tools/networking/ntopng/0001-Undo-weird-modification-of-data_dir.patch new file mode 100644 index 000000000000..8bec643c6e5f --- /dev/null +++ b/pkgs/tools/networking/ntopng/0001-Undo-weird-modification-of-data_dir.patch @@ -0,0 +1,24 @@ +From d0c56a14e0432faca1e9438b84e5e4090d293bb9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= <bjorn.forsman@gmail.com> +Date: Tue, 3 Dec 2013 20:42:24 +0000 +Subject: [PATCH 1/2] Undo weird modification of data_dir + +--- + Prefs.cpp | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/Prefs.cpp b/Prefs.cpp +index b4fde5f..ca04ca1 100644 +--- a/Prefs.cpp ++++ b/Prefs.cpp +@@ -408,7 +408,6 @@ int Prefs::checkOptions() { + ntop->getTrace()->traceEvent(TRACE_ERROR, "Unable to create log %s", path); + } + +- free(data_dir); data_dir = strdup(ntop->get_install_dir()); + docs_dir = ntop->getValidPath(docs_dir); + scripts_dir = ntop->getValidPath(scripts_dir); + callbacks_dir = ntop->getValidPath(callbacks_dir); +-- +1.8.4.3 + diff --git a/pkgs/tools/networking/ntopng/0002-Remove-requirement-to-have-writeable-callback-dir.patch b/pkgs/tools/networking/ntopng/0002-Remove-requirement-to-have-writeable-callback-dir.patch new file mode 100644 index 000000000000..99467c371264 --- /dev/null +++ b/pkgs/tools/networking/ntopng/0002-Remove-requirement-to-have-writeable-callback-dir.patch @@ -0,0 +1,29 @@ +From d77b42003d13e2775be3255a26f380d6ccda8042 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= <bjorn.forsman@gmail.com> +Date: Tue, 3 Dec 2013 21:10:06 +0000 +Subject: [PATCH 2/2] Remove requirement to have writeable callback dir + +* ntopng doesn't write anything to the callback dir +* it seems to be a copy-paste leftover error from data_dir a couple of + lines above +--- + Ntop.cpp | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/Ntop.cpp b/Ntop.cpp +index 2fb027b..0b4881b 100644 +--- a/Ntop.cpp ++++ b/Ntop.cpp +@@ -114,8 +114,7 @@ void Ntop::registerPrefs(Prefs *_prefs) { + } + + if(stat(prefs->get_callbacks_dir(), &statbuf) +- || (!(statbuf.st_mode & S_IFDIR)) /* It's not a directory */ +- || (!(statbuf.st_mode & S_IWRITE)) /* It's not writable */) { ++ || (!(statbuf.st_mode & S_IFDIR))) { /* It's not a directory */ + ntop->getTrace()->traceEvent(TRACE_ERROR, "Invalid directory %s specified", + prefs->get_callbacks_dir()); + exit(-1); +-- +1.8.4.3 + diff --git a/pkgs/tools/networking/ntopng/default.nix b/pkgs/tools/networking/ntopng/default.nix new file mode 100644 index 000000000000..e4f59a98cf05 --- /dev/null +++ b/pkgs/tools/networking/ntopng/default.nix @@ -0,0 +1,51 @@ +{ stdenv, fetchurl, libpcap, gnutls, libgcrypt, libxml2, glib, geoip, sqlite +, which }: + +# ntopng includes LuaJIT, mongoose, rrdtool and zeromq in its third-party/ +# directory. + +stdenv.mkDerivation rec { + name = "ntopng-1.1_6932"; + + src = fetchurl { + url = "mirror://sourceforge/ntop/files/ntopng/${name}.tgz"; + sha256 = "0cdbmrsjp3bb7xzci0vfnnkmbyxwxbf47l4kbnk4ydd7xwhwdnzr"; + }; + + patches = [ + ./0001-Undo-weird-modification-of-data_dir.patch + ./0002-Remove-requirement-to-have-writeable-callback-dir.patch + ]; + + buildInputs = [ libpcap gnutls libgcrypt libxml2 glib geoip sqlite which ]; + + preBuild = '' + sed -e "s|^SHELL=.*|SHELL=${stdenv.shell}|" \ + -e "s|/usr/local|$out|g" \ + -e "s|/bin/rm|rm|g" \ + -i Makefile + + sed -e "s|^SHELL=.*|SHELL=${stdenv.shell}|" \ + -e "s|/usr/local|$out|g" \ + -e "s|/opt/local|/non-existing-dir|g" \ + -i configure + + 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 + ''; + + 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 ]; + }; +} |