aboutsummaryrefslogtreecommitdiffstats
path: root/community/vnstat
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2017-01-13 15:43:54 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2017-01-13 15:43:54 +0100
commitbf1a5e076df6ac74bb741c10babfdbc4e5cb2b06 (patch)
tree36fcfa5aeee3222e909de184e3d79f4513c1300b /community/vnstat
parentb8b9587650875423230c5f9e60286c96858de4d5 (diff)
downloadaports-bf1a5e076df6ac74bb741c10babfdbc4e5cb2b06.tar.bz2
aports-bf1a5e076df6ac74bb741c10babfdbc4e5cb2b06.tar.xz
community/vnstat: upgrade to 1.16
Diffstat (limited to 'community/vnstat')
-rw-r--r--community/vnstat/APKBUILD51
-rw-r--r--community/vnstat/vnstat.pre-install6
-rw-r--r--community/vnstat/vnstatd.confd7
-rw-r--r--community/vnstat/vnstatd.initd37
4 files changed, 101 insertions, 0 deletions
diff --git a/community/vnstat/APKBUILD b/community/vnstat/APKBUILD
new file mode 100644
index 0000000000..e24655b410
--- /dev/null
+++ b/community/vnstat/APKBUILD
@@ -0,0 +1,51 @@
+# Contributor: Bartłomiej Piotrowski <nospam@bpiotrowski.pl>
+# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
+pkgname=vnstat
+pkgver=1.16
+pkgrel=0
+pkgdesc="A console-based network traffic monitor"
+url="http://humdi.net/vnstat/"
+arch="all"
+license="GPL"
+install="$pkgname.pre-install"
+makedepends="gd-dev"
+subpackages="$pkgname-doc"
+source="http://humdi.net/vnstat/$pkgname-$pkgver.tar.gz
+ vnstatd.initd
+ vnstatd.confd"
+builddir="$srcdir/vnstat-$pkgver"
+
+build() {
+ cd "$builddir"
+ ./configure \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ || return 1
+ make || return 1
+}
+
+package() {
+ cd "$builddir"
+
+ make DESTDIR="$pkgdir" install || return 1
+
+ install -D -m0755 "$srcdir"/vnstatd.initd \
+ "$pkgdir"/etc/init.d/vnstatd || return 1
+ install -D -m0644 "$srcdir"/vnstatd.confd \
+ "$pkgdir"/etc/conf.d/vnstatd || return 1
+
+ install -D -m0755 examples/vnstat.cgi \
+ "$pkgdir"/usr/share/doc/vnstat/examples/vnstat.cgi || return 1
+}
+
+md5sums="6eed3fbda4b97411163d8b09415bbba7 vnstat-1.16.tar.gz
+cf0a4a161295e1d1988836cdc8d1064d vnstatd.initd
+810205e9cd5328b4279bd9ab1b804c36 vnstatd.confd"
+sha256sums="420fec6c89229a100697f3189e824a1b81f7148dd651558f2ff03cc298308e8b vnstat-1.16.tar.gz
+98d57c982722372257d4b901836170ae0e81d9e575caa5a6463bdc6a78f9dd2a vnstatd.initd
+2cd5b91f86bc26aca85166a50de89faaccbf1ea8f219efb48b50b7ed0f3fe377 vnstatd.confd"
+sha512sums="8906acebead4aef7ec7e96c4f9f17a2b9483f69cf530eb21d2ddc60de71b7690453bf533acfac298cf7e5184c23c7e6a886a757fdbfac3006cc09653c9a2cf6b vnstat-1.16.tar.gz
+cc3183b8d42eff1e0a876420612dd8892ba5ac10810e7de7ca1076eb5e5867145a0d7e605773f39157e91da29aa68ae5c350d120f60292578fcaba44603b2b92 vnstatd.initd
+d645817913d5b52e928561b3d6a0e869d8ae5db81b97af91c1ebfc6a8cd2df666c1653e6dc5f91c0a890033a89692f77eaf081c1cae5590446c69a70ea263946 vnstatd.confd"
diff --git a/community/vnstat/vnstat.pre-install b/community/vnstat/vnstat.pre-install
new file mode 100644
index 0000000000..2a94edea9d
--- /dev/null
+++ b/community/vnstat/vnstat.pre-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+addgroup -S vnstat 2>/dev/null
+adduser -S -D -H -h /var/lib/ -s /bin/false -G vnstat -g vnstat vnstat 2>/dev/null
+
+exit 0
diff --git a/community/vnstat/vnstatd.confd b/community/vnstat/vnstatd.confd
new file mode 100644
index 0000000000..17901419aa
--- /dev/null
+++ b/community/vnstat/vnstatd.confd
@@ -0,0 +1,7 @@
+# /etc/conf.d/vnstatd: config file for /etc/init.d/vnstatd
+
+# Adjust scheduling priority on vnstatd (default: 0)
+#VNSTATD_NICELEVEL="0"
+
+# Pass extra options to vnstatd
+#VNSTATD_EXTRAOPTS="--config /etc/vnstat.conf"
diff --git a/community/vnstat/vnstatd.initd b/community/vnstat/vnstatd.initd
new file mode 100644
index 0000000000..e206fb263d
--- /dev/null
+++ b/community/vnstat/vnstatd.initd
@@ -0,0 +1,37 @@
+#!/sbin/openrc-run
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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
+ checkpath -q -d -m 755 -o vnstat:vnstat /var/lib/vnstat
+ start-stop-daemon --start --quiet \
+ --pidfile "${VNSTATD_PIDFILE}" \
+ --user vnstat --group vnstat \
+ --nicelevel ${VNSTATD_NICELEVEL:-0} \
+ --exec /usr/sbin/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 $?
+}