aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartłomiej Piotrowski <b@bpiotrowski.pl>2012-06-08 10:06:07 +0200
committerBartłomiej Piotrowski <b@bpiotrowski.pl>2012-06-08 10:45:37 +0200
commita231c6d5d91058ad3eafa634cbfe1ac5d834cdac (patch)
tree7f4525f06351f09d42acf79d480b402aedfc0733
parent1fa277477ab6b71b8af8d1a2808fbfc071028b37 (diff)
downloadaports-a231c6d5d91058ad3eafa634cbfe1ac5d834cdac.tar.bz2
aports-a231c6d5d91058ad3eafa634cbfe1ac5d834cdac.tar.xz
testing/vnstat: new aport
-rw-r--r--testing/vnstat/APKBUILD30
-rw-r--r--testing/vnstat/vnstatd.initd37
2 files changed, 67 insertions, 0 deletions
diff --git a/testing/vnstat/APKBUILD b/testing/vnstat/APKBUILD
new file mode 100644
index 0000000000..0ae9e742c0
--- /dev/null
+++ b/testing/vnstat/APKBUILD
@@ -0,0 +1,30 @@
+# Maintainer: Bartłomiej Piotrowski <nospam@bpiotrowski.pl>
+
+pkgname=vnstat
+pkgver=1.11
+pkgrel=0
+pkgdesc='A console-based network traffic monitor'
+url='http://humdi.net/vnstat/'
+arch='all'
+license='GPL'
+makedepends='gd-dev'
+subpackages="$pkgname-doc"
+source="http://humdi.net/vnstat/$pkgname-$pkgver.tar.gz
+ vnstatd.initd"
+
+build() {
+ cd "$srcdir"/$pkgname-$pkgver
+ make all || return 1
+}
+
+package() {
+ cd "$srcdir"/$pkgname-$pkgver"
+ make DESTDIR="$pkgdir" install || return 1
+
+ install -D -m0755 "$srcdir"/vnstatd.initd "$pkgdir"/etc/init.d/vnstat || return 1
+ install -D -m0644 examples/vnstat.cron "$pkgdir"/usr/share/doc/vnstat/examples/vnstat.cron || return 1
+ install -D -m0755 examples/vnstat.cgi "$pkgdir"/usr/share/doc/vnstat/examples/vnstat.cgi || return 1
+}
+
+md5sums="a5a113f9176cd61fb954f2ba297f5fdb vnstat-1.11.tar.gz
+6c8a07d3388155c6cb23715ac8467700 vnstatd.initd"
diff --git a/testing/vnstat/vnstatd.initd b/testing/vnstat/vnstatd.initd
new file mode 100644
index 0000000000..b3f136cef3
--- /dev/null
+++ b/testing/vnstat/vnstatd.initd
@@ -0,0 +1,37 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/vnstat/files/vnstatd.initd,v 1.6 2012/01/01 01:19:16 idl0r Exp $
+
+extra_started_commands="reload"
+
+depend() {
+ use net
+}
+
+VNSTATD_PIDFILE="${VNSTATD_PIDFILE:-/var/run/vnstatd/vnstatd.pid}"
+
+start() {
+ ebegin "Starting vnstatd"
+ checkpath -q -d -m 755 -o vnstat:vnstat /var/run/vnstatd
+ start-stop-daemon --start --quiet \
+ --pidfile "${VNSTATD_PIDFILE}" \
+ --user vnstat --group vnstat \
+ --nicelevel ${VNSTATD_NICELEVEL:-0} \
+ --exec /usr/bin/vnstatd -- \
+ -d ${VNSTATD_EXTRAOPTS} -p ${VNSTATD_PIDFILE}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping vnstatd"
+ start-stop-daemon --stop --quiet \
+ --pidfile "${VNSTATD_PIDFILE}"
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading vnstatd configuration"
+ kill -HUP $(< "${VNSTATD_PIDFILE}") &>/dev/null
+ eend $?
+}