summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaúl Porcel <armin76@gentoo.org>2008-06-27 21:15:24 +0000
committerRaúl Porcel <armin76@gentoo.org>2008-06-27 21:15:24 +0000
commit086e1d3ac37821be05b014488a62c6442364b5e1 (patch)
treef3cb7058ac11ad060c4c8908876e22ea49dccec2 /net-analyzer/vnstat
parentold (diff)
downloadgentoo-2-086e1d3ac37821be05b014488a62c6442364b5e1.tar.gz
gentoo-2-086e1d3ac37821be05b014488a62c6442364b5e1.tar.bz2
gentoo-2-086e1d3ac37821be05b014488a62c6442364b5e1.zip
old
(Portage version: 2.1.4.4)
Diffstat (limited to 'net-analyzer/vnstat')
-rw-r--r--net-analyzer/vnstat/ChangeLog7
-rw-r--r--net-analyzer/vnstat/files/vnstat-1.4-dbdir.patch162
-rw-r--r--net-analyzer/vnstat/files/vnstat-1.4-long_iface_name.patch49
-rw-r--r--net-analyzer/vnstat/vnstat-1.4-r2.ebuild75
-rw-r--r--net-analyzer/vnstat/vnstat-1.5.ebuild70
5 files changed, 6 insertions, 357 deletions
diff --git a/net-analyzer/vnstat/ChangeLog b/net-analyzer/vnstat/ChangeLog
index a8c063a8db39..e9714c17517c 100644
--- a/net-analyzer/vnstat/ChangeLog
+++ b/net-analyzer/vnstat/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for net-analyzer/vnstat
# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/vnstat/ChangeLog,v 1.31 2008/03/01 14:06:55 angelos Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/vnstat/ChangeLog,v 1.32 2008/06/27 21:15:23 armin76 Exp $
+
+ 27 Jun 2008; Raúl Porcel <armin76@gentoo.org>
+ -files/vnstat-1.4-dbdir.patch, -files/vnstat-1.4-long_iface_name.patch,
+ -vnstat-1.4-r2.ebuild, -vnstat-1.5.ebuild:
+ old
01 Mar 2008; Christoph Mende <angelos@gentoo.org> vnstat-1.6.ebuild:
Stable on amd64, bug #210843
diff --git a/net-analyzer/vnstat/files/vnstat-1.4-dbdir.patch b/net-analyzer/vnstat/files/vnstat-1.4-dbdir.patch
deleted file mode 100644
index 77018240ae95..000000000000
--- a/net-analyzer/vnstat/files/vnstat-1.4-dbdir.patch
+++ /dev/null
@@ -1,162 +0,0 @@
-diff -upr vnstat-1.4.orig/Makefile vnstat-1.4/Makefile
---- vnstat-1.4.orig/Makefile 2006-04-09 17:03:42.000000000 +0200
-+++ vnstat-1.4/Makefile 2006-04-09 17:19:03.000000000 +0200
-@@ -9,12 +9,6 @@ vnstat:
- 64bit:
- +make -C src 64bit
-
--single:
-- +make -C src single
--
--64bitsingle:
-- +make -C src 64bitsingle
--
- clean:
- make -C src clean
-
-diff -upr vnstat-1.4.orig/man/vnstat.1 vnstat-1.4/man/vnstat.1
---- vnstat-1.4.orig/man/vnstat.1 2006-04-09 17:03:42.000000000 +0200
-+++ vnstat-1.4/man/vnstat.1 2006-04-09 17:53:23.000000000 +0200
-@@ -16,6 +16,9 @@ vnStat \- a console-based network traffi
- ] [
- .B \-\-days
- ] [
-+.B \-\-dbdir
-+.I [dir]
-+] [
- .B \-\-debug
- ] [
- .B \-\-disable
-@@ -123,6 +126,17 @@ Show traffic for 7 days, current and pre
- .BI "--cleartop"
- Remove all top10 entries.
- .TP
-+.BI "--dbdir " [dir]
-+If the parameter
-+.I dir
-+is specified, set the database directory to it. If
-+.I dir
-+is not specified, set the database directory to $HOME/.vnstat.
-+If this parameter is not specified at all, the database directory
-+is the global one.
-+.I dir
-+must not begin with a dash (-).
-+.TP
- .BI "--dumpdb"
- Instead of showing the database with a formated output, this output will
- dump the whole database in a format that should be easy to parse with most
-diff -upr vnstat-1.4.orig/src/Makefile vnstat-1.4/src/Makefile
---- vnstat-1.4.orig/src/Makefile 2006-04-09 17:03:42.000000000 +0200
-+++ vnstat-1.4/src/Makefile 2006-04-09 17:19:15.000000000 +0200
-@@ -11,12 +11,6 @@ vnstat: $(OBJS) vnstat.c vnstat.h
- 64bit: $(OBJS64) vnstat.c vnstat.h
- $(CC) $(CFLAGS) -o vnstat vnstat.c $(OBJS64) -DBLIMIT
-
--single: $(OBJS) vnstat.c vnstat.h
-- $(CC) $(CFLAGS) -o vnstat vnstat.c $(OBJS) -DSINGLE
--
--64bitsingle: $(OBJS64) vnstat.c vnstat.h
-- $(CC) $(CFLAGS) -o vnstat vnstat.c $(OBJS64) -DSINGLE -DBLIMIT
--
- proc.o: proc.c proc.h vnstat.h db.h
- $(CC) $(CFLAGS) -c proc.c
-
-diff -upr vnstat-1.4.orig/src/vnstat.c vnstat-1.4/src/vnstat.c
---- vnstat-1.4.orig/src/vnstat.c 2006-04-09 17:03:42.000000000 +0200
-+++ vnstat-1.4/src/vnstat.c 2006-04-09 17:55:42.000000000 +0200
-@@ -44,38 +44,7 @@ int main(int argc, char *argv[]) {
- current=time(NULL);
-
- /* init dirname */
--#ifdef SINGLE
-- strncpy(dirname, getenv("HOME"), 500);
-- strcat(dirname,"/.vnstat");
--#else
- strncpy(dirname, DATABASEDIR, 500);
--#endif
--
-- /* check if the database dir exists and if it contains files */
-- if ((dir=opendir(dirname))!=NULL) {
-- if (debug)
-- printf("Dir OK\n");
-- while ((di=readdir(dir))) {
-- if (di->d_name[0]!='.') {
-- strncpy(definterface, di->d_name, 32);
-- files++;
-- }
-- }
-- if (debug)
-- printf("%d files found\n", files);
-- if (files) {
-- query=1;
-- if (files>1)
-- strncpy(definterface, DEFIFACE, 32);
-- }
-- closedir(dir);
-- } else {
-- printf("Error:\nUnable to open database directory \"%s\".\n", dirname);
-- printf("Make sure it exists and is read enabled for this user.\n");
-- printf("Exiting...\n");
-- exit(0);
-- }
--
-
- /* parse parameters, maybe not the best way but... */
- for (currentarg=1; currentarg<argc; currentarg++) {
-@@ -110,6 +79,8 @@ int main(int argc, char *argv[]) {
- printf("\t -D, --debug\t\t show some additional debug information\n");
- printf("\t -v, --version\t\t show version\n");
- printf("\t -tr, --traffic\t\t calculate traffic\n");
-+ printf("\t --dbdir [DIR]\t\t change database directory to DIR\n");
-+ printf("\t \t\t DIR defaults to $HOME/.vnstat\n");
- printf("\t --testkernel\t\t check if the kernel is broken\n");
- printf("\t --longhelp\t\t display this help\n\n");
-
-@@ -211,6 +182,14 @@ int main(int argc, char *argv[]) {
- } else if (strcmp(argv[currentarg],"--testkernel")==0) {
- kerneltest();
- exit(0);
-+ } else if (strncmp(argv[currentarg], "--dbdir", 7)==0) {
-+ if ((currentarg + 1) < argc && argv[currentarg + 1][0] != '-') {
-+ strncpy(dirname, argv[currentarg + 1], 510);
-+ currentarg++;
-+ } else {
-+ strncpy(dirname, getenv("HOME"), 500);
-+ strcat(dirname, "/.vnstat");
-+ }
- } else if ((strcmp(argv[currentarg],"-v")==0) || (strcmp(argv[currentarg],"--version"))==0) {
- printf("vnStat %s by Teemu Toivola <tst at iki dot fi>\n", VNSTATVERSION);
- #ifndef SINGLE
-@@ -238,6 +217,31 @@ int main(int argc, char *argv[]) {
-
- }
-
-+ /* check if the database dir exists and if it contains files */
-+ if ((dir=opendir(dirname))!=NULL) {
-+ if (debug)
-+ printf("Dir OK\n");
-+ while ((di=readdir(dir))) {
-+ if (di->d_name[0]!='.') {
-+ strncpy(definterface, di->d_name, 32);
-+ files++;
-+ }
-+ }
-+ if (debug)
-+ printf("%d files found\n", files);
-+ if (files) {
-+ query=1;
-+ if (files>1)
-+ strncpy(definterface, DEFIFACE, 32);
-+ }
-+ closedir(dir);
-+ } else {
-+ printf("Error:\nUnable to open database directory \"%s\".\n", dirname);
-+ printf("Make sure it exists and is read enabled for this user.\n");
-+ printf("Exiting...\n");
-+ exit(0);
-+ }
-+
- /* counter reset */
- if (reset) {
- if (!spacecheck(dirname) && !force) {
-Only in vnstat-1.4/src: .vnstat.c.swp
diff --git a/net-analyzer/vnstat/files/vnstat-1.4-long_iface_name.patch b/net-analyzer/vnstat/files/vnstat-1.4-long_iface_name.patch
deleted file mode 100644
index ba869b6fb7dd..000000000000
--- a/net-analyzer/vnstat/files/vnstat-1.4-long_iface_name.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-Interface names can be more than 7 chars long.
-
-Patch by Aleksey Fedoseev.
-
---- vnstat-1.4/src/proc.c
-+++ vnstat-1.4/src/proc.c
-@@ -64,6 +64,7 @@
- void parseproc(int newdb)
- {
- char temp[64];
-+ char* colon_pos;
- uint64_t rx, tx, rxchange=0, txchange=0, btime; /* rxchange = rx change in MB */
- uint64_t krxchange=0, ktxchange=0; /* krxchange = rx change in kB */
- time_t current;
-@@ -86,12 +87,22 @@
-
- current=time(NULL);
-
-- /* get rx from procline, easy since it's always procline+7 */
-+ /* get rx position, then get it from procline */
-+
-+ colon_pos = strchr(procline, ':');
-+ if (colon_pos == NULL) {
-+ if (debug) {
-+ printf("Bad /proc/net/dev string");
-+ }
-+ return;
-+ }
-+
-+ colon_pos++;
-
- #ifdef BLIMIT
-- rx=strtoull(procline+7, (char **)NULL, 0);
-+ rx=strtoull(colon_pos, (char **)NULL, 0);
- #else
-- rx=strtoul(procline+7, (char **)NULL, 0);
-+ rx=strtoul(colon_pos, (char **)NULL, 0);
- #endif
-
- if (newdb!=1) {
-@@ -116,7 +127,7 @@
-
-
- /* get tx from procline, ugly hack */
-- sscanf(procline+7,"%s %s %s %s %s %s %s %s %s",temp,temp,temp,temp,temp,temp,temp,temp,temp);
-+ sscanf(colon_pos, "%s %s %s %s %s %s %s %s %s",temp,temp,temp,temp,temp,temp,temp,temp,temp);
-
- #ifdef BLIMIT
- tx=strtoull(temp, (char **)NULL, 0);
diff --git a/net-analyzer/vnstat/vnstat-1.4-r2.ebuild b/net-analyzer/vnstat/vnstat-1.4-r2.ebuild
deleted file mode 100644
index 8ccfe6df81f9..000000000000
--- a/net-analyzer/vnstat/vnstat-1.4-r2.ebuild
+++ /dev/null
@@ -1,75 +0,0 @@
-# Copyright 1999-2007 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/vnstat/vnstat-1.4-r2.ebuild,v 1.10 2007/12/26 17:28:51 pva Exp $
-
-inherit eutils toolchain-funcs
-
-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 ppc ppc64 sparc x86"
-IUSE=""
-
-RDEPEND="virtual/cron"
-
-src_unpack() {
- unpack ${A}
- cd "${S}"
- epatch \
- "${FILESDIR}/${P}-long_iface_name.patch" \
- "${FILESDIR}/${P}-dbdir.patch"
- sed -i \
- -e "s:^\(CFLAGS = \).*$:\1${CFLAGS}:" \
- -e "s:^\(CC = \).*$:\1$(tc-getCC):" \
- src/Makefile || die "sed failed"
-}
-
-src_compile() {
- emake || die
-}
-
-src_install() {
- keepdir /var/lib/vnstat
-
- dobin src/vnstat || die
- exeinto /etc/cron.hourly
- newexe "${FILESDIR}"/vnstat.cron vnstat
- doman man/vnstat.1
-
- newdoc pppd/vnstat_ip-down ip-down.example
- newdoc pppd/vnstat_ip-up ip-up.example
- dodoc CHANGES README UPGRADE FAQ
- newdoc INSTALL README.setup
-}
-
-pkg_postinst() {
- # compatibility for 1.1 ebuild
- if [[ -d ${ROOT}/var/spool/vnstat ]] ; then
- mv -f "${ROOT}"/var/spool/vnstat/* "${ROOT}"/var/lib/vnstat/ \
- && rmdir "${ROOT}"/var/spool/vnstat
- elog "vnStat db files moved from /var/spool/vnstat to /var/lib/vnstat"
- elog
- fi
-
- elog "Repeat the following command for every interface you"
- elog "wish to monitor (replace eth0):"
- elog " vnstat -u -i eth0"
- elog
- elog "Note: if an interface transfers more than ~4GB in"
- elog "the time between cron runs, you may miss traffic"
- elog
-
- if [[ -e ${ROOT}/etc/cron.d/vnstat ]] ; then
- elog "vnstat\'s cron script is now installed as /etc/cron.hourly/vnstat."
- elog "Please remove /etc/cron.d/vnstat."
- elog
- else
- elog "A cron script has been installed to /etc/cron.hourly/vnstat."
- elog
- fi
- elog "To update your interface database automatically with"
- elog "cron, uncomment the lines in /etc/cron.hourly/vnstat."
-}
diff --git a/net-analyzer/vnstat/vnstat-1.5.ebuild b/net-analyzer/vnstat/vnstat-1.5.ebuild
deleted file mode 100644
index 1c38773a6da7..000000000000
--- a/net-analyzer/vnstat/vnstat-1.5.ebuild
+++ /dev/null
@@ -1,70 +0,0 @@
-# Copyright 1999-2007 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/vnstat/vnstat-1.5.ebuild,v 1.1 2007/12/26 17:28:51 pva Exp $
-
-inherit eutils toolchain-funcs
-
-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 ~ppc ~ppc64 ~sparc ~x86"
-IUSE=""
-
-RDEPEND="virtual/cron"
-
-src_compile() {
- emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" || die "Compilation failed"
-}
-
-src_install() {
- dobin src/vnstat || die
- exeinto /etc/cron.hourly
- newexe "${FILESDIR}"/vnstat.cron vnstat
-
- insinto /etc
- doins cfg/vnstat.conf
-
- doman man/vnstat.1
-
- keepdir /var/lib/vnstat
-
- newdoc pppd/vnstat_ip-up ip-up.example
- newdoc pppd/vnstat_ip-down ip-down.example
- dodoc CHANGES README UPGRADE FAQ
- newdoc INSTALL README.setup
-}
-
-pkg_postinst() {
- # compatibility for 1.1 ebuild
- if [[ -d ${ROOT}/var/spool/vnstat ]] ; then
- mv -f "${ROOT}"/var/spool/vnstat/* "${ROOT}"/var/lib/vnstat/ \
- && rmdir "${ROOT}"/var/spool/vnstat
- elog "vnStat db files moved from /var/spool/vnstat to /var/lib/vnstat"
- elog
- fi
-
- elog "Repeat the following command for every interface you"
- elog "wish to monitor (replace eth0):"
- elog " vnstat -u -i eth0"
- elog
- elog "Note: if an interface transfers more than ~4GB in"
- elog "the time between cron runs, you may miss traffic"
- elog
-
- if [[ -e ${ROOT}/etc/cron.d/vnstat ]] ; then
- elog "vnstat's cron script is now installed as /etc/cron.hourly/vnstat."
- elog "Please remove /etc/cron.d/vnstat."
- elog
- else
- elog "A cron script has been installed to /etc/cron.hourly/vnstat."
- elog
- fi
- elog "To update your interface database automatically with"
- elog "cron, uncomment the lines in /etc/cron.hourly/vnstat."
- elog
- elog "Starting with version 1.5 --dbdir option is droped. You can do the same"
- elog "with DatabaseDir directive in configuration file (/etc/vnstat.conf)."
-}