summaryrefslogtreecommitdiffstats
path: root/main/pmacct
diff options
context:
space:
mode:
Diffstat (limited to 'main/pmacct')
-rw-r--r--main/pmacct/APKBUILD57
-rw-r--r--main/pmacct/nfacctd.conf11
-rw-r--r--main/pmacct/pmacct.confd7
-rw-r--r--main/pmacct/pmacct.initd30
-rwxr-xr-xmain/pmacct/pmacct.post-deinstall4
-rw-r--r--main/pmacct/pmacct.post-install4
-rw-r--r--main/pmacct/pmacctd.conf11
-rw-r--r--main/pmacct/sfacctd.conf9
-rw-r--r--main/pmacct/uacctd.conf9
9 files changed, 142 insertions, 0 deletions
diff --git a/main/pmacct/APKBUILD b/main/pmacct/APKBUILD
new file mode 100644
index 000000000..83d0c547a
--- /dev/null
+++ b/main/pmacct/APKBUILD
@@ -0,0 +1,57 @@
+# Maintainer: Leonardo Arena <rnalrd@gmail.com>
+pkgname=pmacct
+pkgver=0.12.4
+pkgrel=7
+pkgdesc="Measure, account, classify, aggregate and export IPv4 and IPv6 traffic"
+url="http://www.pmacct.net/"
+license="GPL"
+depends=
+makedepends="libpcap-dev libpq postgresql-dev"
+install="$pkgname.post-install $pkgname.post-deinstall"
+subpackages="$pkgname-doc"
+source="http://www.pmacct.net/$pkgname-$pkgver.tar.gz
+ pmacct.initd
+ pmacct.confd
+ pmacctd.conf"
+
+_builddir="$srcdir"/$pkgname-$pkgver
+
+#prepare() {
+# cd "$_builddir"
+# apply patches here
+#}
+
+build() {
+ cd "$_builddir"
+ ./configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --enable-pgsql \
+ --enable-64bit \
+ --enable-threads \
+ --enable-ulog
+ make || return 1
+}
+
+package() {
+ cd "$_builddir"
+ make DESTDIR="$pkgdir" install
+
+ install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/pmacctd
+ install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/pmacctd
+ install -m644 -D "$srcdir"/pmacctd.conf "$pkgdir"/etc/pmacctd.conf
+ install -m644 -D "$srcdir"/nfacctd.conf "$pkgdir"/etc/nfacctd.conf
+ install -m644 -D "$srcdir"/sfacctd.conf "$pkgdir"/etc/sfacctd.conf
+ install -m644 -D "$srcdir"/uacctd.conf "$pkgdir"/etc/uacctd.conf
+ mkdir -p $pkgdir/usr/share/doc/pmacct/examples
+ mkdir -p $pkgdir/usr/share/doc/pmacct/sql
+ cp examples/* $pkgdir/usr/share/doc/pmacct/examples
+ cp sql/README.* $pkgdir/usr/share/doc/pmacct
+ cp sql/* $pkgdir/usr/share/doc/pmacct/sql
+}
+
+md5sums="72098ff945e1ddaa77d7f0b3531fa765 pmacct-0.12.4.tar.gz
+8ebf022a90bb795e6726fee4065bd386 pmacct.initd
+394bf0687572261e90eecd70c33c8ede pmacct.confd
+ecb85e4f9bcb1f6ef0ee1426f979be2b pmacctd.conf"
diff --git a/main/pmacct/nfacctd.conf b/main/pmacct/nfacctd.conf
new file mode 100644
index 000000000..47397d907
--- /dev/null
+++ b/main/pmacct/nfacctd.conf
@@ -0,0 +1,11 @@
+! Sample default config file
+
+daemonize: true
+pidfile: /var/run/pmacctd.pid
+syslog: daemon
+
+! sql_host: localhost
+! sql_passwd:pmacct
+! sql_table_version: 7
+
+! plugins: pgsql
diff --git a/main/pmacct/pmacct.confd b/main/pmacct/pmacct.confd
new file mode 100644
index 000000000..c6557c807
--- /dev/null
+++ b/main/pmacct/pmacct.confd
@@ -0,0 +1,7 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/net-analyzer/pmacct/files/pmacctd-conf.d,v 1.3 2007/03/28 21:17:57 cedk Exp $
+
+# Other options to pass to pmacctd
+#OPTS=""
+
diff --git a/main/pmacct/pmacct.initd b/main/pmacct/pmacct.initd
new file mode 100644
index 000000000..e6e6a3f65
--- /dev/null
+++ b/main/pmacct/pmacct.initd
@@ -0,0 +1,30 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/net-analyzer/pmacct/files/$SVCNAME-init.d,v 1.4 2009/06/01 09:48:41 pva Exp $
+
+depend() {
+ need net
+ after firewall
+}
+
+checkconfig() {
+ if [ ! -e /etc/$SVCNAME.conf ] ; then
+ eerror "You need an /etc/$SVCNAME.conf file to run $SVCNAME"
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting $SVCNAME"
+ start-stop-daemon --start --pidfile /var/run/$SVCNAME.pid --exec /usr/sbin/$SVCNAME \
+ -- -D -f /etc/$SVCNAME.conf -F /var/run/$SVCNAME.pid ${OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping $SVCNAME"
+ start-stop-daemon --stop --pidfile /var/run/$SVCNAME.pid --exec /usr/sbin/$SVCNAME
+ eend $?
+}
diff --git a/main/pmacct/pmacct.post-deinstall b/main/pmacct/pmacct.post-deinstall
new file mode 100755
index 000000000..327b1ce74
--- /dev/null
+++ b/main/pmacct/pmacct.post-deinstall
@@ -0,0 +1,4 @@
+#!/bin/sh
+rm /etc/init.d/nfacctd &>/dev/null
+rm /etc/init.d/sfacctd &>/dev/null
+rm /etc/init.d/uacctd &>/dev/null
diff --git a/main/pmacct/pmacct.post-install b/main/pmacct/pmacct.post-install
new file mode 100644
index 000000000..9fd02c4b1
--- /dev/null
+++ b/main/pmacct/pmacct.post-install
@@ -0,0 +1,4 @@
+#!/bin/sh
+ln -s /etc/init.d/pmacctd /etc/init.d/nfacctd &>/dev/null
+ln -s /etc/init.d/pmacctd /etc/init.d/sfacctd &>/dev/null
+ln -s /etc/init.d/pmacctd /etc/init.d/uacctd &>/dev/null
diff --git a/main/pmacct/pmacctd.conf b/main/pmacct/pmacctd.conf
new file mode 100644
index 000000000..d64189ede
--- /dev/null
+++ b/main/pmacct/pmacctd.conf
@@ -0,0 +1,11 @@
+! Sample configuration file
+
+daemonize: true
+pidfile: /var/run/pmacctd.pid
+syslog: daemon
+
+! sql_host: localhost
+! sql_passwd:pmacct
+! sql_table_version: 7
+
+! plugins: pgsql
diff --git a/main/pmacct/sfacctd.conf b/main/pmacct/sfacctd.conf
new file mode 100644
index 000000000..d175e3113
--- /dev/null
+++ b/main/pmacct/sfacctd.conf
@@ -0,0 +1,9 @@
+daemonize: true
+pidfile: /var/run/pmacctd.pid
+syslog: daemon
+
+! sql_host: localhost
+! sql_passwd:pmacct
+! sql_table_version: 7
+
+! plugins: pgsql
diff --git a/main/pmacct/uacctd.conf b/main/pmacct/uacctd.conf
new file mode 100644
index 000000000..d175e3113
--- /dev/null
+++ b/main/pmacct/uacctd.conf
@@ -0,0 +1,9 @@
+daemonize: true
+pidfile: /var/run/pmacctd.pid
+syslog: daemon
+
+! sql_host: localhost
+! sql_passwd:pmacct
+! sql_table_version: 7
+
+! plugins: pgsql