summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-01-25 16:35:49 +0000
committerSam James <sam@gentoo.org>2022-01-25 16:37:00 +0000
commit9ede51cacd883bab9167e570ae27ad391bfd5c95 (patch)
tree5ce463a2c07bebedd3aaeeb71163e98089a327a6 /net-analyzer/vnstat
parentdev-libs/libbsd: add 0.11.5, drop 0.11.4 (diff)
downloadgentoo-9ede51cacd883bab9167e570ae27ad391bfd5c95.tar.gz
gentoo-9ede51cacd883bab9167e570ae27ad391bfd5c95.tar.bz2
gentoo-9ede51cacd883bab9167e570ae27ad391bfd5c95.zip
net-analyzer/vnstat: add 2.9
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'net-analyzer/vnstat')
-rw-r--r--net-analyzer/vnstat/Manifest2
-rw-r--r--net-analyzer/vnstat/files/vnstat-2.9-conf.patch39
-rw-r--r--net-analyzer/vnstat/vnstat-2.9.ebuild84
-rw-r--r--net-analyzer/vnstat/vnstat-9999.ebuild8
4 files changed, 128 insertions, 5 deletions
diff --git a/net-analyzer/vnstat/Manifest b/net-analyzer/vnstat/Manifest
index 398dbd978b5b..522f2f8774e3 100644
--- a/net-analyzer/vnstat/Manifest
+++ b/net-analyzer/vnstat/Manifest
@@ -2,3 +2,5 @@ DIST vnstat-1.17.tar.gz 238397 BLAKE2B 73aaffda3c91a1146b1d6a21f637272be227a15a7
DIST vnstat-1.17.tar.gz.asc 819 BLAKE2B 3186e28dc29edb37eb0bbef9b29f1ea682e4a9de208b69b83a8bc99c81f272eb6865176aaa30e415bf8423d94f385e0725e1256eeb822c3152638eaace23b749 SHA512 c26af29daefe6431c1769812d04ba5bff92ac1241a6a49df11e28f0e51b21d4eb84ff1f1fb133a388fd8ac59967162bc5d60d5f02c409d34be5414acd34f7818
DIST vnstat-2.8.tar.gz 290644 BLAKE2B 21ff801ce6abb135c26eb937eadb447bea9fd3dcb2af123051edb9861e088d8fc217f84ef2d924fe8b480388cfc761d0259f8abb2312ae49c2840643787d49bd SHA512 207aa1699df298ce3008153701782634a96a239599d17a5b2f1fbb298a9cf8edb35298e2de1f4f93415ddf34e0bdb831f95984b47fdd7f89ecc6aeb4821a0afd
DIST vnstat-2.8.tar.gz.asc 833 BLAKE2B 097d37e1916924901f10d09bba882357c0eb81cf71fca921dbc642735ec8c0bde97f7ab63cd3953718c21687e6f39099cf2446210f41f3698b39b74116c4c025 SHA512 d5448d68da92d434cc6a34e007002c81ed8d97e533bf99364d3f65b4125bd6f21fe2f6f6efb97775ecc4ba4afd09e12add71ae2299a2d990a7a9d0a591c32811
+DIST vnstat-2.9.tar.gz 300796 BLAKE2B 1671fe49f3add0087431b57aaa69d4c6280066a299e6899c00cd5bf6ec21380d1457295f884f683ebfb89959eea08a9d900e898a865e3f6ff2a82ecf354d974a SHA512 883f273c02f6d91478991d95deffba9d90457a1bb0b9dd818c01398365df97ffb72dda88299231d9076756192b05524b6f8820470c9caf6ee6a12e5914a82176
+DIST vnstat-2.9.tar.gz.asc 833 BLAKE2B 4dd17e02e6c0c5232354ea8c4dea1d86ac43015ac66c60dc227b143aa5352e5a1eb0870932662778b2350928b124e2bbc56dfa13cfe7c2fd74538d84c00f9b4c SHA512 bf57974afb028fef7ec311a15bb1dcf275f10b845c5512efe73711b622b5912c4de0ff0553db4152389d2421a468c888191eab8fca08212e164f997ad1e04778
diff --git a/net-analyzer/vnstat/files/vnstat-2.9-conf.patch b/net-analyzer/vnstat/files/vnstat-2.9-conf.patch
new file mode 100644
index 000000000000..d2cfa3977cfb
--- /dev/null
+++ b/net-analyzer/vnstat/files/vnstat-2.9-conf.patch
@@ -0,0 +1,39 @@
+diff --git a/cfg/vnstat.conf b/cfg/vnstat.conf
+index f404de5..d2bd928 100644
+--- a/cfg/vnstat.conf
++++ b/cfg/vnstat.conf
+@@ -80,10 +80,10 @@
+ ##
+
+ # switch to given user when started as root (leave empty to disable)
+-;DaemonUser ""
++;DaemonUser "vnstat"
+
+ # switch to given group when started as root (leave empty to disable)
+-;DaemonGroup ""
++;DaemonGroup "vnstat"
+
+ # try to detect interface maximum bandwidth, 0 = disable feature
+ # MaxBandwidth will be used as fallback value when enabled
+@@ -161,7 +161,7 @@
+ ;LogFile "/var/log/vnstat/vnstat.log"
+
+ # file used as daemon pid / lock file
+-;PidFile "/var/run/vnstat/vnstat.pid"
++;PidFile "/run/vnstat/vnstat.pid"
+
+ # 1 = 64-bit, 0 = 32-bit, -1 = old style logic, -2 = automatic detection
+ ;64bitInterfaceCounters -2
+diff --git a/src/common.h b/src/common.h
+index bb2fb56..f148004 100644
+--- a/src/common.h
++++ b/src/common.h
+@@ -241,7 +241,7 @@ and most can be changed later from the config file.
+ #define CREATEDIRS 1
+ #define UPDATEFILEOWNER 1
+ #define LOGFILE "/var/log/vnstat/vnstat.log"
+-#define PIDFILE "/var/run/vnstat/vnstat.pid"
++#define PIDFILE "/run/vnstat/vnstat.pid"
+ #define IS64BIT -2
+ #define WALDB 0
+ #define WALDBCHECKPOINTINTERVALMINS 240
diff --git a/net-analyzer/vnstat/vnstat-2.9.ebuild b/net-analyzer/vnstat/vnstat-2.9.ebuild
new file mode 100644
index 000000000000..f9877e7f008d
--- /dev/null
+++ b/net-analyzer/vnstat/vnstat-2.9.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit systemd tmpfiles
+
+DESCRIPTION="Console-based network traffic monitor that keeps statistics of network usage"
+HOMEPAGE="https://humdi.net/vnstat/"
+
+if [[ ${PV} == *9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/vergoh/vnstat"
+ inherit git-r3
+else
+ VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/teemutoivola.asc
+ inherit verify-sig
+
+ SRC_URI="https://humdi.net/vnstat/${P}.tar.gz"
+ SRC_URI+=" verify-sig? ( https://humdi.net/vnstat/${P}.tar.gz.asc )"
+
+ KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86"
+
+ BDEPEND="verify-sig? ( sec-keys/openpgp-keys-teemutoivola )"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="gd selinux test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ acct-group/vnstat
+ acct-user/vnstat
+ dev-db/sqlite
+ gd? ( media-libs/gd[png] )
+"
+DEPEND="
+ ${RDEPEND}
+ test? ( dev-libs/check )
+"
+RDEPEND+=" selinux? ( sec-policy/selinux-vnstatd )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.9-conf.patch
+)
+
+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
+ newtmpfiles "${FILESDIR}"/vnstatd.tmpfile vnstatd.conf
+
+ use gd && doman man/vnstati.1
+
+ doman man/vnstat.1 man/vnstatd.8
+
+ newdoc INSTALL README.setup
+ dodoc CHANGES README UPGRADE FAQ examples/vnstat.cgi
+}
+
+pkg_postinst() {
+ tmpfiles_process vnstatd.conf
+}
diff --git a/net-analyzer/vnstat/vnstat-9999.ebuild b/net-analyzer/vnstat/vnstat-9999.ebuild
index 407176bb06b7..f9877e7f008d 100644
--- a/net-analyzer/vnstat/vnstat-9999.ebuild
+++ b/net-analyzer/vnstat/vnstat-9999.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
inherit systemd tmpfiles
@@ -41,9 +41,7 @@ DEPEND="
RDEPEND+=" selinux? ( sec-policy/selinux-vnstatd )"
PATCHES=(
- "${FILESDIR}"/${PN}-2.2-conf.patch
- "${FILESDIR}"/${PN}-2.2-drop-root.patch
- "${FILESDIR}"/${PN}-2.2-run.patch
+ "${FILESDIR}"/${PN}-2.9-conf.patch
)
src_compile() {