summaryrefslogtreecommitdiff
path: root/community/ntop
diff options
context:
space:
mode:
authorParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
committerParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
commit415856bdd4f48ab4f2732996f0bae58595092bbe (patch)
treeede2018b591f6dfb477fe9341ba17b9bc000fab9 /community/ntop
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'community/ntop')
-rw-r--r--community/ntop/PKGBUILD44
-rwxr-xr-xcommunity/ntop/ntop38
-rw-r--r--community/ntop/ntop.conf.d5
-rw-r--r--community/ntop/ntop.install8
4 files changed, 95 insertions, 0 deletions
diff --git a/community/ntop/PKGBUILD b/community/ntop/PKGBUILD
new file mode 100644
index 000000000..6049cbb8f
--- /dev/null
+++ b/community/ntop/PKGBUILD
@@ -0,0 +1,44 @@
+# $Id$
+# Maintainer: Lukas Fleischer <archlinux at cryptocrack dot de>
+# Contributor: Douglas Soares de Andrade <douglas@archlinux.org>
+
+pkgname=ntop
+pkgver=4.0.3
+pkgrel=1
+pkgdesc='A network traffic probe that shows the network usage.'
+arch=('i686' 'x86_64')
+url='http://www.ntop.org/'
+license=('GPL')
+depends=('libevent' 'libpcap' 'gd' 'glib' 'libxml2' 'openssl' 'rrdtool' 'pcre' 'geoip' 'lua')
+options=('!libtool' '!makeflags')
+install='ntop.install'
+source=("http://sourceforge.net/projects/${pkgname}/files/${pkgname}/Stable/${pkgname}-${pkgver}.tgz"
+ 'ntop'
+ 'ntop.conf.d')
+md5sums=('f064393a2090e5bda102cd49c2707789'
+ '7b0d7bb57432e768ff387e9f7236f87c'
+ '6a9371de1dcf31d8ef13a4cf349c02b3')
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ ./autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var/lib --disable-snmp
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ make DESTDIR="${pkgdir}" install-recursive
+
+ install -dm0755 -o nobody -g nobody "${pkgdir}/var/lib/ntop"
+ install -dm0755 -o nobody -g nobody "${pkgdir}/var/lib/ntop/rrd"
+
+ install -Dm0755 "${srcdir}/ntop" "${pkgdir}/etc/rc.d/ntop"
+ install -Dm0644 "${srcdir}/ntop.conf.d" "${pkgdir}/etc/conf.d/ntop"
+
+ for _f in "${pkgdir}/usr/lib/ntop/plugins/"*.so; do
+ _plug="$(basename ${_f})"
+ ln -sf "../../lib${_plug}" "${_f}"
+ done
+}
diff --git a/community/ntop/ntop b/community/ntop/ntop
new file mode 100755
index 000000000..2f0dbcbdd
--- /dev/null
+++ b/community/ntop/ntop
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+# source application-specific settings
+[ -f /etc/conf.d/ntop ] && . /etc/conf.d/ntop
+
+case "$1" in
+ start)
+ stat_busy "Starting ntop daemon"
+ /usr/bin/ntop -d ${NTOP_ARGS} 2>&1 >> ${NTOP_LOG}
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon ntop
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping ntop daemon"
+ killall /usr/bin/ntop &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon ntop
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/community/ntop/ntop.conf.d b/community/ntop/ntop.conf.d
new file mode 100644
index 000000000..28e2a3166
--- /dev/null
+++ b/community/ntop/ntop.conf.d
@@ -0,0 +1,5 @@
+# Parameters to be passed to ntop.
+NTOP_ARGS="-i eth0 -w 3000"
+
+# Location of the log file.
+NTOP_LOG="/var/log/ntop.log"
diff --git a/community/ntop/ntop.install b/community/ntop/ntop.install
new file mode 100644
index 000000000..8d8063751
--- /dev/null
+++ b/community/ntop/ntop.install
@@ -0,0 +1,8 @@
+post_install() {
+ /bin/cat <<EOF
+==> Before running the daemon script for the first time, you need to run
+ ntop as the root user to set an administrator password.
+==> If you attempt to run ntop as a daemon without setting a password, a
+ FATAL ERROR message is generated and ntop stops.
+EOF
+}