1 |
pva 09/06/21 16:57:54 |
2 |
|
3 |
Modified: ChangeLog |
4 |
Added: vnstat-1.7-r2.ebuild |
5 |
Log: |
6 |
Added vnstatd as alternative way to update traffic database, bug #274779, thank Gordon Malm for this contribution. |
7 |
(Portage version: 2.2_rc33/cvs/Linux i686) |
8 |
|
9 |
Revision Changes Path |
10 |
1.35 net-analyzer/vnstat/ChangeLog |
11 |
|
12 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/vnstat/ChangeLog?rev=1.35&view=markup |
13 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/vnstat/ChangeLog?rev=1.35&content-type=text/plain |
14 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/vnstat/ChangeLog?r1=1.34&r2=1.35 |
15 |
|
16 |
Index: ChangeLog |
17 |
=================================================================== |
18 |
RCS file: /var/cvsroot/gentoo-x86/net-analyzer/vnstat/ChangeLog,v |
19 |
retrieving revision 1.34 |
20 |
retrieving revision 1.35 |
21 |
diff -u -r1.34 -r1.35 |
22 |
--- ChangeLog 26 Apr 2009 19:56:03 -0000 1.34 |
23 |
+++ ChangeLog 21 Jun 2009 16:57:54 -0000 1.35 |
24 |
@@ -1,6 +1,13 @@ |
25 |
# ChangeLog for net-analyzer/vnstat |
26 |
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 |
27 |
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/vnstat/ChangeLog,v 1.34 2009/04/26 19:56:03 patrick Exp $ |
28 |
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/vnstat/ChangeLog,v 1.35 2009/06/21 16:57:54 pva Exp $ |
29 |
+ |
30 |
+*vnstat-1.7-r2 (21 Jun 2009) |
31 |
+ |
32 |
+ 21 Jun 2009; Peter Volkov <pva@g.o> +vnstat-1.7-r2.ebuild, |
33 |
+ +files/vnstatd.confd, +files/vnstatd.initd: |
34 |
+ Added vnstatd as alternative way to update traffic database, bug #274779, |
35 |
+ thank Gordon Malm for this contribution. |
36 |
|
37 |
*vnstat-1.7-r1 (26 Apr 2009) |
38 |
|
39 |
|
40 |
|
41 |
|
42 |
1.1 net-analyzer/vnstat/vnstat-1.7-r2.ebuild |
43 |
|
44 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/vnstat/vnstat-1.7-r2.ebuild?rev=1.1&view=markup |
45 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/vnstat/vnstat-1.7-r2.ebuild?rev=1.1&content-type=text/plain |
46 |
|
47 |
Index: vnstat-1.7-r2.ebuild |
48 |
=================================================================== |
49 |
# Copyright 1999-2009 Gentoo Foundation |
50 |
# Distributed under the terms of the GNU General Public License v2 |
51 |
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/vnstat/vnstat-1.7-r2.ebuild,v 1.1 2009/06/21 16:57:54 pva Exp $ |
52 |
|
53 |
EAPI="2" |
54 |
|
55 |
inherit eutils toolchain-funcs |
56 |
|
57 |
DESCRIPTION="Console-based network traffic monitor that keeps statistics of network usage" |
58 |
HOMEPAGE="http://humdi.net/vnstat/" |
59 |
SRC_URI="http://humdi.net/vnstat/${P}.tar.gz" |
60 |
|
61 |
LICENSE="GPL-2" |
62 |
SLOT="0" |
63 |
KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86" |
64 |
IUSE="gd" |
65 |
|
66 |
DEPEND=" |
67 |
gd? ( media-libs/gd[png] )" |
68 |
RDEPEND="${DEPEND} |
69 |
virtual/cron" |
70 |
|
71 |
pkg_setup() { |
72 |
enewgroup vnstat |
73 |
enewuser vnstat -1 -1 /dev/null vnstat |
74 |
} |
75 |
|
76 |
src_compile() { |
77 |
sed -i 's:vnstat[.]log:vnstatd.log:' cfg/vnstat.conf || die |
78 |
sed -i 's:vnstat[.]pid:vnstatd/vnstatd.pid:' cfg/vnstat.conf || die |
79 |
|
80 |
if use gd; then |
81 |
emake all CC="$(tc-getCC)" CFLAGS="${CFLAGS}" || die "emake all failed" |
82 |
else |
83 |
emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" || die "emake failed" |
84 |
fi |
85 |
} |
86 |
|
87 |
src_install() { |
88 |
if use gd; then |
89 |
dobin src/vnstati || die "vnstati dobin failed" |
90 |
fi |
91 |
dobin src/vnstat src/vnstatd || die "dobin failed" |
92 |
exeinto /etc/cron.hourly |
93 |
newexe "${FILESDIR}"/vnstat.cron vnstat || die |
94 |
|
95 |
insinto /etc |
96 |
doins cfg/vnstat.conf || die |
97 |
fowners root:vnstat /etc/vnstat.conf |
98 |
|
99 |
newconfd "${FILESDIR}/vnstatd.confd" vnstatd || die |
100 |
newinitd "${FILESDIR}/vnstatd.initd" vnstatd || die |
101 |
|
102 |
keepdir /var/lib/vnstat |
103 |
keepdir /var/run/vnstatd |
104 |
fowners vnstat:vnstat /var/lib/vnstat |
105 |
fowners vnstat:vnstat /var/run/vnstatd |
106 |
|
107 |
use gd && { doman man/vnstati.1 || die; } |
108 |
doman man/vnstat.1 man/vnstatd.1 || die |
109 |
|
110 |
newdoc examples/vnstat_ip-up ip-up.example || die |
111 |
newdoc examples/vnstat_ip-down ip-down.example || die |
112 |
newdoc INSTALL README.setup || die |
113 |
dodoc CHANGES README UPGRADE FAQ examples/vnstat.cgi || die |
114 |
} |
115 |
|
116 |
pkg_postinst() { |
117 |
# compatibility for 1.1 ebuild |
118 |
if [[ -d ${ROOT}/var/spool/vnstat ]]; then |
119 |
mv -f "${ROOT}"/var/spool/vnstat/* "${ROOT}"/var/lib/vnstat/ \ |
120 |
&& rmdir "${ROOT}"/var/spool/vnstat |
121 |
ewarn "vnStat db files have been moved from /var/spool/vnstat to /var/lib/vnstat" |
122 |
ewarn |
123 |
fi |
124 |
|
125 |
# Workaround feature/bug #141619 |
126 |
chown -R vnstat:vnstat "${ROOT}/var/lib/vnstat" |
127 |
chown vnstat:vnstat "${ROOT}/var/run/vnstatd" |
128 |
ewarn "vnStat db files owning user and group has been changed to \"vnstat\"." |
129 |
|
130 |
elog |
131 |
elog "Repeat the following command for every interface you" |
132 |
elog "wish to monitor (replace eth0):" |
133 |
elog " vnstat -u -i eth0" |
134 |
elog "and set correct permissions after that, e.g." |
135 |
elog " chown -R vnstat:vnstat /var/lib/vnstat" |
136 |
elog |
137 |
elog "Note: if an interface transfers more than ~4GB in" |
138 |
elog "the time between cron runs, you may miss traffic" |
139 |
elog |
140 |
|
141 |
if [[ -e ${ROOT}/etc/cron.d/vnstat ]] ; then |
142 |
elog "vnstat's cron script is now installed as /etc/cron.hourly/vnstat." |
143 |
elog "Please remove /etc/cron.d/vnstat." |
144 |
elog |
145 |
fi |
146 |
elog "To update the interfaces database automatically with cron, uncomment" |
147 |
elog "lines in /etc/cron.hourly/vnstat and set cron job to run it as" |
148 |
elog "frequently as required. Alternatively you can use vnstatd. Init script" |
149 |
elog "was installed into /etc/init.d/vnstatd for your convenience." |
150 |
elog |
151 |
elog "Starting with version 1.5 --dbdir option is droped. You can do the same" |
152 |
elog "with DatabaseDir directive in configuration file (/etc/vnstat.conf)." |
153 |
} |