summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Severance2015-07-24 18:02:24 -0400
committerChris Severance2015-07-24 18:02:24 -0400
commitdd405e616ccb241bf4ffb9b36ae4d32f7e702600 (patch)
tree0106bfbbdfc379d5e0c34eb69ec0c9f3dcf28345
downloadaur-dd405e616ccb241bf4ffb9b36ae4d32f7e702600.tar.gz
Initial import
-rw-r--r--.SRCINFO25
-rw-r--r--PKGBUILD73
-rw-r--r--nfacctd.rc.d40
-rw-r--r--pmacctd.rc.d40
-rw-r--r--sfacctd.rc.d40
-rw-r--r--uacctd.rc.d40
6 files changed, 258 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..73766271642
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,25 @@
+pkgbase = pmacct
+ pkgdesc = Accounting and aggregation toolsuite for IPv4 and IPv6 able to collect data through libpcap, Netlink/ULOG, Netflow and sFlow
+ pkgver = 0.14.0
+ pkgrel = 1
+ url = http://www.pmacct.net/
+ arch = i686
+ arch = x86_64
+ license = GPL2
+ depends = libpcap
+ depends = libmysqlclient
+ depends = postgresql-libs
+ depends = sqlite3
+ source = http://www.pmacct.net/pmacct-0.14.0.tar.gz
+ source = pmacctd.rc.d
+ source = nfacctd.rc.d
+ source = sfacctd.rc.d
+ source = uacctd.rc.d
+ sha256sums = c4b4ed5608c600910bd580f92faefd8d3af0f6d5c4aabddb5ce31c6d192e0336
+ sha256sums = 504b31e1a3ccc6ab9fd56960800e6146cae69c479d1a87a5f491042c382e4384
+ sha256sums = 143e7b83d15df723e2668383efb108e458818b47fdd62a6201b159a5430379e7
+ sha256sums = 990915185774ccb6f167433f1f4a4c415dc60fcaaee2af9d9239dfafefcb8166
+ sha256sums = dbfd2210e9e96d672483916c3c2dd38a58c1725920823a7221a2a2cd3f43c48a
+
+pkgname = pmacct
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..ea2f40eb2b9
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,73 @@
+# Maintainer: Chris Severance aur.severach aATt spamgourmet dott com
+# Contributor : xav <xav at ethertricks dot net>
+
+set -u
+pkgname='pmacct'
+pkgver='0.14.0'
+pkgrel='1'
+pkgdesc='Accounting and aggregation toolsuite for IPv4 and IPv6 able to collect data through libpcap, Netlink/ULOG, Netflow and sFlow'
+arch=('i686' 'x86_64')
+url='http://www.pmacct.net/'
+license=('GPL2')
+depends=('libpcap' 'libmysqlclient' 'postgresql-libs' 'sqlite3')
+source=("http://www.pmacct.net/${pkgname}-${pkgver}.tar.gz"
+ 'pmacctd.rc.d' \
+ 'nfacctd.rc.d' \
+ 'sfacctd.rc.d' \
+ 'uacctd.rc.d')
+sha256sums=('c4b4ed5608c600910bd580f92faefd8d3af0f6d5c4aabddb5ce31c6d192e0336'
+ '504b31e1a3ccc6ab9fd56960800e6146cae69c479d1a87a5f491042c382e4384'
+ '143e7b83d15df723e2668383efb108e458818b47fdd62a6201b159a5430379e7'
+ '990915185774ccb6f167433f1f4a4c415dc60fcaaee2af9d9239dfafefcb8166'
+ 'dbfd2210e9e96d672483916c3c2dd38a58c1725920823a7221a2a2cd3f43c48a')
+prepare() {
+ set -u
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ ./configure --prefix='/usr' --mandir='/usr/share/man' --enable-ipv6 --enable-mysql --enable-pgsql --enable-sqlite3 --enable-64bit --enable-threads
+ set +u
+}
+
+build() {
+ set -u
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make -s -j $(nproc) # not big enough for multi processors
+ set +u
+}
+
+package() {
+ set -u
+ cd "${srcdir}/${pkgname}-${pkgver}"
+ make DESTDIR="${pkgdir}" install
+
+ mkdir -p "${pkgdir}/etc/pmacct/examples" "${pkgdir}/usr/share/pmacct"/{mysql,pgsql,sqlite3,sh} "${pkgdir}/usr/share/doc/pmacct"
+
+ # configuration examples
+ install -Dpm644 "${srcdir}/${pkgname}-${pkgver}/examples/pmacctd-imt.conf.example" "${pkgdir}/etc/pmacct/pmacctd.conf"
+ install -Dpm644 "${srcdir}/${pkgname}-${pkgver}/examples"/*.example -t "${pkgdir}/etc/pmacct/examples/"
+
+ # rc.d scripts
+ install -Dpm755 "${srcdir}/sfacctd.rc.d" "${pkgdir}/etc/rc.d/sfacctd"
+ install -Dpm755 "${srcdir}/nfacctd.rc.d" "${pkgdir}/etc/rc.d/nfacctd"
+ install -Dpm755 "${srcdir}/nfacctd.rc.d" "${pkgdir}/etc/rc.d/uacctd"
+ install -Dpm755 "${srcdir}/pmacctd.rc.d" "${pkgdir}/etc/rc.d/pmacctd"
+ sed -i -e 's:/sbin/:/bin/:g' "${pkgdir}/etc/rc.d"/*
+
+ # sh and sql scripts
+ install -Dpm644 "${srcdir}/${pkgname}-${pkgver}/sql"/*.mysql -t "${pkgdir}/usr/share/pmacct/mysql/"
+ install -Dpm644 "${srcdir}/${pkgname}-${pkgver}/sql"/*.pgsql -t "${pkgdir}/usr/share/pmacct/pgsql/"
+ install -Dpm644 "${srcdir}/${pkgname}-${pkgver}/sql"/*.sqlite3 -t "${pkgdir}/usr/share/pmacct/sqlite3/"
+ install -Dpm744 "${srcdir}/${pkgname}-${pkgver}/examples"/*.sh -t "${pkgdir}/usr/share/pmacct/sh/"
+
+ # documentation
+ install -Dpm644 "${srcdir}/${pkgname}-${pkgver}/sql"/README.* -t "${pkgdir}/usr/share/doc/pmacct/"
+ install -Dpm644 "${srcdir}/${pkgname}-${pkgver}/docs"/* -t "${pkgdir}/usr/share/doc/pmacct/"
+ cp -p 'AUTHORS' 'ChangeLog' 'CONFIG-KEYS' 'COPYING' 'EXAMPLES' 'FAQS' 'KNOWN-BUGS' 'README' 'TODO' 'TOOLS' 'UPGRADE' -t "${pkgdir}/usr/share/doc/pmacct/"
+
+ # Ensure there are no forbidden paths (git-aurcheck)
+ ! grep -alqr "/sbin" "${pkgdir}" || echo "${}"
+ ! grep -alqr "/usr/tmp" "${pkgdir}" || echo "${}"
+
+ set +u
+}
+
+set +u
diff --git a/nfacctd.rc.d b/nfacctd.rc.d
new file mode 100644
index 00000000000..bc210c9376a
--- /dev/null
+++ b/nfacctd.rc.d
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+CONF=/etc/pmacct/nfacctd.conf
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+[ -f $CONF ]
+
+PID=$(pidof -o %PPID /usr/sbin/nfacctd)
+case "$1" in
+ start)
+ stat_busy "Starting pmacct NetFlow Accounting Daemon"
+ [ -z "$PID" ] && /usr/sbin/nfacctd -f $CONF
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon nfacctd
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping pmacct NetFlow Accounting Daemon"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon nfacctd
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/pmacctd.rc.d b/pmacctd.rc.d
new file mode 100644
index 00000000000..a90ca54e07b
--- /dev/null
+++ b/pmacctd.rc.d
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+CONF=/etc/pmacct/pmacctd.conf
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+[ -f $CONF ]
+
+PID=$(pidof -o %PPID /usr/sbin/pmacctd)
+case "$1" in
+ start)
+ stat_busy "Starting pmacct libpcap Accounting Daemon"
+ [ -z "$PID" ] && /usr/sbin/pmacctd -f $CONF
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon pmacctd
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping pmacct libpcap Accounting Daemon"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon pmacctd
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/sfacctd.rc.d b/sfacctd.rc.d
new file mode 100644
index 00000000000..9af03e84c1f
--- /dev/null
+++ b/sfacctd.rc.d
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+CONF=/etc/pmacct/sfacctd.conf
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+[ -f $CONF ]
+
+PID=$(pidof -o %PPID /usr/sbin/sfacctd)
+case "$1" in
+ start)
+ stat_busy "Starting pmacct sFlow Accounting Daemon"
+ [ -z "$PID" ] && /usr/sbin/sfacctd -f $CONF
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon sfacctd
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping pmacct sFlow Accounting Daemon"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon sfacctd
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/uacctd.rc.d b/uacctd.rc.d
new file mode 100644
index 00000000000..4bba429ce8d
--- /dev/null
+++ b/uacctd.rc.d
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+CONF=/etc/pmacct/uacctd.conf
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+[ -f $CONF ]
+
+PID=$(pidof -o %PPID /usr/sbin/uacctd)
+case "$1" in
+ start)
+ stat_busy "Starting pmacct ULOG Accounting Daemon"
+ [ -z "$PID" ] && /usr/sbin/uacctd -f $CONF
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon uacctd
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping pmacct ULOG Accounting Daemon"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon uacctd
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0