diff options
Diffstat (limited to 'net-analyzer/vnstat/vnstat-1.13.ebuild')
-rw-r--r-- | net-analyzer/vnstat/vnstat-1.13.ebuild | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/net-analyzer/vnstat/vnstat-1.13.ebuild b/net-analyzer/vnstat/vnstat-1.13.ebuild new file mode 100644 index 000000000000..5840253e7f48 --- /dev/null +++ b/net-analyzer/vnstat/vnstat-1.13.ebuild @@ -0,0 +1,70 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 +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() { + 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 CFLAGS="${CFLAGS}" $(usex gd all '') +} + +src_install() { + use gd && dobin src/vnstati + dobin src/vnstat src/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 +} |