aboutsummaryrefslogtreecommitdiffstats
path: root/net/vnstat
diff options
context:
space:
mode:
authordhn <dhn@FreeBSD.org>2009-04-30 23:47:46 +0800
committerdhn <dhn@FreeBSD.org>2009-04-30 23:47:46 +0800
commit11c02425fd07dc7aa207cf9f3431b75b78d50170 (patch)
tree082d1b34f66b10ae9ff2c63c78bace1b955740d6 /net/vnstat
parent7f5c07988898c14eb3fd51eaef21bd328e13685e (diff)
downloadfreebsd-ports-gnome-11c02425fd07dc7aa207cf9f3431b75b78d50170.tar.gz
freebsd-ports-gnome-11c02425fd07dc7aa207cf9f3431b75b78d50170.tar.zst
freebsd-ports-gnome-11c02425fd07dc7aa207cf9f3431b75b78d50170.zip
- Update to 1.7
Approved by: tabthorpe (co-mentor)
Diffstat (limited to 'net/vnstat')
-rw-r--r--net/vnstat/Makefile30
-rw-r--r--net/vnstat/distinfo6
-rw-r--r--net/vnstat/files/patch-Makefile132
-rw-r--r--net/vnstat/files/patch-cfg.c31
-rw-r--r--net/vnstat/files/patch-vnstat.c13
-rw-r--r--net/vnstat/pkg-plist4
6 files changed, 36 insertions, 180 deletions
diff --git a/net/vnstat/Makefile b/net/vnstat/Makefile
index a86264bb4078..61037b6030a6 100644
--- a/net/vnstat/Makefile
+++ b/net/vnstat/Makefile
@@ -6,29 +6,41 @@
#
PORTNAME= vnstat
-PORTVERSION= 1.6
-PORTREVISION= 3
+PORTVERSION= 1.7
CATEGORIES= net
MASTER_SITES= http://humdi.net/vnstat/ \
- http://mirror.mcx2.org/ \
- http://ftp.uwsg.indiana.edu/FreeBSD/distfiles/ \
- ftp://ftp.jpix.ad.jp/pub/FreeBSD/ports/distfiles/
-DISTNAME= ${PORTNAME}-${PORTVERSION}_bsd
+ http://mirror.mcx2.org/
MAINTAINER= dhn@FreeBSD.org
COMMENT= A console-based network traffic monitor
-MAN1= vnstat.1
+LIB_DEPENDS+= gd.4:${PORTSDIR}/graphics/gd
+
+MAKE_ARGS= CFLAGS="-I${LOCALBASE}/include" \
+ LDFLAGS="-L${LOCALBASE}/lib"
+INSTALL_TARGET= bsdinstall
+
+MAN1= vnstat.1 vnstatd.1 vnstati.1 vnstat.conf.1
MANCOMPRESSED= yes
-PORTDOCS= README INSTALL vnstat-cron
-WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
+PORTDOCS= README INSTALL_BSD UPGRADE vnstat-cron
SUB_FILES= pkg-message
+PLIST_FILES= bin/vnstat \
+ sbin/vnstatd \
+ bin/vnstati \
+ etc/vnstat.conf.sample
+
post-extract:
@cd ${WRKSRC} && ${CP} cron/vnstat vnstat-cron
+ @cd ${WRKSRC} && ${CP} cfg/vnstat.conf cfg/vnstat.conf.sample
@${REINPLACE_CMD} -e 's|/usr/bin|/usr/local/bin|g' \
-e 's|ls /var/lib|ls -l /var/db|g' ${WRKSRC}/vnstat-cron
+post-patch:
+ @${REINPLACE_CMD} -e 's|$$(DESTDIR)|${PREFIX}|g' \
+ -e 's|cfg/vnstat.conf|cfg/vnstat.conf.sample|g' \
+ -e '134,135d' ${WRKSRC}/Makefile
+
post-install:
.if !defined(NOPORTDOCS)
@${ECHO_MSG} "installing additional documentation to ${DOCSDIR}"
diff --git a/net/vnstat/distinfo b/net/vnstat/distinfo
index d012b68de8df..415b614d9073 100644
--- a/net/vnstat/distinfo
+++ b/net/vnstat/distinfo
@@ -1,3 +1,3 @@
-MD5 (vnstat-1.6_bsd.tar.gz) = e186b05ea3994c4b5c14185f9e730e08
-SHA256 (vnstat-1.6_bsd.tar.gz) = dc04518731f9c07b3e0b43762337bb4357670cf3b0c042c12b4b8d039a141807
-SIZE (vnstat-1.6_bsd.tar.gz) = 37085
+MD5 (vnstat-1.7.tar.gz) = e5788e8122e34f2c93561e2a84c19432
+SHA256 (vnstat-1.7.tar.gz) = 146ed44226dbb83e42a1f73052e674e5c859f6ff3700501c1429f7af1d3952ca
+SIZE (vnstat-1.7.tar.gz) = 61879
diff --git a/net/vnstat/files/patch-Makefile b/net/vnstat/files/patch-Makefile
index 8e8f1dfe9298..0f126882fa12 100644
--- a/net/vnstat/files/patch-Makefile
+++ b/net/vnstat/files/patch-Makefile
@@ -1,123 +1,15 @@
---- Makefile.orig 2008-02-03 13:23:03.000000000 -0500
-+++ Makefile 2008-02-21 19:51:31.000000000 -0500
-@@ -1,106 +1,29 @@
--# bin, man and cron dirs
--BIN = $(DESTDIR)/usr/bin
--MAN = $(DESTDIR)/usr/share/man
--CRON = $(DESTDIR)/etc/cron.d
-+# FreeBSD port by Dennis Herrmann
-+PREFIX?= /usr/local
+--- Makefile.orig 2009-04-13 11:03:12.000000000 +0200
++++ Makefile 2009-04-13 11:05:03.000000000 +0200
+@@ -4,9 +4,9 @@
+ MAN = $(DESTDIR)/usr/share/man
--vnstat:
-+all:
- +make -C src vnstat
+ # bin and man dirs for *BSD
+-BIN_BSD = $(DESTDIR)/usr/local/bin
+-SBIN_BSD = $(DESTDIR)/usr/local/sbin
+-MAN_BSD = $(DESTDIR)/usr/local/man
++BIN_BSD = ${PREFIX}/bin
++SBIN_BSD = ${PREFIX}/sbin
++MAN_BSD = ${PREFIX}/man
- clean:
- make -C src clean
+ default: vnstat
- install:
-- @echo "Installing vnStat..."
--
--# move some really old version database(s) if found
-- @if [ -d $(DESTDIR)/var/spool/vnstat ]; \
-- then echo "Moving old database(s) to new location..."; \
-- mv -f $(DESTDIR)/var/spool/vnstat $(DESTDIR)/var/lib/; \
-- fi
--
--# remove some really old version binary if found
-- @if [ -x $(DESTDIR)/usr/local/bin/vnstat ]; \
-- then echo "Removing old binary..."; \
-- rm -f $(DESTDIR)/usr/local/bin/vnstat; \
-- fi
--
--# install ppp scripts if directory is found
-- @if [ -d $(DESTDIR)/etc/ppp/ip-up.d ]; \
-- then echo "Installing ppp/ip-up script"; \
-- cp -f pppd/vnstat_ip-up $(DESTDIR)/etc/ppp/ip-up.d/vnstat; \
-- chmod 755 $(DESTDIR)/etc/ppp/ip-up.d/vnstat; \
-- fi
-- @if [ -d $(DESTDIR)/etc/ppp/ip-down.d ]; \
-- then echo "Installing ppp/ip-down script"; \
-- cp -f pppd/vnstat_ip-down $(DESTDIR)/etc/ppp/ip-down.d/vnstat; \
-- chmod 755 $(DESTDIR)/etc/ppp/ip-down.d/vnstat; \
-- fi
--
--# install default config if such doesn't exist
-- @if [ ! -f $(DESTDIR)/etc/vnstat.conf ]; \
-- then install -m 644 cfg/vnstat.conf $(DESTDIR)/etc; \
-- fi
--
-- install -d $(BIN) $(MAN)/man1 $(CRON) $(DESTDIR)/var/lib/vnstat
-- install -s -m 755 src/vnstat $(BIN)
--
--# update man page, gzip it if previous version was done so
-- @if [ -f $(MAN)/man1/vnstat.1.gz ]; \
-- then install -m 644 man/vnstat.1 $(MAN)/man1; \
-- gzip -f9 $(MAN)/man1/vnstat.1; \
-- else install -m 644 man/vnstat.1 $(MAN)/man1; \
-- fi
--
-- install -m 644 cron/vnstat $(CRON)
--
--uninstall:
-- @echo "Uninstalling vnStat..."
-- @echo
-- @echo "Note: this will also remove the database directory"
-- @echo "including any database located there"
-- @echo
-- @echo "Press CTRL-C to abort within 10 sec."
-- @sleep 10
-- rm -fr $(DESTDIR)/var/lib/vnstat
-- rm -f $(BIN)/vnstat
-- rm -f $(MAN)/man1/vnstat.1*
-- rm -f $(CRON)/vnstat
-- rm -f $(DESTDIR)/etc/vnstat.conf
-- rm -f $(DESTDIR)/etc/ppp/ip-up.d/vnstat
-- rm -f $(DESTDIR)/etc/ppp/ip-down.d/vnstat
--
--bsdinstall:
-- @echo "Installing vnStat (BSD)..."
--
-+ @mkdir -p ${DESTDIR}${PREFIX}/bin
- install -dm 755 /var/db/vnstat
-- install -m 755 src/vnstat /usr/local/bin
-+ install -m 755 src/vnstat ${PREFIX}/bin
-
- # install default config if such doesn't exist
-- @if [ ! -f /etc/vnstat.conf ]; \
-- then install -m 644 cfg/vnstat.conf /etc; \
-- sed -i "" -e 's/lib/db/g' /etc/vnstat.conf; \
-- fi
--
--# install cron if it isn' there already
-- @if [ `grep -c vnstat /etc/crontab` -eq 0 ]; \
-- then cat cron/vnstat >>/etc/crontab; \
-- sed -i "" -e 's/lib\/vnstat/db\/vnstat/g' -e 's/\/usr\/bin\/vnstat/\/usr\/local\/bin\/vnstat/g' /etc/crontab; \
-+ @if [ ! -f ${PREFIX}/etc/vnstat.conf.sample ]; \
-+ then install -m 644 cfg/vnstat.conf ${PREFIX}/etc/vnstat.conf.sample; \
-+ sed -i "" -e 's/lib/db/g' ${PREFIX}/etc/vnstat.conf.sample; \
- fi
-
- # update man page
-- install -m 644 man/vnstat.1 /usr/local/man/man1
-- gzip -f9 /usr/local/man/man1/vnstat.1
-+ install -m 644 man/vnstat.1 ${PREFIX}/man/man1
-+ gzip -f9 ${PREFIX}/man/man1/vnstat.1
-
--bsduninstall:
-- @echo "Uninstalling vnStat (BSD)..."
-- @echo
-- @echo "Note: this will also remove the database directory"
-- @echo "including any database located there"
-- @echo
-- @echo "Press CTRL-C to abort within 10 sec."
-- @sleep 10
-+deinstall:
- rm -fr /var/db/vnstat
-- rm -f /usr/local/bin/vnstat
-- rm -f /usr/local/man/man1/vnstat.1*
-- rm -f /etc/vnstat.conf
-- @echo "The cron entry from /etc/crontab needs to be removed manually."
-+ rm -f ${PREFIX}/bin/vnstat
-+ rm -f ${PREFIX}/man/man1/vnstat.1*
-+ rm -f ${PREFIX}/etc/vnstat.conf.sample
diff --git a/net/vnstat/files/patch-cfg.c b/net/vnstat/files/patch-cfg.c
deleted file mode 100644
index d3c7e868cef2..000000000000
--- a/net/vnstat/files/patch-cfg.c
+++ /dev/null
@@ -1,31 +0,0 @@
---- src/cfg.c.orig 2008-02-01 23:11:50.000000000 +0100
-+++ src/cfg.c 2008-02-18 18:23:22.000000000 +0100
-@@ -36,8 +36,8 @@
- printf("MaxBandwidth %d\n\n", cfg.maxbw);
-
- printf("# interface specific limits\n");
-- printf("# example 8Mbit limit for eth0 (remove # to activate):\n");
-- printf("#MaxBWeth0 8\n");
-+ printf("# example 8Mbit limit for fxp0 (remove # to activate):\n");
-+ printf("#MaxBWfxp0 8\n");
-
- while (p != NULL) {
- printf("MaxBW%s %d\n", p->interface, p->limit);
-@@ -86,7 +86,7 @@
- /* load default config */
- defaultcfg();
-
-- /* possible config files: 1) --config 2) $HOME/.vnstatrc 3) /etc/vnstat.conf 4) none */
-+ /* possible config files: 1) --config 2) $HOME/.vnstatrc 3) /usr/local/etc/vnstat.conf 4) none */
-
- if (cfgfile[0]!='\0') {
-
-@@ -112,7 +112,7 @@
- if (tryhome && (fd=fopen(buffer, "r"))!=NULL) {
- if (debug)
- printf("Config file: $HOME/.vnstatrc\n");
-- } else if ((fd=fopen("/etc/vnstat.conf", "r"))!=NULL) {
-+ } else if ((fd=fopen("/usr/local/etc/vnstat.conf", "r"))!=NULL) {
- if (debug)
- printf("Config file: /etc/vnstat.conf\n");
- } else {
diff --git a/net/vnstat/files/patch-vnstat.c b/net/vnstat/files/patch-vnstat.c
deleted file mode 100644
index a70c8dcc3abe..000000000000
--- a/net/vnstat/files/patch-vnstat.c
+++ /dev/null
@@ -1,13 +0,0 @@
---- src/vnstat.c.orig 2008-02-01 23:11:50.000000000 +0100
-+++ src/vnstat.c 2008-02-18 18:18:30.000000000 +0100
-@@ -524,8 +524,8 @@
- if (files==0) {
- printf("No database found, nothing to do. Use --help for help.\n\n");
- printf("A new database can be created with the following command:\n");
-- printf(" %s -u -i eth0\n\n", argv[0]);
-- printf("Replace 'eth0' with the interface that should be monitored. A list\n");
-+ printf(" %s -u -i fxp0\n\n", argv[0]);
-+ printf("Replace 'fxp0' with the interface that should be monitored. A list\n");
- printf("of available interfaces can be seen with the 'ifconfig' command.\n");
- } else {
- printf("Nothing to do. Use --help for help.\n");
diff --git a/net/vnstat/pkg-plist b/net/vnstat/pkg-plist
deleted file mode 100644
index d3a32f4d51ef..000000000000
--- a/net/vnstat/pkg-plist
+++ /dev/null
@@ -1,4 +0,0 @@
-@exec mkdir -p /var/db/vnstat
-bin/vnstat
-etc/vnstat.conf.sample
-@dirrmtry /var/db/vnstat