commit: 2cf8e0cb434c8736e3d37b5c08eeffb59e240505 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org> AuthorDate: Tue Oct 17 10:58:52 2017 +0000 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org> CommitDate: Tue Oct 17 11:01:21 2017 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2cf8e0cb
net-analyzer/vnstat: Add live ebuild. Package-Manager: Portage-2.3.11, Repoman-2.3.3 net-analyzer/vnstat/vnstat-9999.ebuild | 67 ++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/net-analyzer/vnstat/vnstat-9999.ebuild b/net-analyzer/vnstat/vnstat-9999.ebuild new file mode 100644 index 00000000000..9e4b3546a2b --- /dev/null +++ b/net-analyzer/vnstat/vnstat-9999.ebuild @@ -0,0 +1,67 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +inherit git-r3 systemd user + +DESCRIPTION="Console-based network traffic monitor that keeps statistics of network usage" +HOMEPAGE="http://humdi.net/vnstat/" +EGIT_REPO_URI="https://github.com/vergoh/vnstat" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="" +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 ) +" +PATCHES=( + "${FILESDIR}"/${PN}-1.17-conf.patch + "${FILESDIR}"/${PN}-1.17-drop-root.patch + "${FILESDIR}"/${PN}-1.17-run.patch +) + +pkg_setup() { + enewgroup vnstat + enewuser vnstat -1 -1 /var/lib/vnstat vnstat +} + +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 +}