summaryrefslogtreecommitdiff
path: root/net-analyzer/vnstat
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-analyzer/vnstat
reinit the tree, so we can have metadata
Diffstat (limited to 'net-analyzer/vnstat')
-rw-r--r--net-analyzer/vnstat/Manifest14
-rw-r--r--net-analyzer/vnstat/files/vnstat.cron9
-rw-r--r--net-analyzer/vnstat/files/vnstat.cron-r17
-rw-r--r--net-analyzer/vnstat/files/vnstatd.confd7
-rw-r--r--net-analyzer/vnstat/files/vnstatd.confd-r118
-rw-r--r--net-analyzer/vnstat/files/vnstatd.initd-r137
-rw-r--r--net-analyzer/vnstat/files/vnstatd.initd-r229
-rw-r--r--net-analyzer/vnstat/files/vnstatd.systemd11
-rw-r--r--net-analyzer/vnstat/files/vnstatd.tmpfile1
-rw-r--r--net-analyzer/vnstat/metadata.xml14
-rw-r--r--net-analyzer/vnstat/vnstat-1.17-r1.ebuild123
-rw-r--r--net-analyzer/vnstat/vnstat-1.17.ebuild71
12 files changed, 341 insertions, 0 deletions
diff --git a/net-analyzer/vnstat/Manifest b/net-analyzer/vnstat/Manifest
new file mode 100644
index 000000000000..06ac28a3be46
--- /dev/null
+++ b/net-analyzer/vnstat/Manifest
@@ -0,0 +1,14 @@
+AUX vnstat.cron 220 SHA256 b6b437c680606061b98af19758cbacc3f883f73cd86f0bbfbcfe756c982cd3fd SHA512 c901385f97323d1a686cee63d015eaf9ad38ed195a1c0e25dae671dd7061ebc918498684c55b90b0674960891dfca4b83f458174892c1b9efb48cd362fdb8477 WHIRLPOOL 1432dfdfdf2f121deeff6f8147b344ff61838a8fe54d7bc5bb3ac6c1b9675a64b6e331bd3e33ee0e9fe2488bde42ad8c4e279ea3b1d1d5ed304b4b2ef4205429
+AUX vnstat.cron-r1 177 SHA256 614966fa153b024515a4d6363d3046df9bdda07c7d18bc7aeb4f8347d80e7134 SHA512 8074d65cf2f28bd5c02fe741dbe20f8404bc2e25b94b43d0bcc829ca088828227805caf9cb8cae020ae0a9370d68dc3c757fedf07d48c0fc71ba944f2da1cb94 WHIRLPOOL 9c44e29673064d7c1ac77f8af0bd5aa3117bb46560f4cddee829a3e6a3d617ba468a867298d6d7e58c840c752402e35a8b82dedd8571d13454a167bdbc188676
+AUX vnstatd.confd 216 SHA256 2cd5b91f86bc26aca85166a50de89faaccbf1ea8f219efb48b50b7ed0f3fe377 SHA512 d645817913d5b52e928561b3d6a0e869d8ae5db81b97af91c1ebfc6a8cd2df666c1653e6dc5f91c0a890033a89692f77eaf081c1cae5590446c69a70ea263946 WHIRLPOOL 3a974a3dc30a33a3a2ca22db551068f1df3444f4248e896482e26d1c5b0bd717706ef30e18f5a6ee193966bef1466a13d3c6ad35e86f42f025ebb3c02e622a22
+AUX vnstatd.confd-r1 569 SHA256 e5820c6557cd578faf31c6d5060606e9fe4c024d5f91a90e9b4701c4677fbb5f SHA512 2d5370623ac886e424380100474506b6c2076bfb522fd8ead789af41aeb89b7f3f23c6aa85520d7cc84a53d36926a433b631b5bafe837c9ad04ba04dd7e11553 WHIRLPOOL f943bac6f03d61bd70cbad66f2c96a6b41a4f98ce83671a9430d620fa90f295ad76f007a23304b359a127713567a2df25f5559f1ebf098f0ecf44558267c4e0b
+AUX vnstatd.initd-r1 867 SHA256 631738731bf78a6d0c00c5180c2b3a75b96fffb596d8c9e04dbb0cd24fcc4fec SHA512 6ad3a29a9a376e7dc19279f7effd643b7f55e66461925689c0a7bc43d3484d001d9c027b53e16b3b5b526f45fb0cc47d31f68b2d3137fbb9203e03e66795304f WHIRLPOOL f07914af933371c2b264d4bb67b87ea835dc3f6d7c5b1a069a5166dc4f7b30c0397c01513299f4ddb1bd8f366c852318b4d65275353893f292cefd30a4d0b584
+AUX vnstatd.initd-r2 874 SHA256 5ce75e189239ab52b9114defda6c46f57c18ed88d0ffc8116def3bc6df3831c5 SHA512 1d670980c73a40c92029a3b2141e84d428f41d68528daf199fb6659f164bec903eeef437200da4043d2e6fd3f5abf32c7b6e75dc00054417ff4f38ad55b0a535 WHIRLPOOL 4025c1381c2b30eec2dd01f7f7d069c64d203c80405a94a2ce2e944e0bdf0ad210bd8701fa11d27429bf86f5739559bc41d2411069e6a2678cfbe5654a8a738b
+AUX vnstatd.systemd 262 SHA256 26c4a8e6e1800fd912229bb9463355cde8591261d51f4936765bb94a4ea25cff SHA512 35f9714641d1b3288bed659bd010ef1b8f0316f915622dcf5d3250e1acdd3b438762ae934fab2f6cd350274c7ec0f70a7d8946448bbc6db67be6f91cd86aa47c WHIRLPOOL 3d7f67a773204d3f933c7692b006419376aeead550c3bd169545586f7e7f69deb20585b44bd264be5ec0e83002f2cab3c8d8e11d4d12103fe07c3ae84b52df9f
+AUX vnstatd.tmpfile 35 SHA256 91c9577f36c7f7ec32bb2963035a6ac49e7556ac6adc41564c033db8889b669e SHA512 e13b52e3c4fe8743074ab2704b6a6cbe0c855589fe19e05bba98f0193473437f350dfdc9675689172c54ed83491d9caef0cbb842f6c2533b98366cd78a4f0bac WHIRLPOOL dd6b74ff518ba3b652b3db0519bb45a370c50341ba5e1c8f37b01c2a5dc03341dffda2a88e389e66f6d620fa90a63f6ddf5e05c474d92d7644be156312989cda
+DIST vnstat-1.17.tar.gz 238397 SHA256 18e4c53576ca9e1ef2f0e063a6d83b0c44e3b1cf008560d658745df5c9aa7971 SHA512 c9c119a89054dacdc15026c766a20d88336d7689dd4264530d0347fcc58f3cbfc806b271e0f83e76c3b4a31ab793a628ee7d7b696943da919ee4cd2fdb481cc3 WHIRLPOOL 38f64c6eadf7bbfcc1cd6cc3d8f8ea3da4846dd64caf242628ce9d0e6f9b8f565dff9d31ecd1633b3a0a8b5e7dcd4545f1adeafeb4f42547ad87be77317622e3
+EBUILD vnstat-1.17-r1.ebuild 3245 SHA256 eef8bbf28b4d7b375d1c1bc7641c3030905d1af52eda262b511404919bc7a2e9 SHA512 e057cc84373e4c60fe84e97836a066067b54ce13409f3eb83033fcd3f73dc7186276a00b89793602dbfc68d9a5dfa0cf18ba4619dcb6bd47a1bdf14b9a8bd6f7 WHIRLPOOL 2a0d5e64c8c23db5df2b119f5b797995cb4577c1ca6233aad80809019887046ecf5ccccd51fd1470b08753db73ca56629c115ac4f81d1571fec3cdeb3821229c
+EBUILD vnstat-1.17.ebuild 1430 SHA256 d05f7cede84c40a709d44a69e1717fb1d9a801df75ce95a51f6ec144aa58a8d8 SHA512 14d709e9ba19b7707d62fd5a82dc483f50b76efa884015a14600dd1489132a1c0a687444b802bbd917252acbfa84c291210cd2078778a16796d0bacb576b360d WHIRLPOOL 1bab57fa5b8b832d7277c4b05820af2898b66f9c5b4617ebcbdd52049020e87344f5e78c44756571ae1bc2201fda0a0fa36dbb9ce6078e4dd8aeaee1080d109c
+MISC ChangeLog 4350 SHA256 8dc324d38ef67a70ae4206f377deed192838d9685f91f11e4faf44045ae48dd4 SHA512 cef200253f77a3059ed18d1630da13c5f33aad335d2399d0fc8e94f687643a983e02fd749480324f77ba0d905e95196ffb73e3d238d1d0436b5b75fa05f30d19 WHIRLPOOL 3a3cf0f596faa146a4127436274dbaec11a604ed129cd95709027701c0b41827012a2db7564b0d1812e1bf726aa47c437c374e245ce0386e6277677cea15eb4c
+MISC ChangeLog-2015 9786 SHA256 db76c2eba2b1cd31b5afd4096dd5e15479842d0dc2835c22b4b6c70d7be0f0c5 SHA512 483b71d6778421520e2696c2ed0e2efc480a40f7f4a36ea0aeaa6fe02b386393c4805f551079e1d304eb73d1c1a443248b6b3449dba7e6734eb0ea54fbdd93bf WHIRLPOOL f721d1991070b8dc468a8ca6d6692b049d8e2ed78ae3100ab0dcc67246c3a005f9cbe2016bc8c45015a92d6d9393070d7f9cf30b0eefbedcebbcc9d6731be09e
+MISC metadata.xml 603 SHA256 943206494ad02b8a7ffbcd0a23032a7f89186eec391aadbe025ea370d6db5b62 SHA512 7dbda5d3a317201c8eb0000f2b55af6b2de6fd44368ab39b08c60ee8eb1355264a8886d9a484ab75d47c0c0ce3f41059a8f354f7d6480ae20e469e4c29ca31e2 WHIRLPOOL c3e1e3cfc44e205edac088ade0205e3f555bb32fdc75f00db031e0f5594d8abe1a6c9120a18f725828b3b3ad2e645e23bf4e0360e0872a0ff7b215ef12e51458
diff --git a/net-analyzer/vnstat/files/vnstat.cron b/net-analyzer/vnstat/files/vnstat.cron
new file mode 100644
index 000000000000..690681327688
--- /dev/null
+++ b/net-analyzer/vnstat/files/vnstat.cron
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+# run vnstat if installed and at least one database exists
+
+# Uncomment the following to enable
+
+#if [ -x /usr/bin/vnstat ] && [ `ls /var/lib/vnstat/ | wc -l` -ge 1 ] ; then
+# exec /usr/bin/vnstat -u
+#fi
diff --git a/net-analyzer/vnstat/files/vnstat.cron-r1 b/net-analyzer/vnstat/files/vnstat.cron-r1
new file mode 100644
index 000000000000..178133675c6f
--- /dev/null
+++ b/net-analyzer/vnstat/files/vnstat.cron-r1
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+# run vnstat if installed and at least one database exists
+
+if [ -x /usr/bin/vnstat ] && [ `ls /var/lib/vnstat/ | wc -l` -ge 1 ] ; then
+ exec /usr/bin/vnstat -u
+fi
diff --git a/net-analyzer/vnstat/files/vnstatd.confd b/net-analyzer/vnstat/files/vnstatd.confd
new file mode 100644
index 000000000000..17901419aacb
--- /dev/null
+++ b/net-analyzer/vnstat/files/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/net-analyzer/vnstat/files/vnstatd.confd-r1 b/net-analyzer/vnstat/files/vnstatd.confd-r1
new file mode 100644
index 000000000000..33edf3560ee8
--- /dev/null
+++ b/net-analyzer/vnstat/files/vnstatd.confd-r1
@@ -0,0 +1,18 @@
+# /etc/conf.d/vnstatd: config file for /etc/init.d/vnstatd
+
+# Configuration file
+VNSTATD_CONFIGFILE="/etc/vnstat.conf"
+
+# PID file
+VNSTATD_PIDFILE="/run/vnstat/vnstatd.pid"
+
+# Options to vnstatd
+# See vnstatd(8) for more details
+# Notes:
+# * Do not specify another PIDFILE but use the variable above to change the location
+# * Do not specify another CONFIGFILE but use the variable above to change the location
+VNSTATD_OPTS=""
+
+# Wait x milliseconds after starting and check that daemon is still running.
+# See start-stop-daemon(8) for more details
+SSD_STARTWAIT=500
diff --git a/net-analyzer/vnstat/files/vnstatd.initd-r1 b/net-analyzer/vnstat/files/vnstatd.initd-r1
new file mode 100644
index 000000000000..a8d61efe0f2a
--- /dev/null
+++ b/net-analyzer/vnstat/files/vnstatd.initd-r1
@@ -0,0 +1,37 @@
+#!/sbin/openrc-run
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+extra_started_commands="reload"
+
+depend() {
+ use net
+}
+
+VNSTATD_PIDFILE="${VNSTATD_PIDFILE:-/run/vnstatd/vnstatd.pid}"
+
+start() {
+ ebegin "Starting vnstatd"
+ checkpath -q -d -m 755 -o vnstat:vnstat /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/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 $(cat "${VNSTATD_PIDFILE}") 2>&1 >/dev/null
+ eend $?
+}
diff --git a/net-analyzer/vnstat/files/vnstatd.initd-r2 b/net-analyzer/vnstat/files/vnstatd.initd-r2
new file mode 100644
index 000000000000..2b4a9336c2a5
--- /dev/null
+++ b/net-analyzer/vnstat/files/vnstatd.initd-r2
@@ -0,0 +1,29 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+extra_started_commands="reload"
+
+VNSTATD_CONFIGFILE=${VNSTATD_CONFIGFILE:-"/etc/vnstat.conf"}
+VNSTATD_PIDFILE=${VNSTATD_PIDFILE:-"/run/vnstat/vnstatd.pid"}
+
+pidfile="${VNSTATD_PIDFILE}"
+command="/usr/bin/vnstatd"
+command_args="${VNSTATD_OPTS} --daemon --config \"${VNSTATD_CONFIGFILE}\" --pidfile \"${pidfile}\""
+start_stop_daemon_args="--wait ${SSD_STARTWAIT:-500}"
+name="vnStat daemon"
+
+description="vnstatd updates vnStat databases."
+description_reload="Reload ${name}'s configuration"
+
+required_files="${VNSTATD_CONFIGFILE}"
+
+start_pre() {
+ checkpath --directory --mode 0775 --owner vnstat:vnstat $(dirname "${pidfile}")
+}
+
+reload() {
+ ebegin "Reloading ${name} configuration"
+ start-stop-daemon --signal HUP --pidfile "${pidfile}"
+ eend $?
+}
diff --git a/net-analyzer/vnstat/files/vnstatd.systemd b/net-analyzer/vnstat/files/vnstatd.systemd
new file mode 100644
index 000000000000..51b079c5a9fb
--- /dev/null
+++ b/net-analyzer/vnstat/files/vnstatd.systemd
@@ -0,0 +1,11 @@
+[Unit]
+Description=vnStat network traffic monitor
+Documentation=man:vnstatd(1) man:vnstat(1) man:vnstat.conf(5)
+After=network-online.target
+
+[Service]
+ExecStart=/usr/bin/vnstatd --nodaemon
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-analyzer/vnstat/files/vnstatd.tmpfile b/net-analyzer/vnstat/files/vnstatd.tmpfile
new file mode 100644
index 000000000000..36ecf2259495
--- /dev/null
+++ b/net-analyzer/vnstat/files/vnstatd.tmpfile
@@ -0,0 +1 @@
+d /run/vnstat 0775 vnstat vnstat -
diff --git a/net-analyzer/vnstat/metadata.xml b/net-analyzer/vnstat/metadata.xml
new file mode 100644
index 000000000000..dace7f2e8f57
--- /dev/null
+++ b/net-analyzer/vnstat/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>netmon@gentoo.org</email>
+ <name>Gentoo network monitoring and analysis project</name>
+ </maintainer>
+<longdescription>
+ vnStat is a network traffic monitor for Linux that keeps a log of daily
+ network traffic for the selected interface(s). vnStat isn't a packet sniffer.
+ The traffic information is analyzed from the /proc filesystem. That way vnStat
+ can be used even without root permissions.
+</longdescription>
+</pkgmetadata>
diff --git a/net-analyzer/vnstat/vnstat-1.17-r1.ebuild b/net-analyzer/vnstat/vnstat-1.17-r1.ebuild
new file mode 100644
index 000000000000..0c24c6dc6014
--- /dev/null
+++ b/net-analyzer/vnstat/vnstat-1.17-r1.ebuild
@@ -0,0 +1,123 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+inherit systemd toolchain-funcs user versionator
+
+DESCRIPTION="Console-based network traffic monitor that keeps statistics of network usage"
+HOMEPAGE="http://humdi.net/vnstat/"
+SRC_URI="http://humdi.net/vnstat/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~sparc ~x86"
+IUSE="gd selinux test"
+
+COMMON_DEPEND="
+ gd? ( media-libs/gd[png] )
+"
+DEPEND="
+ ${COMMON_DEPEND}
+ test? ( dev-libs/check )
+"
+RDEPEND="
+ ${COMMON_DEPEND}
+ selinux? ( sec-policy/selinux-vnstatd )
+"
+
+pkg_setup() {
+ enewgroup vnstat
+ enewuser vnstat -1 -1 /var/lib/vnstat vnstat
+}
+
+src_prepare() {
+ default
+
+ tc-export CC
+
+ sed -i \
+ -e 's|^\(MaxBWethnone.*\)$|#\1|' \
+ -e 's|^Daemon\(.*\) ""$|Daemon\1 "vnstat"|' \
+ -e 's|vnstat[.]log|vnstatd.log|' \
+ -e 's|vnstat[.]pid|vnstatd.pid|' \
+ -e 's|/var/run|/run|' \
+ cfg/${PN}.conf || die
+ sed -i \
+ -e '/PIDFILE/s|/var/run|/run|' \
+ src/common.h || die
+}
+
+src_compile() {
+ emake ${PN} ${PN}d $(usex gd ${PN}i '')
+}
+
+src_install() {
+ use gd && dobin vnstati
+ dobin vnstat vnstatd
+
+ exeinto /usr/share/${PN}
+ newexe "${FILESDIR}"/vnstat.cron-r1 vnstat.cron
+
+ insinto /etc
+ doins cfg/vnstat.conf
+ fowners root:vnstat /etc/vnstat.conf
+
+ keepdir /var/lib/vnstat
+ fowners vnstat:vnstat /var/lib/vnstat
+
+ newconfd "${FILESDIR}"/vnstatd.confd-r1 vnstatd
+ newinitd "${FILESDIR}"/vnstatd.initd-r2 vnstatd
+
+ systemd_newunit "${FILESDIR}"/vnstatd.systemd vnstatd.service
+ systemd_newtmpfilesd "${FILESDIR}"/vnstatd.tmpfile vnstatd.conf
+
+ use gd && doman man/vnstati.1
+ doman man/vnstat.1 man/vnstatd.1
+
+ newdoc INSTALL README.setup
+ dodoc CHANGES README UPGRADE FAQ examples/vnstat.cgi
+}
+
+pkg_postinst() {
+ local _v
+ for _v in ${REPLACING_VERSIONS}; do
+ if ! version_is_at_least 1.17-r1 ${_v}; then
+ # This is an upgrade
+ elog ""
+ elog "Beginning with ${PN}-1.17-r1, we no longer install and use the cron job"
+ elog "per default to update vnStat databases because you will lose some traffic"
+ elog "if your interface transfers more than ~4GB in the time between two cron"
+ elog "runs".
+ elog ""
+ elog "Please make sure that the vnstatd service is enabled if you want to"
+ elog "continue monitoring your traffic."
+
+ # Show this elog only once
+ break
+ fi
+ done
+
+ if [[ -z "${REPLACING_VERSIONS}" ]]; then
+ # This is a new installation
+
+ elog
+ elog "Repeat the following command for every interface you"
+ elog "wish to monitor (replace eth0):"
+ elog " vnstat -u -i eth0"
+ elog "and set correct permissions after that, e.g."
+ elog " chown -R vnstat:vnstat /var/lib/vnstat"
+ elog
+ elog "It is highly recommended to use the included vnstatd to update your"
+ elog "vnStat databases."
+ elog
+ elog "If you want to use the old cron way to update your vnStat databases,"
+ elog "you have to install the cron job manually:"
+ elog ""
+ elog " cp /usr/share/${PN}/vnstat.cron /etc/cron.hourly/vnstat"
+ elog ""
+ elog "Note: if an interface transfers more than ~4GB in"
+ elog "the time between cron runs, you may miss traffic."
+ elog "That's why using vnstatd instead of the cronjob is"
+ elog "the recommended way to update your vnStat databases."
+ fi
+}
diff --git a/net-analyzer/vnstat/vnstat-1.17.ebuild b/net-analyzer/vnstat/vnstat-1.17.ebuild
new file mode 100644
index 000000000000..357fafc8b08f
--- /dev/null
+++ b/net-analyzer/vnstat/vnstat-1.17.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit toolchain-funcs user
+
+DESCRIPTION="Console-based network traffic monitor that keeps statistics of network usage"
+HOMEPAGE="http://humdi.net/vnstat/"
+SRC_URI="http://humdi.net/vnstat/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 arm hppa ppc ppc64 sparc x86"
+IUSE="gd selinux test"
+
+COMMON_DEPEND="
+ gd? ( media-libs/gd[png] )
+"
+DEPEND="
+ ${COMMON_DEPEND}
+ test? ( dev-libs/check )
+"
+RDEPEND="
+ ${COMMON_DEPEND}
+ selinux? ( sec-policy/selinux-vnstatd )
+"
+
+pkg_setup() {
+ enewgroup vnstat
+ enewuser vnstat -1 -1 /dev/null vnstat
+}
+
+src_prepare() {
+ default
+
+ tc-export CC
+
+ sed -i \
+ -e 's|vnstat[.]log|vnstatd.log|' \
+ -e 's|vnstat[.]pid|vnstatd/vnstatd.pid|' \
+ -e 's|/var/run|/run|' \
+ cfg/${PN}.conf || die
+ sed -i \
+ -e '/PIDFILE/s|/var/run|/run|' \
+ src/common.h || die
+}
+
+src_compile() {
+ emake ${PN} ${PN}d $(usex gd ${PN}i '')
+}
+
+src_install() {
+ use gd && dobin vnstati
+ dobin vnstat vnstatd
+
+ exeinto /etc/cron.hourly
+ newexe "${FILESDIR}"/vnstat.cron vnstat
+
+ insinto /etc
+ doins cfg/vnstat.conf
+ fowners root:vnstat /etc/vnstat.conf
+
+ newconfd "${FILESDIR}"/vnstatd.confd vnstatd
+ newinitd "${FILESDIR}"/vnstatd.initd-r1 vnstatd
+
+ use gd && doman man/vnstati.1
+ doman man/vnstat.1 man/vnstatd.1
+
+ newdoc INSTALL README.setup
+ dodoc CHANGES README UPGRADE FAQ examples/vnstat.cgi
+}