[78104] trunk/dports/net

and.damore at macports.org and.damore at macports.org
Sat Apr 23 11:59:23 PDT 2011


Revision: 78104
          http://trac.macports.org/changeset/78104
Author:   and.damore at macports.org
Date:     2011-04-23 11:59:22 -0700 (Sat, 23 Apr 2011)
Log Message:
-----------
new port vnstat, network traffic monitor

Added Paths:
-----------
    trunk/dports/net/vnstat/
    trunk/dports/net/vnstat/Portfile
    trunk/dports/net/vnstat/files/
    trunk/dports/net/vnstat/files/patch-makefile.diff

Added: trunk/dports/net/vnstat/Portfile
===================================================================
--- trunk/dports/net/vnstat/Portfile	                        (rev 0)
+++ trunk/dports/net/vnstat/Portfile	2011-04-23 18:59:22 UTC (rev 78104)
@@ -0,0 +1,51 @@
+# $Id: Portfile 77708 2011-04-09 23:21:20Z and.damore at macports.org $
+PortSystem 1.0
+
+name                vnstat
+version             1.10
+categories          net
+platforms           darwin
+maintainers         and.damore openmaintainer
+description         console-based network traffic monitor
+long_description    \
+	vnStat is a console-based network traffic monitor for Linux and BSD that keeps \
+	a log of network traffic for the selected interface(s), it uses the network \
+	interface statistics provided by the kernel as information source.  This means \
+	that vnStat won't actually be sniffing any traffic and also ensures light use \
+	of system resources. 
+
+homepage            http://wsapi.luaforge.net/
+master_sites        http://humdi.net/${name}
+
+checksums           md5     95421d968689130590348ceb80ff74a8 \
+                    sha1    813177fb55296deaf5059bb111885616f4d8a86f \
+                    rmd160  1fddc4343cb3206cce42516f7ff61024c65eed3f
+
+use_configure       no
+
+destroot.target     bsdinstall
+depends_lib         port:gd2       
+
+patchfiles          patch-makefile.diff
+
+#post-patch {
+#    reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/Makefile
+#    reinplace "s|DESTDIR)/etc/vnstat|DESTDIR)${prefix}/etc/vnstat|g" ${worksrcpath}/Makefile
+#}
+
+post-destroot {
+    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
+    xinstall -m 755 -d ${destroot}${prefix}/share/examples/${name}
+    
+    xinstall -m 644 \
+		${worksrcpath}/CHANGES \
+		${worksrcpath}/COPYING \
+		${worksrcpath}/FAQ \
+		${worksrcpath}/INSTALL \
+		${worksrcpath}/INSTALL_BSD \
+		${worksrcpath}/README \
+		${destroot}${prefix}/share/doc/${name}
+
+    file copy {*}[glob ${worksrcpath}/examples/*] ${destroot}${prefix}/share/examples/${name}
+}
+

Added: trunk/dports/net/vnstat/files/patch-makefile.diff
===================================================================
--- trunk/dports/net/vnstat/files/patch-makefile.diff	                        (rev 0)
+++ trunk/dports/net/vnstat/files/patch-makefile.diff	2011-04-23 18:59:22 UTC (rev 78104)
@@ -0,0 +1,76 @@
+--- Makefile.orig	2011-04-23 20:41:36.000000000 +0200
++++ Makefile	2011-04-23 20:42:09.000000000 +0200
+@@ -4,9 +4,9 @@
+ MAN = $(DESTDIR)/usr/share/man
+ 
+ # 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 = $(DESTDIR)/opt/local/bin
++SBIN_BSD = $(DESTDIR)/opt/local/sbin
++MAN_BSD = $(DESTDIR)/opt/local/share/man
+ 
+ default: vnstat
+ 
+@@ -41,15 +41,15 @@
+ 	fi
+ 
+ # remove some really old version binary if found
+-	@if [ -x "$(DESTDIR)/usr/local/bin/vnstat" ]; \
++	@if [ -x "$(DESTDIR)/opt/local/bin/vnstat" ]; \
+ 	then echo "Removing old binary..."; \
+-	rm -f $(DESTDIR)/usr/local/bin/vnstat; \
++	rm -f $(DESTDIR)/opt/local/bin/vnstat; \
+ 	fi
+ 
+ # install default config if such doesn't exist
+-	@if [ ! -f "$(DESTDIR)/etc/vnstat.conf" ]; \
+-	then echo "Installing config to $(DESTDIR)/etc/vnstat.conf"; \
+-	install -D -m 644 cfg/vnstat.conf $(DESTDIR)/etc/vnstat.conf; \
++	@if [ ! -f "$(DESTDIR)/opt/local/etc/vnstat.conf" ]; \
++	then echo "Installing config to $(DESTDIR)/opt/local/etc/vnstat.conf"; \
++	install -D -m 644 cfg/vnstat.conf $(DESTDIR)/opt/local/etc/vnstat.conf; \
+ 	fi
+ 
+ # install everything else
+@@ -106,7 +106,7 @@
+ 	rm -f $(MAN)/man1/vnstat*
+ 	rm -f $(MAN)/man5/vnstat*
+ 	rm -f $(DESTDIR)/etc/cron.d/vnstat
+-	rm -f $(DESTDIR)/etc/vnstat.conf
++	rm -f $(DESTDIR)/opt/local/etc/vnstat.conf
+ 	rm -f $(DESTDIR)/etc/ppp/ip-up.d/vnstat
+ 	rm -f $(DESTDIR)/etc/ppp/ip-down.d/vnstat
+ 
+@@ -136,16 +136,18 @@
+ 	fi
+ 
+ # install default config if such doesn't exist
+-	@if [ ! -f $(DESTDIR)/etc/vnstat.conf ]; \
+-	then echo "Installing config to $(DESTDIR)/etc/vnstat.conf"; \
+-	install -D -m 644 cfg/vnstat.conf $(DESTDIR)/etc/vnstat.conf; \
+-	sed -e 's/lib/db/g' $(DESTDIR)/etc/vnstat.conf >$(DESTDIR)/etc/vnstat.conf.bsd; \
+-	mv -f $(DESTDIR)/etc/vnstat.conf.bsd $(DESTDIR)/etc/vnstat.conf; \
++	@if [ ! -f $(DESTDIR)/opt/local/etc/vnstat.conf ]; \
++	then echo "Installing config to $(DESTDIR)/opt/local/etc/vnstat.conf"; \
++	install -d -m 644 cfg/vnstat.conf $(DESTDIR)/opt/local/etc/vnstat.conf; \
++	sed -e 's/lib/db/g' $(DESTDIR)/opt/local/etc/vnstat.conf >$(DESTDIR)/opt/local/etc/vnstat.conf.bsd; \
++	mv -f $(DESTDIR)/opt/local/etc/vnstat.conf.bsd $(DESTDIR)/opt/local/etc/vnstat.conf; \
+ 	fi
+ 
+ # update man page	
++	install -d -m 644 $(MAN_BSD)/man1
+ 	install -m 644 man/vnstat.1 $(MAN_BSD)/man1
+ 	install -m 644 man/vnstatd.1 $(MAN_BSD)/man1
++	install -d -m 644 $(MAN_BSD)/man5
+ 	install -m 644 man/vnstat.conf.5 $(MAN_BSD)/man5
+ 	gzip -f9 $(MAN_BSD)/man1/vnstat.1
+ 	gzip -f9 $(MAN_BSD)/man1/vnstatd.1
+@@ -183,5 +185,5 @@
+ 	rm -f $(SBIN_BSD)/vnstatd
+ 	rm -f $(MAN_BSD)/man1/vnstat*
+ 	rm -f $(MAN_BSD)/man5/vnstat*
+-	rm -f $(DESTDIR)/etc/vnstat.conf
++	rm -f $(DESTDIR)/opt/local/etc/vnstat.conf
+ 	@echo "A possible cron entry needs to be removed manually if such exists."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110423/855bc093/attachment-0001.html>


More information about the macports-changes mailing list