From 1e1e4927b05d9b242bfe83794e3a98ab2c8f79ef Mon Sep 17 00:00:00 2001 From: root Date: Wed, 23 Nov 2011 23:15:26 +0000 Subject: Wed Nov 23 23:15:26 UTC 2011 --- community-staging/ntop/PKGBUILD | 44 +++++++++++++++++++++++++++++++++++++ community-staging/ntop/ntop | 38 ++++++++++++++++++++++++++++++++ community-staging/ntop/ntop.conf.d | 5 +++++ community-staging/ntop/ntop.install | 8 +++++++ 4 files changed, 95 insertions(+) create mode 100644 community-staging/ntop/PKGBUILD create mode 100755 community-staging/ntop/ntop create mode 100644 community-staging/ntop/ntop.conf.d create mode 100644 community-staging/ntop/ntop.install (limited to 'community-staging/ntop') diff --git a/community-staging/ntop/PKGBUILD b/community-staging/ntop/PKGBUILD new file mode 100644 index 000000000..cb921ba4f --- /dev/null +++ b/community-staging/ntop/PKGBUILD @@ -0,0 +1,44 @@ +# $Id: PKGBUILD 59280 2011-11-22 10:19:42Z lfleischer $ +# Maintainer: Lukas Fleischer +# Contributor: Douglas Soares de Andrade + +pkgname=ntop +pkgver=4.1.0 +pkgrel=2 +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}.tar.gz" + 'ntop' + 'ntop.conf.d') +md5sums=('116df99cf548431393991ea15443c52f' + '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-staging/ntop/ntop b/community-staging/ntop/ntop new file mode 100755 index 000000000..2f0dbcbdd --- /dev/null +++ b/community-staging/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-staging/ntop/ntop.conf.d b/community-staging/ntop/ntop.conf.d new file mode 100644 index 000000000..28e2a3166 --- /dev/null +++ b/community-staging/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-staging/ntop/ntop.install b/community-staging/ntop/ntop.install new file mode 100644 index 000000000..8d8063751 --- /dev/null +++ b/community-staging/ntop/ntop.install @@ -0,0 +1,8 @@ +post_install() { + /bin/cat < 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 +} -- cgit v1.2.3-54-g00ecf